Restoring order to my partitions

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
DrPhill
Level 3
Level 3
Posts: 122
Joined: Mon May 28, 2012 6:32 am

Restoring order to my partitions

Post by DrPhill »

I am going to install Mint 14/Cinnamon. Before I do this I would like to tidy up my partitions. My preference would be to keep some existing partitons and rearrange the remainder of my disk. I have run into a problem...... I have attached an image of GParted displaying my drive (pictures are easier to understand).
Screenshot--dev-sda - GParted.png
Because I have done some installs and reinstalls and general messing I have the following structure:
sda3
sda7: Mint13
sda8: Mint13 Home
sda9: backup partition
free space
sda6: Mint13 swap
sda5: empty partition
free space.

The following comments apply to looking at gpated after booting from the install CD (though the image was taken and I am writing this in my Mint13 as it seems faster).
Now I would like to delete sda5 but GParted will not let me - it says that I must unmount all ppartitions with higher number than 5. But all my partitons should be unmounted as I booted from the install CD - right? Is the install CD using my swap partition? How can I get round this?

Now I have sda2 as a windows recovery partition (I do not care if I lose this!). Can I somehow move all the free space to that and partition it for the new Mint install?

Will I have to blat the whole disk and start again (I will if I have to, but prefer not to - I would like to keep mint13 install as a safety net)? Are there strategies that I should/could have used to prevent this situation?

I would be grateful for any help that you can give me.
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.
Started with Mint 12 ... flirted with Ubuntu at 18.x.
Now back to Mint with XFCE. Loving it, thanks to all who have contributed.

Phill
User avatar
xenopeek
Level 25
Level 25
Posts: 29507
Joined: Wed Jul 06, 2011 3:58 am

Re: Restoring order to my partitions

Post by xenopeek »

Boot from the Linux Mint installation DVD / USB. Start GParted. Right-click each partition, and if the option to Unmount is in the context-menu, select to Unmount. After that it should be possible to remove sda5.

I not that between sda9 and sda6 you have 303 GiB free disk space, and after sda5 you have 164 GiB free disk space. So in total you have 467 GiB free disk space :shock: I wouldn't bother with removing sda2, as it is only 19 GiB. If you want, sure, go ahead and delete it. Afterwards you will have to increase the size of sda3, so it grows to absorb the old sda2 disk space. Then you'd have to, in order, move sda7, sda8, sda9, and sda6 down so the free disk space is moved to after sda6. I'd recommend you move down sda6 anyway, so the 303 GiB before it and the 164 GiB after it are merged. And you might want to reduce its size; swap of 4 GiB is more than enough--unless you have more RAM in your system and you want to be able to hibernate (suspend to disk), then you need to make sure swap is equal in size to your RAM.
Image
DrPhill
Level 3
Level 3
Posts: 122
Joined: Mon May 28, 2012 6:32 am

Re: Restoring order to my partitions

Post by DrPhill »

xenopeek wrote:Boot from the Linux Mint installation DVD / USB. Start GParted. Right-click each partition, and if the option to Unmount is in the context-menu, select to Unmount. After that it should be possible to remove sda5.
Thanks Vincent (especially as it is a Sunday), but I already tried that -I guess that I should have said so more explicitly, but I did not want the post to turn into 'war and peace'. Booting from the install disk and running GParted was my first 'solution' to the problem. Unfortunately I cannot unmount the swap partition (no option to so do) and the info marks it as active.

Most of my problem is that I cannot move that damn swap space. I think that the installation disk may have used it for its own OS. If I were man enough maybe I could dibble with the install OS config and create a new (temporary) swap space freeing up the existing one so it can be moved. Or I could create a new swap space in my Mint13 install? Can that be done while Mint is running? I could maybe stick the new swap somewhere sensible (sda2? ) and use if for all Mint installs? (I assume that this is sensible since I only run one OS at a time).

Now I think of it that would be a good solution, if possible.

