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

Senior Systems Engineer
  • 1,275
  • 2
  • 33
  • 62

3 Answers3

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

Ignacio Vazquez-Abrams
  • 45,939
  • 6
  • 79
  • 84
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.

Bart Silverstrim
  • 31,172
  • 9
  • 67
  • 87
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.

ewwhite
  • 197,159
  • 92
  • 443
  • 809