1

I wonder if this is possible to extend or regrow the Linux hard disk partition from 8 GB to 20 GB without losing the existing data on the partition ?

at the moment this Ubuntu Linux is deployed on top of VMware and I've just regrow the hard drive from 8 GB into 20 GB but can't see the effect immediately.

can anyone suggest how to do this without losing the data ?

and I found some strange error message when i do the fdisk -l ?alt text

3 Answers 3

2

The message isn't a problem; Linux has few problems dealing with partial cylinders. What is a problem is the order of the partitions.

You will need to erase the existing swap and extended partitions, extend partition 1 to cylinder 994-1045+2610=2559 either with a tool such as parted or via fdisk and resize2fs, and then recreate the extended and swap partitions afterwards (remembering to call mkswap against the swap partition).

2

1) Make sure you have a backup of the data. Screwing around with partitions never guarantees you won't lose data.

2) I'd be tempted to try using Rescue Is Possible (RIP) Linux (since you said it's virtual, mount the .iso); boot from it to run gparted from X and have it grow the partition. I've never lost data using gparted to grow or shrink a partition, but that doesn't mean it can't happen.

2
  • thanks for your reply, I found from googling around about this tool: resize2fs -p /dev/sda1 --> does it resize the size on the fly like what Windows DiskMGMT.MSC does ? Dec 24, 2010 at 3:44
  • 1
    I don't know;it's rather dangerous to do this with running applications on servers, though. In my opinion. Dec 24, 2010 at 11:58
1

A general rule is to plan your partition layout to place the data partition that you'd expect to grow over time (/var, /opt or otherwise) as the last partition. It makes this process a bit easier.

You must log in to answer this question.

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