Corraling Linux Hard Disk Names - page 3
Name That Hard Disk!Just like in the olden days, udev may change your device names. While udev has a lot of advantages, it often means spending time figuring out how to nail down device names and mountpoints. Most Linux distributions ship with default udev configurations that create persistent names for hard drives. Look for something like /etc/udev/rules.d/65-persistent-storage.rules to see how your system is configured. However, /etc/fstab can still get bollixed, or you might want a removable USB storage device to have a persistent name and mountpoint, so your best tactic is to use UUIDs instead of /dev names. An example entry looks like this, except in real life the UUID line is unbroken:
# /dev/sda1 UUID=b099f554-db0b-45d4-843e-0d6a1c43ba44 /home ext3 defaults 0 2Yes, UUIDs are long and unattractive. But they are unique, so no matter what udev or anything else on your system tries to do with them, they will always be the same. How do you know what the UUID is?
# vol_id -u /dev/sda1 b099f554-db0b-45d4-843e-0d6a1c43ba445
On Fedora it's /lib/udev/vol_id.
LABEL=/1 / ext3 defaults 1 1vol_id --export [device name] displays complete information, including labels. Where does this label come from? Fedora creates it at installation. To create or change filesystem labels, you need to use a command specific to your filesystem. e2label is for Ext3. For ReiserFS, use reiserfstune, and you must unmount the filesystem first. On XFS use xfs_admin, and for JFS you need jfs_tune. For FAT filesystems use mlabel, which is part of mtools.
With libata, how do you know which of your PATA drives are masters or slaves, and on which IDE controller? Just look at the output of dmesg|grep ata, and then use this table to figure out what's what:
ata1.00 primary master ata1.01 primary slave ata2.00 secondary master ata2.01 secondary slavedmesg also tells you if the kernel sees your PATA and ATAPI drives as hd or sd. Run dmesg|grep '[s|h]d[a-z]' to find out.
- Merging libata PATA support into the base kernel
- libATA FAQ
- support for 127 Partitions on SATA, IDE and SCSI
- Manage Linux Storage with LVM and Smartctl
Solid state disks (SSDs) made a splash in consumer technology, and now the technology has its eyes on the enterprise storage market. Download this eBook to see what SSDs can do for your infrastructure and review the pros and cons of this potentially game-changing storage technology.
- 1Linux Top 3: CoreOS, Oracle Enterprise Linux 7 and Ubuntu 14.10
- 2Linux Top 3: Debian Dumps SPARC, Ubuntu Takes Over Linux 3.13 and the Core Infrastructure Initiative
- 3Linux Top 3: Fedora, Ubuntu and Gluster Lose Community Leaders
- 4Red Hat Enterprise Linux 7 Finally Hits the Big Time
- 5Linux Top 3: Tails 1.0, OpenMandriva Lx 2014.0 and Debian 7.5