2

First off I see many answers which include gparted, I do not wish to use gparted. I wish to use a console based application such as fdisk.

Hello! I'll keep this short, my computers harddisks and partitions look like this:

sda       8G
 -sda1    1G    // this is swap
 -sda2    3G    // this is my current root
 -sda3    4G    // this is my current /home
sdb       8G    // this is my new harddrive!
 -sdb1    8G    // this will be my new /home!

What I want to do is: I wish to replace sda3(4G) which is my current home with my new harddrive sdb1(8G). After that I wish to "merge" sda3 into sda2. I wish for the following:

sda       8G
 -sda1    1G    // this is swap
 -sda2    7G    // I want this to be my root
sdb       8G
 -sdb1    8G    // I want this to be my home

I have mounted the sdb to home now with no problem by editing the fstab uuid for home. I am however stuck with trying to extend sda2 with the 4G of sda3. I've been trying to look at tutorials and the closest I've gotten to was something to do with fdisk and resize2fs. However I'm trying to do this without having to delete the entire sda partition (the sda3 partition I can delete though).

1 Answer 1

1

Is not fdisc, but is parted :)

Ok. You already done:

  • move your /home tu /dev/sdb1

Now:

Before resizing a partition, boot into rescue mode (or unmount any partitions on the device and turn off any swap space on the device).

Start parted, where /dev/sda is the device on which to resize the partition:

parted /dev/sda

View the current partition table to determine the minor number of the partition to resize as well as the start and end points for the partition:

print

To resize the partition, use the resize command followed by the minor number for the partition, the starting place in megabytes, and the end place in megabytes.

resize 2 1024 8048

before resize delete /dev/sda3

rm 3

After resizing the partition, use the print command to confirm that the partition has been resized correctly, is the correct partition type, and is the correct file system type.

After rebooting the system into normal mode, use the command df to make sure the partition was mounted and is recognized with the new size.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .