Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

share|improve this question

3 Answers 3

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

share|improve this answer

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.

share|improve this answer
    
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 ? –  Server System Specialist Dec 24 '10 at 3:44
1  
I don't know;it's rather dangerous to do this with running applications on servers, though. In my opinion. –  Bart Silverstrim Dec 24 '10 at 11:58

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.