LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Readjust disk space between /dev/sda2 and /dev/sda5 (https://www.linuxquestions.org/questions/linux-newbie-8/readjust-disk-space-between-dev-sda2-and-dev-sda5-851187/)

born2bdesi 12-19-2010 10:01 AM

Thanks Catkin.

I would appreciate if you could throw some light on the commands to be run in order to increase the space in sda2.

smoker 12-19-2010 10:04 AM

Quote:

Originally Posted by catkin (Post 4196805)
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.

Good plan !

catkin 12-19-2010 10:04 AM

Quote:

Originally Posted by born2bdesi (Post 4196807)
Thanks Catkin.

I would appreciate if you could throw some light on the commands to be run in order to increase the space in sda2.

I'm busy right now; maybe somebody else can do that if there is consensus that it is a workable plan.

born2bdesi 12-19-2010 10:14 AM

Sure, I would wait for your inputs.

I am going to be online again in a couple of hours. Looking forward for your support!

smoker 12-19-2010 10:37 AM

I suggest getting the gparted livecd and using that. It will make things much simpler for you.

catkin 12-19-2010 08:35 PM

Quote:

Originally Posted by smoker (Post 4196833)
I suggest getting the gparted livecd 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.

born2bdesi 12-20-2010 04:40 PM

Thanks for all your replies!

Here is what has been done.

Code:

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?

Highly appreciate your inputs!

catkin 12-20-2010 10:15 PM

"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).

smoker 12-20-2010 11:40 PM

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.


All times are GMT -5. The time now is 02:23 AM.