Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
LVM SCSI dev "Dance"
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
commonloon
Tux's lil' helper
Tux's lil' helper


Joined: 13 Apr 2004
Posts: 133
Location: Marin, CA

PostPosted: Fri Oct 22, 2004 6:47 am    Post subject: LVM SCSI dev "Dance" Reply with quote

I've got a couple of usb external drives that I am trying to use with LVM. My problem is that I also have 2 raid arrays on this same machine. In old school terms I have /dev/sda,b,c,d,.... When I unplug a drive and then plug it back in the kernel assigns it the next device (say /dev/sde). This is compounded by the fact that if the machine should be rebooted that the devices names are all different again.

I found out the hard way the LVM has issue with devfs, i.e., the open issue with too many symlinks.

My question is there a way to trick the kernel/fs into using the same scsi device names somehow, for lack of a better way of describing it. LVM seems ok with the dev names changing, so I guess I could write a little bash script to figure out what drive is plugged in where, but it just doesn't seem like a good solution.

Any suggestions greatly appreciated.
Back to top
View user's profile Send private message
garlicbread
Apprentice
Apprentice


Joined: 06 Mar 2004
Posts: 182

PostPosted: Fri Oct 22, 2004 12:07 pm    Post subject: Reply with quote

One solution would be to look into using udev
instead of devfs (which has to be disabled for udev to work)

the new 2.6 kernel now creates a block device within several different places within the /sys directory (virtual filesystem similar to /proc)
the idea is, is that when something is removed or added, the device node is created within /sys and a userspace tool called udev is called to create a symlink from /sys to /dev automaticaly

the advantage of this is that you can specify in the udev config file how you want it to respond to devices appearing within /sys
since the device appears in several different places within /sys it's possible for udev to look it up in different ways

One example of this is that /sys can give a unique ID for the device just connected based on the chipset and other features of the hardware
If udev recognises this unique ID in it's config file, it can create a symlink with a specific name

Disadvantages are
It can be difficult to setup at the moment
not all hardware is supported to appear under /sys yet
I think you'll need to unmask some of the more experimental ebuilds relating to the startup scripts for udev to work

see here http://www.linuxjournal.com/article.php?sid=7316

in order to turn off devfs for udev to work
I believe there is a kernel parameter you can pass at boot time
something like devfs=nomount or something (check the Kernel Documentation)

Also one thing to be aware of, I think when emerging udev
it will automaticly look at all the device nodes located within /dev that have been setup by devfs that your using at the moment
it'l then copy these device nodes into a compressed archive as a backup
and upon bootup extract the archive into /dev (the same as using mknod)
I think this is just a temporary fix to the problem of udev not supporting all the hardware yet
Back to top
View user's profile Send private message
commonloon
Tux's lil' helper
Tux's lil' helper


Joined: 13 Apr 2004
Posts: 133
Location: Marin, CA

PostPosted: Fri Oct 22, 2004 6:28 pm    Post subject: Looks promising. Reply with quote

Thanks I'll check it out.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum