lkml.org 
[lkml]   [1998]   [Jan]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: no need for a devfs
From
Date

In message <6lcd3noHw-B@khms.westfalen.de>, Kai Henningsen writes:
>
>What you probably really want is something like this:
>
>* for each partition, determine a unique id somehow (ext2 already has
> this, and so does FAT)
>
>* Use this id to identify the partition

>And it works for every disk type, not only SCSI disks.
>
>You could have the kernel advertize these names in /proc/disks/ or
>something similar.

You don't really need kernel support for this; as long as you can find
your root filesystem, it's trivial to produce a set of symlinks to the
right devices. Here's a 2-minute perl script that creates
/dev/e2fs/UUID entries for all ext2 filesystems on the system (or at
least all on /dev/sd* or /dev/ha*). It's not great perl, but it
works.


#!/usr/bin/perl -w

@drives=`ls /dev/sd* /dev/hd*`;

foreach $drive (@drives) {
chomp($drive);
open(DUMPE2FS,"/sbin/dumpe2fs $drive 2>&1 |") or next;
while (<DUMPE2FS>) {
if(/Filesystem UUID:\W+([-0-9a-f]+)/) {
print "Drive: $drive ID: $1\n";
symlink("$drive","/dev/ext2/$1");
}
}
}



Scott

\
 
 \ /
  Last update: 2005-03-22 13:41    [W:0.115 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site