Keeping up with the Joneses
The time had come to add some more storage to my main server, since I wasn’t in a hurry I thought I’d recheck my normal procedure and as a result I’ve updated it a bit.
My typical disk layout uses Linux MD software RAID-1:
- split each disk into 50MB partition for boot and everything else for LVM
- use mdadm to combine the two 50MB partitions, create a filesystem directly on top, call it /boot
- use mdadm to combine the two remaining large partitions, run pvcreate on MD device created
- now add that PV to LVM and use it
Over the years, both MD, LVM and the filesystems have improved, however it would be a marked improvement if the defaults changed with the times too.
mdadm: you need to specify “–metadata=1.2″ (or add “metadata=1.2″ to /etc/mdadm/mdadm.conf) as otherwise you’ll be stuck with 0.90 which “limits arrays to 28 component devices and limits component devices of levels 1 and greater to 2 terabytes”. v1.2 not only eliminates these limits, but stores the size of the underlying device and also names the MD device.
LVM: you need to add “-M2″ (or add ‘format=”lvm2″‘ to /etc/lvm/lvm.conf) which is described as “more efficient and resilient and offers greater flexibility and control”. Unfortunately all physical volumes in a volume group must use the same format. You can use “vgconvert” to migrate (if you are lucky).
ext: of course we have ext4 now to replace ext3. If you can create the filesystem afresh (rather than just use tune2fs) then you get additional improvements. You do want to check the data loss issue though. Fortunately the defaults set in /etc/mke2fs.conf are up to date - setting the new features as appropriate. Thanks Ted Ts’o!
Posted: March 27th, 2009 under Linux.
Comments: 1
Comments
Comment from adrian
Time: Friday 27 March, 2009, 16:24
Unfortunately the heuristics for ext aren’t very intelligent - 4KB blocks and 62million inodes on a 1TB filesystem. I’m currently using less than 250,000 inodes on my whole machine. 4KB blocks seem to be the largest allowed though. -N 20000000 for the number of inodes (which also massively speeds up filesystem creation)
Write a comment