xenopeek wrote:I not that between sda9 and sda6 you have 303 GiB free disk space, and after sda5 you have 164 GiB free disk space. So in total you have 467 GiB free disk space :shock: I wouldn't bother with removing sda2, as it is only 19 GiB. If you want, sure, go ahead and delete it. Afterwards you will have to increase the size of sda3, so it grows to absorb the old sda2 disk space. Then you'd have to, in order, move sda7, sda8, sda9, and sda6 down so the free disk space is moved to after sda6. I'd recommend you move down sda6 anyway, so the 303 GiB before it and the 164 GiB after it are merged. And you might want to reduce its size; swap of 4 GiB is more than enough--unless you have more RAM in your system and you want to be able to hibernate (suspend to disk), then you need to make sure swap is equal in size to your RAM.
Yep, I agree with everything you say. The disk is ridiculously large (750Gbyte - I remember 20Mb hard drives!) - but it was a ''free' upgrade with the machine spec (from a really tiny 500Gb disk). I have 8G ram and read that twice ram size was a good swap size - its not as if I am short of disk space, so unless there is a penalty for a large swap file I am not that fussed.

I am also a little uncomfortable with ever increasing sda numbers. From what I have read they are only labels, but it still seems inelegant. If the UUIDs are really what Mint uses, then changing the labels should be possible?
Started with Mint 12 ... flirted with Ubuntu at 18.x.
Now back to Mint with XFCE. Loving it, thanks to all who have contributed.

Phill
User avatar
xenopeek
Level 25
Level 25
Posts: 29507
Joined: Wed Jul 06, 2011 3:58 am

Re: Restoring order to my partitions

Post by xenopeek »

Ah. I think you can solve that my disabling swap. You can do so after booting into Linux Mint installation DVD / USB. From the terminal, run the following command:

Code: Select all

sudo swapoff -a -v
Image
DrPhill
Level 3
Level 3
Posts: 122
Joined: Mon May 28, 2012 6:32 am

Re: Restoring order to my partitions

Post by DrPhill »

xenopeek wrote:Ah. I think you can solve that my disabling swap. You can do so after booting into Linux Mint installation DVD / USB. From the terminal, run the following command:

Code: Select all

sudo swapoff -a -v
Excellent, that should help. I should have guessed that there would be a way to do it. I have not quite got the Linux mindset yet.

Can I change the swap area in a running Mint? I could make good use of the sda2 and permanently delete the current swap. I managed to follow your instructions to change the home partition on a live system, so my guess is that this is possible too.

Thanks
Started with Mint 12 ... flirted with Ubuntu at 18.x.
Now back to Mint with XFCE. Loving it, thanks to all who have contributed.

Phill
GeneC

Re: Restoring order to my partitions

Post by GeneC »

Resizing partitions can take a LONG time (hours), and errors can happen.

Personally (I did something similar a few months ago), but used a different approach.
I used Clonezilla to clone the partitions I wish to keep.
Tutorial
http://clonezilla.org/show-live-doc-con ... disk_image

Then use Gparted to format the whole HD, then make all new partitions to my liking. (Very quick)!
Restore the clones to the new partitions.
End Product
Image
Be aware that you can only restore a clone to a partition that is the same size or larger (never smaller).
Also you CAN restore to a different partition ( ie - sda4 to say sda 1, 2, whatever), but you have to go into the clone folder and rename wherever to the correct sda#)
http://clonezilla.org/show-live-doc-con ... disk_image

In this case change sda7 to sda(new)
Image

As a safeguard clone the original whole HD, just in case.

---------

EDIT:
To recognize your new swap file, you have to get its new UUID (open gparted>information)
and edit your /etc/fstab with the new swap UUID.
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sda7
UUID=c535e04d-bfaf-4308-8fa2-703d75246fa9 / ext4 rw,errors=remount-ro 0 1
# /dev/sda2
UUID=123db9a1-0df1-47eb-86f4-7d64235d7e34 swap swap sw 0 0
This has worked perfectly for me twice (Linux OS's only), but with Windows?? Use at your own risk.. :roll:
DrPhill
Level 3
Level 3
Posts: 122
Joined: Mon May 28, 2012 6:32 am

Re: Restoring order to my partitions

Post by DrPhill »

An interesting (and safer) solution, GeneC, but I am shy the storage space to clone stuff quite so freely (but crimbo is coming large usb drive? hmmmmmm).

Thanks for the thought - and it may become a possibility for me.

Phill
Started with Mint 12 ... flirted with Ubuntu at 18.x.
Now back to Mint with XFCE. Loving it, thanks to all who have contributed.

Phill
GeneC

Re: Restoring order to my partitions

Post by GeneC »

Hi Dr P. :)

