Restoring order to my partitions

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read this

Restoring order to my partitions

Postby DrPhill on Sun Nov 25, 2012 8:08 am

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
Screenshot--dev-sda - GParted.png (76.48 KiB) Viewed 420 times

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.
A new(ish) convert to Linux - delighted with Mint.

My WebPage
DrPhill
Level 2
Level 2
 
Posts: 78
Joined: Mon May 28, 2012 6:32 am

Linux Mint is funded by ads and donations.
 

Re: Restoring order to my partitions

Postby xenopeek on Sun Nov 25, 2012 10:12 am

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.
Forum Rules | IRC Channel Rules
Image
Arch Linux / 64-bit / Gnome Shell
User avatar
xenopeek
Level 21
Level 21
 
Posts: 13698
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Restoring order to my partitions

Postby DrPhill on Sun Nov 25, 2012 10:44 am

Vincent Vermeulen 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.


Vincent Vermeulen 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?
A new(ish) convert to Linux - delighted with Mint.

My WebPage
DrPhill
Level 2
Level 2
 
Posts: 78
Joined: Mon May 28, 2012 6:32 am

Re: Restoring order to my partitions

Postby xenopeek on Sun Nov 25, 2012 10:52 am

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
Forum Rules | IRC Channel Rules
Image
Arch Linux / 64-bit / Gnome Shell
User avatar
xenopeek
Level 21
Level 21
 
Posts: 13698
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Restoring order to my partitions

Postby DrPhill on Sun Nov 25, 2012 11:00 am

Vincent Vermeulen 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
A new(ish) convert to Linux - delighted with Mint.

My WebPage
DrPhill
Level 2
Level 2
 
Posts: 78
Joined: Mon May 28, 2012 6:32 am

Re: Restoring order to my partitions

Postby GeneC on Sun Nov 25, 2012 11:03 am

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:
GeneC

AMD Phenom2x4 3.2 ghz, 12GB DDR3, Nvidia GTX 460

LMDE (Cinnamon)
Debian (Gnome Shell 3.8.4 - Testing)
Siduction (XFCE -Debian SID)
Makulu 5 (XFCE-Testing)
User avatar
GeneC
Level 6
Level 6
 
Posts: 1465
Joined: Fri Sep 03, 2010 1:59 pm
Location: Maine, USA

Re: Restoring order to my partitions

Postby DrPhill on Sun Nov 25, 2012 11:40 am

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
A new(ish) convert to Linux - delighted with Mint.

My WebPage
DrPhill
Level 2
Level 2
 
Posts: 78
Joined: Mon May 28, 2012 6:32 am

Re: Restoring order to my partitions

Postby GeneC on Sun Nov 25, 2012 11:44 am

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

AMD Phenom2x4 3.2 ghz, 12GB DDR3, Nvidia GTX 460

LMDE (Cinnamon)
Debian (Gnome Shell 3.8.4 - Testing)
Siduction (XFCE -Debian SID)
Makulu 5 (XFCE-Testing)
User avatar
GeneC
Level 6
Level 6
 
Posts: 1465
Joined: Fri Sep 03, 2010 1:59 pm
Location: Maine, USA

Re: Restoring order to my partitions

Postby GeneC on Sun Nov 25, 2012 11:51 am

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)?
GeneC

AMD Phenom2x4 3.2 ghz, 12GB DDR3, Nvidia GTX 460

LMDE (Cinnamon)
Debian (Gnome Shell 3.8.4 - Testing)
Siduction (XFCE -Debian SID)
Makulu 5 (XFCE-Testing)
User avatar
GeneC
Level 6
Level 6
 
Posts: 1465
Joined: Fri Sep 03, 2010 1:59 pm
Location: Maine, USA

[Solved] Restoring order to my partitions

Postby DrPhill on Sun Nov 25, 2012 1:01 pm

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
A new(ish) convert to Linux - delighted with Mint.

My WebPage
DrPhill
Level 2
Level 2
 
Posts: 78
Joined: Mon May 28, 2012 6:32 am

Re: Restoring order to my partitions

Postby GeneC on Sun Nov 25, 2012 1:38 pm

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

Good Journey..... :wink:
GeneC

AMD Phenom2x4 3.2 ghz, 12GB DDR3, Nvidia GTX 460

LMDE (Cinnamon)
Debian (Gnome Shell 3.8.4 - Testing)
Siduction (XFCE -Debian SID)
Makulu 5 (XFCE-Testing)
User avatar
GeneC
Level 6
Level 6
 
Posts: 1465
Joined: Fri Sep 03, 2010 1:59 pm
Location: Maine, USA

Re: Restoring order to my partitions

Postby xenopeek on Sun Nov 25, 2012 2:37 pm

Image
Forum Rules | IRC Channel Rules
Image
Arch Linux / 64-bit / Gnome Shell
User avatar
xenopeek
Level 21
Level 21
 
Posts: 13698
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Restoring order to my partitions

Postby DrPhill on Sun Nov 25, 2012 4:46 pm

: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........
A new(ish) convert to Linux - delighted with Mint.

My WebPage
DrPhill
Level 2
Level 2
 
Posts: 78
Joined: Mon May 28, 2012 6:32 am

Re: Restoring order to my partitions

Postby 741cc on Mon Nov 26, 2012 7:54 pm

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
741cc
Level 3
Level 3
 
Posts: 149
Joined: Mon Sep 03, 2012 8:00 am

Linux Mint is funded by ads and donations.
 

Return to Installation & Boot

Who is online

Users browsing this forum: dickyminty and 25 guests