Tuesday, March 20, 2012

Partitioning a new 2 Terrabyte disk

To make sure it will be a while before we have to revisit my wife's backup strategy, I bought a 2TB drive and installed it in my machine to serve as a Samba network drive for her backups. The physical install didn't present any nontrivial problems.

I ran into the first puzzle when I booted-up the machine for the first time. After selecting the default boot kernel via grub I got an error message indicating a missing partition table or some such. Ack! Did I somehow damage my primary drive while installing the new one? Then, I realized---the order used by grub might have changed. I edited the boot commands, changing "hd1" to "hd0". Viola! Back to normal.

After booting-up, I ran fdisk /dev/sdb. I created a single primary partition for the entire disk, but then got a strange warning message:

Partition 1 does not start on physical sector boundary.

A Google search indicated that I might need to start at 8 or 64 or some such. But, when I tried that, I got the same warning. Some more searching led me to an IBM article on Linux on 4KB-sector disks. After finding the fdisk section, I followed their advice to turn off DOS compatibility ('c') and change display units ('u'); when I again tried creating the partition, the warning disappeared.

Note: If I had been more observant, I would have noticed that fdisk told me about the 'c' and 'u' options when it started-up. Doh!

Note: I needed the disk UUID in order to make a proper /etc/fstab entry. The easiest way I found to get this is to run

ls -la /dev/disk/by-uuid/
Each UUID is linked to its corresponding device.

Note: I was slightly upset that only 1.7T of the 1.8T was available immediately after formatting. I learned that this was probably due to the 5% reserved for system use. I lowered this to 2% using the following command:

sudo tune2fs -m 2 /dev/sdb1

No comments:

Post a Comment