[Novalug] SATA HD with LVM on RAID/ udev needed?
RJ Bergeron
rbergero at gmail.com
Tue Jul 1 09:17:08 EDT 2008
On Tue, Jul 1, 2008 at 08:12, Brandon Saxe <brandon20va at yahoo.com> wrote:
> --- On Sun, 6/29/08, RJ Bergeron <rbergero at gmail.com> wrote:
>> <brandon20va at yahoo.com> wrote:
>> > ?- Device Names. Depending on the order the drives are
>> inserted/removed, the device name changes from anything
>> between /dev/sdd to /dev/sdf. I have also seen /dev/sdg on
>> testing. For reference, I have two other SATA drives
>> attached to mobo at /dev/sda and /dev/sdb. /dev/sdc is a
>> USB drive. Do I need to configure udev rules for each drive
>> in order for my system to function correctly? OR will RAID
>> and LVM figure all that out for me?
>> Linux's MD software writes a signature to each disk and
>> uses that to
>> figure out how to assemble the RAID. This lets you do very
>> silly
>> things like swap out PATA controllers for a stack of
>> USB->PATA
>> boxes...
>
> Are you suggesting to always use RAID or LVM even if for just one disk? I guess one example may be a USB external hard drive. By having LVM manage the disk, then LVM daemon will know exactly where to mount it every time without caring for the /dev node name?
While you *could* create a degraded RAID1 for individual disks, I
typically just create one ext3 filesystem and label it using e2label.
This lets it show up with a nice name when you plug it in on modern
gnome/kde desktops.
If you have something like a 1TB external disk and you want to
partition it, LVM is certainly an option, but you have to take care in
shutting down the volume group before unplugging the disk. I'd
probably avoid it where I could.
I tend to keep to standard formatting for USB drives when I'm going to
share them across computers/operating systems. The reason I brought up
moving PATA disks to USB controllers is that the RAID code is flexible
enough to find disks across changed controller types, so long as the
kernel has support for the controller itself. I had to do exactly that
when I had an IDE controller died and I needed to 'rescue' data from
the RAID set.
Writing a udev rule for a single-disk USB enclosure is actually a
pretty neat way to make sure you can find the device! Especially if
you're on a server and don't have those fancy "desktop environments"
available...
>> > ?- Should I bother dealing with udev on this one? Even
>> if RAID and LVM don't care about device names, I still
>> feel it may be helpful to know exactly which drive is at
>> which device node. Can anybody recommend why I *should* or
>> *shouldn't* do udev?
>> I would stay away from configuring udev to map drives
>> statically, it's
>> just not necessary and may confuse the MD assembly
>> processes ('seeing'
>> things twice). I actually recently replaced a failed drive
>> (through
>> coldplug, ATA100 here...) by noticing the actual failed
>> device in
>> /proc/mdstat, then running smartctl -a /dev/hde (my device)
>> so I knew
>> which model/serial number I needed to pull.
> Are you saying you run RAID with even one disk to be able to use software RAID monitoring tools?
smartctl works on SATA/PATA devices whether they're in a raid or not.
It's not a software RAID monitoring tool. (USB support is in-progress
for select bridges)
http://smartmontools.sourceforge.net/
/proc/mdstat is a small file full of information pertinent to the RAID
system and which devices are working, here's an example from one of my
machines:
$ cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4] [raid1]
md0 : active raid5 hdc2[1] hda2[0] hdk2[4] hdi2[3] hdg2[2] hde2[5](S)
976173056 blocks level 5, 256k chunk, algorithm 2 [5/5] [UUUUU]
Basically, I can notices when a device fails by looking through this
file. Although I don't remember what it actually looks like in that
case, I haven't had a disk failure recently... *crosses fingers*
RJ
More information about the Novalug
mailing list