0

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

Marco Shaw
  • 407
  • 3
  • 11
  • This went very well on several systems and I was able to get all of the work I originally planned done. Then, being so confident, I came up to another system and basically did the same thing... The disk/partition now seems hosed. It complains about a bad superblock and is not able to recover. I've tried a few things so far and not luck. Sigh... – Marco Shaw Feb 20 '19 at 18:17

1 Answers1

3

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 to fdisk, and if fdisk asks you if you want to wipe a partition, you answer no.

Michael Hampton
  • 244,070
  • 43
  • 506
  • 972