Debian 7 VM on VMware ESXi 6
I have a disk SDC (MSDOS partition table) that was originally created as 300GB. One primary partition was created at 300GB. Then XFS was created on that.
I was able to fully test an increase, but there was no partition on my test machines (I inherited this environment). This worked easily:
-Shutdown VM
-Resize disk in VMware to 600GB
-Run xfs_growfs -d /dev/BLAH (I guess XFS can be created on a "raw disk" without a partition?)
That worked!
Now, on my prod system, there's a partition SDC1 on the disk(!). I was able to make this work eventually, but it makes me nervous deleting a partition:
-Shutdown VM
-Resize disk in VMware
-Remove primary partition (300GB), and write to disk
-Recreate primary partition with new size (600GB), and write to disk
-Restart VM (OS refused to see new partition table until a reboot)
-Run xfs_growfs -d /dev/BLAH
The big deal is that I'm dealing with over 250GB of data on this disk I'm resizing.
I will plan a backup, etc., but is this normally safe?
(I just thought... I'm going to test deleting the partition and not recreating it at all, in case I have to grow again down the road.)
The reason you're nervous is you've been in IT for long enough to remember that DOS/Windows fdisk intentionally destroyed the data in a partition by wiping the first few bytes of that partition when it deleted/created a partition.
Linux fdisk has never done this by default, at least not without warning the user first and allowing them to not wipe the data. If you haven't explicitly instructed Linux fdisk to wipe a partition or disk, it won't do so.
This operation is perfectly safe provided you do not use the
-w
or-W
options tofdisk
, and if fdisk asks you if you want to wipe a partition, you answer no.