2

I have a 500GB external USB drive formatted with a single FAT32 partition. I wanted a partition that would support normal Linux filesystem permissions, so I shrank the existing partition using parted:

$ parted /dev/sda
(parted) resizepart 1 220GB

(There was 216GB of data on it). It looked like that worked fine:

(parted) print
Number  Start   End    Size   Type     File system  Flags
 1      32.3kB  220GB  220GB  primary  fat32        lba

Then I created a new ext4 partition:

(parted) mkpart primary ext4 220GB 500GB
(parted) print
Number  Start   End    Size   Type     File system  Flags
 1      32.3kB  220GB  220GB  primary  fat32        lba
 2      220GB   500GB  280GB  primary  ext4         lba

Something didn't work right though, because after trying to mount the new partition and getting errors, I checked the drive again in parted and saw this:

(parted) print
Number  Start   End    Size   Type     File system  Flags
 1      32.3kB  220GB  220GB  primary  fat32        lba
 2      220GB   500GB  280GB  primary

OK, fix that:

$ sudo mkfs -t ext4 /dev/sda2

The new partition on sda2 seems to be working fine. The old partition can be mounted just fine and I can view the top level folder structure, but attempting to access any of the subfolders with cd or ls gives an Input/output error and $ dmesg|tail shows variations of

FAT-fs (sda1): error, fat_get_cluster: invalid cluster chain (i_pos 0)

Running fsck /dev/sda1 gives:

fsck from util-linux 2.25.2
fsck.fat 3.0.27 (2014-11-12)
Seek to 500105216512:Invalid argument

Can I rescue the data on the FAT32 partition? Was it naive to think that I could just resize to 220GB and not mess up the existing partition?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.