Readjust disk space between /dev/sda2 and /dev/sda5
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
What about commenting swap out of fstab, deleting the swap partition sda3 and growing sda2 into the space formerly taken by sda3? sda5 could be shrunk to make space for a new swap partition.
I suggest getting the gpartedlivecd and using that. It will make things much simpler for you.
+1 to that. I believe the native tools are more robust but with a new installation, having no data to back up -- and restore if necessary, gparted would be a good choice.
The swap partition can be commented out of /etc/fstab by a leading # and then edited to suit and uncommented when the partition name of the new swap is known.
Pre: Commented SWAP Partition from /etc/fstab (As suggested by catkin)
Pre: Backed up my VMWare Disk Image
1. Boot using GParted Live CD
2. Deleted the SWAP Partition that was being shown as below.
Partition File System Label Size
/dev/sda3 linux-swap SWAP-sda3 2.00 GiB
3. Resized /dev/sda2 (/home partition) to a bigger size.
4. Shrinked /dev/sda5 to a smaller size.
5. Created /dev/sda6 to hold SWAP Partition as shown below.
Partition File System Label Size
/dev/sda6 linux-swap SWAP-sda6 4.00 GiB
Post: UnCommented SWAP Partition from /etc/fstab (As suggested by catkin)
All went good, I rebooted Linux with no issues at all!
Current configuration
Code:
Disk /dev/sda: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 6 48163+ 83 Linux
/dev/sda2 7 776 6184893 83 Linux
Partition 2 does not end on cylinder boundary.
/dev/sda4 777 2610 14731605 5 Extended
/dev/sda5 777 2082 10486620+ 83 Linux
/dev/sda6 2082 2610 4243456 82 Linux swap / Solaris
However, I see this warning during boot-up.
Code:
Unable to access resume device (LABEL=SWAP-sda3)
Also, I see a warning in the above fstab output.
Code:
Partition 2 does not end on cylinder boundary.
Do you guys foresee any issues with my current configuration?
"Unable to access resume device" probably comes from GRUB and could be fixed by editing /boot/grub/menu.lst.
"Partition 2 does not end on cylinder boundary" is a warning, not an error. To adjust the partition table to suit fdisk you could boot gparted again and set it to use "Align to cylinder" instead of "Align to MiB" and then resize /dev/sda2. In retrospect that would have been a better choice the first time around (Sorry -- I do not use gparted and have only just learned of this setting by netsearching).
Unable to resume device is because you have not edited fstab to reflect that the swap partition is now on sda6. Change sda3 to sda6 in fstab and it should be fine.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.