reformatting hard drive

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
jonass

reformatting hard drive

Post by jonass »

Screenshot.png
I'll post a screenshot of the gparted view of the drive i want to change.

Is it possible to delete partitions at the front of a drive and then add the free space to a partition at the end of the drive? I have a 750gb hd where the first 20ish gb are for the os and the next partition is for media, but i am getting a ssd and wanted this whole drive for media.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
caf4926
Level 7
Level 7
Posts: 1916
Joined: Mon Mar 22, 2010 3:21 pm
Location: Argyll and Bute

Re: reformatting hard drive

Post by caf4926 »

It'll mess up the partition table but that may not matter if you are doing a clean install
You need to explain exactly what you want
But sda1 is a primary as is sda2 (extended)
Everything else is logical inside the extended space
Linux Mint 21.1 Cinnamon
nomko

Re: reformatting hard drive

Post by nomko »

Yes, this can be done. But not without data loss. So, before removing and reformatting, you must make a backup of all your files. If you going to use the whole disc as a media disc, best is to backup your files (here you get 50 gig free: https://mega.co.nz/) and remove all the partitions and create 1 large partition for your media.
jonass

Re: reformatting hard drive

Post by jonass »

So what I wanted to do is delete all the partitions before sda6, and then add that free space to the beginning of sda6
jonass

Re: reformatting hard drive

Post by jonass »

Hmmm the problem with backing it up is I don't have an extra 350 GB, otherwise I would just copy the files over to the backup and reformat the whole drive and copy the files back over afterward
741cc

Re: reformatting hard drive

Post by 741cc »

Hmmm the problem with backing it up is I don't have an extra 350 GB
Your screen-shot shows you have 390.45GiB of Data on sda6 and you say that you have no back-up? Thats an awful lot of stuff to lose in the event of a mishap such as hardware failure, theft or user error. The mere fact that you are asking for assistance on re-partitioning makes the third event a likely outcome. Do you know what its like to look at agparted window and see a complete blank because you hit the wrong button (don't ask me how I know this :oops: ).

Take my advice:-
1. Beg, borrow or steal a device large enough to hold all your files, and then some.
2. Use rsync or something similar to back up all your stuff.
3. Check the authenticity of the backed-up files.
4. Then, and ONLY then, start messin' with your 750G drive.

It will be a lot easier to simply format it and start again as already stated above.
Good luck and feel free to ask any further questions.
caf4926
Level 7
Level 7
Posts: 1916
Joined: Mon Mar 22, 2010 3:21 pm
Location: Argyll and Bute

Re: reformatting hard drive

Post by caf4926 »

Backup is essential I agree
But you can actually do pretty much anything with gparted
But I can tell you this... Even if you have a power house machine,, moving and resizing that lot will take forever..ever ....ever....ever
Linux Mint 21.1 Cinnamon
nomko

Re: reformatting hard drive

Post by nomko »

caf4926 wrote:Backup is essential I agree
But you can actually do pretty much anything with gparted
But I can tell you this... Even if you have a power house machine,, moving and resizing that lot will take forever..ever ....ever....ever
With large sized disc's...yes it can be painfully slow!

@jonass: buy an 1 gig external USB disc. Move all your stuff on that and when that's done remove all your partitions and create 1 big partition. That will save you a lot of trouble and headaches!
bb333

Re: reformatting hard drive

Post by bb333 »

jonass wrote:Hmmm the problem with backing it up is I don't have an extra 350 GB, otherwise I would just copy the files over to the backup and reformat the whole drive and copy the files back over afterward
You can use gparted to "juggle" around your data but you have to find room on your new SSD or somewhere else for ~90GB.

1. Install the SSD and an OS.
2. From a livecd with gparted, shrink the extended partitions to the lowest. Expand sda1 (formated to ex4).
3. Transfer data to sda1 and delete the extended partitions when empty.
4. Transfer that 90GB back from where ever you stored it.
5. Done.

This will takes hours depending on the drive and your computer. You can and may lose a chunk or all of your data if problems arise.
http://askubuntu.com/questions/144809/c ... partitions
srs5694
Level 6
Level 6
Posts: 1386
Joined: Mon Feb 27, 2012 1:42 pm

Re: reformatting hard drive

Post by srs5694 »

First, it is possible to delete the earlier partitions and then use GParted to resize a partition to occupy the earlier space. The problem with this is that it involves moving the start of the filesystem, and since filesystem data structures are defined relative to the beginning of the filesystem, the result of this operation is that a lot of critical filesystem data must be recomputed and rewritten. This is both time-consuming and risky. I don't recommend doing it without a backup. It will succeed most of the time, but do you really want to take the chance that you'll be one of the minority of people for whom it fails?

One alternative is to create a new partition in the freed space and mount it within the existing directory tree, then move a subset of your data to that space. It looks like you're using auto-mounting in the /media directory tree, so to do this you'd need to switch to mounting the partitions via /etc/fstab. This might make things cleaner or more convenient, though, so it's not necessarily bad. Suppose for the sake of argument that you decide that you've got a bunch of MP3s that will fit in the new partition. You might do something like this:
  • /home -- Your new /home on the SSD
  • /home/jonass/data2 -- Your current /dev/sda6, currently mounted at /media/Data2
  • /home/jonass/data2/mp3s or /home/jonass/mp3s -- The new partition you'll create in the free space
This approach is a bit inflexible, since it arbitrarily divides your free space between partitions, but it's a lot safer than trying to resize the start of a partition. If you've got a directory tree that's a bit smaller than the new free space and that you don't expect to grow significantly in size, this can be a good way to go.

In the long run, you might want to look into using a logical volume manager (LVM) setup. Using LVM, instead of putting filesystems in partitions, you put them in logical volumes, which are data structures within LVM partitions. The logical volumes can be managed a bit like files, which means that you can increase their size without touching their start points, even if the available space comes before the start of the logical volume. If you'd used LVMs for your current setup, you'd be able to easily increase the size of the logical volume to use the available space. Btrfs provides similar features without using an LVM, although it's officially experimental. If you wanted to begin moving in this direction, you could set up your freed space as an LVM or use Btrfs on it, and plan to convert more of your partitions in the future, whenever it becomes convenient. The main problem with LVMs is that Mint doesn't provide good install-time support for them.
jonass

Re: reformatting hard drive

Post by jonass »

741cc wrote:
Hmmm the problem with backing it up is I don't have an extra 350 GB
Your screen-shot shows you have 390.45GiB of Data on sda6 and you say that you have no back-up? Thats an awful lot of stuff to lose in the event of a mishap such as hardware failure, theft or user error. The mere fact that you are asking for assistance on re-partitioning makes the third event a likely outcome. Do you know what its like to look at agparted window and see a complete blank because you hit the wrong button (don't ask me how I know this :oops: ).

Take my advice:-
1. Beg, borrow or steal a device large enough to hold all your files, and then some.
2. Use rsync or something similar to back up all your stuff.
3. Check the authenticity of the backed-up files.
4. Then, and ONLY then, start messin' with your 750G drive.

It will be a lot easier to simply format it and start again as already stated above.
Good luck and feel free to ask any further questions.
Yeah ideally I will one day have a large 5TB back up drive for my almost 2.5 GB of data but its not financially feasible right now, just gotta live dangerously haha, I'll keep my eye on the good will up here as I have occasionally been able to find functioning external hard drives before, I don't want to attempt this if there is a good chance to lose my media files
caf4926
Level 7
Level 7
Posts: 1916
Joined: Mon Mar 22, 2010 3:21 pm
Location: Argyll and Bute

Re: reformatting hard drive

Post by caf4926 »

I don't want to attempt this if there is a good chance to lose my media files
Then don't. It looks like it's potentially a lot of pain for no real gain
Linux Mint 21.1 Cinnamon
741cc

Re: reformatting hard drive

Post by 741cc »

If you can source some old hdd's, search the net or ebay for "usb ide/sata cable" or some thing similar and you should find some thing like this, to use them for storage/backups. Does exactly what it says in the description - a really versatile piece of kit (optical drive on netbook anyone?) and cheaper than caddies, too.

@srs5964
you might want to look into using a logical volume manager (LVM) setup
Thats exactly what I'm going to do - come across it several times but never bothered to research it. Good prompt :wink:
Locked

Return to “Beginner Questions”