I gave up on the resizing approach after several hours.... :lol:
I have a spare USB HD that I can keep all my clones at, but your approach will work. :wink:

Good Luck.
GeneC

Re: Restoring order to my partitions

Post by GeneC »

Just a thought..

Actually you could do this with just your present HD.
Make a partition just for the clones, then delete whatever old partitions you wish, and make new ones. You could even reuse your existing SWAP partition (and not have to change fstab, it would be recognized)?
DrPhill
Level 3
Level 3
Posts: 122
Joined: Mon May 28, 2012 6:32 am

[Solved] Restoring order to my partitions

Post by DrPhill »

OK I am back. Main problem is now solved. For the record, here is what I did:

(1) Create a new partition at the very end of the drive for a swap
(2) Edited /etc/fstab to change to this partition
(3) Rebooted and hey presto the old swap was not being used. I could not delete it because there were partitions with higher numbers mounted. Drat.
(4) Booted from the install DVD.
(5) Used GParted to show that install had spotted and grabbed the new swap.
(6) Opened a terminal and ran 'sudo swapoff -a -v'
(7) Used GParted to delet the old swap and the zombie partition stranded in unallocated space
(8) Continued to install, using my existing home and the shared swap area.

It is all working fine so far, and I am trying out cinnamon. The real test will come when I choose Mint13Mate at boot up.

So the important thing to note with all this is that the install DVD OS grabs a swap if it can find one, but can be slapped down with the right command.

There is one hell of a lot to learn about linux - but that means there is a hell of a lot of control.

I did not solve my partition numbering gripe yet - but that is minor. I may get round to that later (USB storage is on my list).

Thanks Vincent and Gene for your help.

Phill
Started with Mint 12 ... flirted with Ubuntu at 18.x.
Now back to Mint with XFCE. Loving it, thanks to all who have contributed.

Phill
GeneC

Re: Restoring order to my partitions

Post by GeneC »

Its great when a plan works out.... :D

Good Journey..... :wink:
User avatar
xenopeek
Level 25
Level 25
Posts: 29507
Joined: Wed Jul 06, 2011 3:58 am

Re: Restoring order to my partitions

Post by xenopeek »

Image
Image
DrPhill
Level 3
Level 3
Posts: 122
Joined: Mon May 28, 2012 6:32 am

Re: Restoring order to my partitions

Post by DrPhill »

:D

But I aint gettin on no plane.

And many thanks.

I have swapped back and forth (at boot) between Mint13Mate and Mint14Cinnamon without any ill effects so far. That answers one question.

If I had a separate /usr directory would I still have all my installed software in both? I guess that is an experiment for another day...... trouble with this Unix model - if I can tinker I will........
Started with Mint 12 ... flirted with Ubuntu at 18.x.
Now back to Mint with XFCE. Loving it, thanks to all who have contributed.

Phill
741cc

Re: Restoring order to my partitions

Post by 741cc »

GeneC
Be aware that you can only restore a clone to a partition that is the same size or larger (never smaller).
Also you CAN restore to a different partition ( ie - sda4 to say sda 1, 2, whatever), but you have to go into the clone folder and rename wherever to the correct sda#)
Never really got on with clonezilla; always used fsarchiver as it lets you recover to a larger or smaller partition and even one of a different file-system if needs be.
My current Mint-13-KDE install is backed up to a 2.3GB .fsa file. Just in case :wink:
Have a read:- http://www.fsarchiver.org/Main_Page
Locked

Return to “Installation & Boot”