February 9, 2021

Fedora 32 -- parted: adding a 4T disk

I just purchased a pair of 4T disks. They are Western Digital Black, 7200 rpm, WD4000FYYZ. I paid $80 each for them (an Amazon purchase).

I popped these into my system alongside two 2T disks and a SATA solid state drive. For whatever reason, the new disk showed up as /dev/sdb, bumping one of the 2T drives to be /dev/sdd. My SSD is /dev/sdc, but Fedora finds it because the installer labeled it or did something clever, which works out well.

So I edit /dev/fstab, changing sdc to sdd in two places and then when I exit emergency mode, all is well.

Partitioning

The fdisk program informs me that it is unable to deal with this 4T disk using the venerable DOS disklabel and MBR and that I should use GPT. This is new to me, and the rest of this page will be a sort of tutorial.
su
parted /dev/sdb
Take special care to verify that this is the disk you think it is !!

Once I was sure that /dev/sdb really was my new unpartitioned 4T drive I used the following commands:

print
mklabel GPT
mkpart
I had to partition the disk about a dozen time before I got it right. I would just type "mklabel GPT" to wipe it clean and start over each time. Typing "print" shows you the partition scheme you have.

Unlike fdisk, you just quit and the partition is written, no need to explicitly write before exit like with fdisk. This could be a trap for some people who are used to fdisk where nothing actually happens to the disk until you explicitly write the label.

I found the best thing was to type "mkpart" and let it prompt me for what it wanted. The prompts were like this:

label name
partition type
start
end
I never did find decent documentation anywhere. The label is just a name that you can make up as you please. For partition type I used either ext4 or "linux-swap". The way start and end is set up is inconvenient, they are always relative to the start of the disk. This yields a conundrum about how to have one partition start where the other left off. What I found would work would be to put the start point explicitly in the middle of the prior partition. Parted would warn me and adjust the start point appropriately in a way that is impossible to figure out or specify. What I did was pretty much:
mkpart "extra" ext4 1 50m
mkpart "swap" linux-swap 40m 16.1g
mkpart "u3" ext4 8g -1s
print
quit
After this was done I did:
mkdir /u3
mkfs -t ext4 /dev/sdb3
Then I edit fstab so it will mount /dev/sdb3 on /u3, and then "mount /u3" and I am off to the races. I also added a line for /dev/sdb2 as swap to fstab.


Have any comments? Questions? Drop me a line!

Adventures in Computing / [email protected]