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

    In message <>, 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

    #!/usr/bin/perl -w

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

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


     \ /
      Last update: 2005-03-22 13:41    [W:0.017 / U:5.540 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site