Re: udev causing data loss?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
lee wrote:
> That is what I would expect. Are you saying that there is no way to
> tell which disk is which one from the device names?
That's what I'm saying ("/dev/hd*" still means something, but "/dev/sd*"
doesn't), but I've been wrong before.
Notice: In spite of my earlier whinage, it isn't necessarily all udev's
fault.
<My own current beliefs>
As the system boots, the names in /dev are set by the kernel and udev in
initramfs. After boot, things stay the same, but if you leave a USB
stick (or USB external disk or, I suspect, eSATA or firewire or any
other external block device) plugged in when you reboot, things can move
around. Everything seems to be called /dev/sd<something>, but they
aren't necessarily referring to the same devices they were a few minutes
ago. If grub's config refers to the root partition by /dev name, the
boot will (probably) hang or fail. And if fstab refers to mounts by /dev
name, very odd things can happen.
Ubuntu's dealt with this by going to UUIDs in menu.lst and fstab.
Debian's installer's (lenny beta2) grub2 puts a UUID in menu.lst (new
name: grub.cfg), but leaves /dev names in fstab.
I've read that that IDE disks are supposed to be sd's too, but that
doesn't seem to happen on my systems. Yet.
> If that is true, how does the user, how does the system know which
> disk is which one?
The system doesn't care. It just scribbles on whatever it's asked to.
It's up to you to 'udevinfo -a -p /sys/block/sd<whatever>' to find out
which is which *before* you do something to a disk using the /dev name.
'df' will tell you the /dev/sd<whatever>s of the partitions that are
actually mounted.
'ls /dev/sd*' will tell you the /dev names of all the sd's that
currently exist.
> It seems I need to read up on this. Is there a good document that
> explains it?
I couldn't find one. I found several, all good at the time, I'm sure,
but they all said slightly different things.
</My own current beliefs>
- --
Glenn English
ghe@slsware.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkkfJSoACgkQ04yQfZbbTLZ88wCgo2ogBdlCDyRLXFAGqqnD6p0r
XCcAoIjQZZYA/VWRwrFkNjcyQWhTFWk3
=4cjz
-----END PGP SIGNATURE-----
Reply to: