0

I'm having an issue with my usb 3.0 external hard drive when I try to use the fdisk command to make an ext4 partition. It's encrypted and I've been told that modifying sector 0 of the drive overwrites some essential storage aspect and was wondering if I can repartition the drive on linux without modifying this sector, or if this is even possible.

My procedure is as follows -

fdisk -l (to check if the OS can see the USB disk, it would normally see it as /dev/sdb and formatted as NTFS/FAT32) fdisk /dev/sdb I then delete the existing partition using 'd' Add a new partition using 'n' Select it as a primary partition Select it as partition number '1' Save and quit

At this point the device disappears. I'm running RHEL 6.5

1 Answer 1

0

The Master Boot Record (MBR) partition table is stored in sector 0 of the disk, so by definition it is not possible to repartition an MBR disk without modifying that sector. Details vary for other partition tables, but as a general rule, sector 0 is critical for most partition tables.

Most disk encryption tools don't operate on the entire disk (including the partition table); instead, they work on data within individual partitions. (This is true even of "whole-disk" encryption tools -- they would be better called "whole-partition" or "whole-filesystem" encryption.) Sector 0 of the partition may be critical for these tools, and should not be modified by tools that modify just the partition table. Some partitioning tools, though, perform filesystem creation or other operations within partitions, and so could conceivably damage an encrypted filesystem. I wouldn't recommend attempting to resize an encrypted partition with GParted, for instance. (I suspect that GParted would refuse to do this, but I've not looked into the matter, so I can't promise that.) The fdisk tool you mention doesn't try to modify the contents of partitions.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .