I'm running ubuntu 16.04 on a Lenovo P50.
I have 2 SDDs on my laptop as follows:
- /dev/sda - 256GB, has both a linux and windows partition
- /dev/sdb - 512GB, single fat32 partition, use to store large data files (all of which are either unimportant or backed up elsewhere)
I wanted to move windows to /dev/sdb so that my linux partition could take up all 256GB of /dev/sda. To do that, I first wanted to shrink my /dev/sdb "data storage" partition.
To shrink my /dev/sdb partition, I opened gparted and used the "resize partition" operation to shrink my /dev/sdb partition to 128GB. GParted reported that it completed the operation successfully.
I closed gparted and re-opened it. When I reopened it, it reported that the size of my /dev/sdb partition was unchanged and it was still taking up the entire 512GB of the drive. I did the "resize" operation again. After doing the resize operation a second time, the partition table became corrupted. GParted was no longer able to detect the file system.
Testdisk was not able to detect my fat32 filesystem either. fdisk reported 4 partitions of random sizes, suggesting that the partition table was corrupted.
I plan to shuffle around some important data in the future, and I want to know
- What I did wrong
- Why this happened
- How can I recover my data (I'm willing to open a hex editor and pick through it by hand)
- How do I prevent this in the future?