Loading ...
Sorry, an error occurred while loading the content.

Mount by UUID in SlugOS

Expand Messages
  • Bruce Wayne
    Hi, I ve recently upgraded my NSLU2 to SlugOS BE, 4.8 beta, downloaded from slug-firmware.net. I use a USB stick for my OS, which i ve populated using the
    Message 1 of 13 , Feb 9, 2008
    • 0 Attachment
      Hi,

      I've recently upgraded my NSLU2 to SlugOS BE, 4.8 beta, downloaded from
      slug-firmware.net. I use a USB stick for my OS, which i've populated using
      the turnup memstick ...-command. The system boots fine when I only use a
      USB memstick, however, as soon as I connect my second usb storage, which
      is a USB HDD, it will no longer boot (with memstick AND hdd). Or, it seems
      to boot (it beeps and all that), however, SSHd never comes online, and it
      does not reply to pings.

      To debug, I soldered a serial cable and viewed the output from the bootup,
      when both memstick and Hdd is connected. It can be seen at
      http://pastebin.com/m69affeca.

      The problem appears to be that when i only boot with memstick, it gets
      mapped to /dev/sda. When I booth with both memstick and Hdd, the memstick
      is mapped to /dev/sdb, and hdd to /dev/sda. Which of course is
      problematic, because the kernel on flash expects an OS on /dev/sda1.

      How can this be fixed? I read about mounting by UUIDs, and in particular
      this page on wiki:
      http://www.nslu2-linux.org/wiki/HowTo/MountDisksByLabel

      It seems to be for Debian, but it describes the problems I'm having. I
      attempted to follow this guide, but have run into a few difficulties.
      First of all, SlugOS seems to always boot from flash
      (root=/dev/mtdblock4), where the kernel lies. This kernel then boots, and
      starts loading from the memstick. On Debian, it seems like it attempts to
      boot directly from memstick. So i can't really follow the guide, because
      SlugOS seems to handle things differently, I guess i still need the kernel
      on flash for things to work, I cannot just skip it and try to boot
      directly from memstick I guess?

      I learned that SlugOS relies on /initrd/linuxrc to pick which device to
      use as root, so I looked at this file:
      root@abydos:~$ cat /initrd/linuxrc
      #!/bin/sh
      leds beep
      sleep='10' UUID='6f3c5e76-4bba-4c4e-b3d6-4d7fdc9f7e4e' exec '/boot/disk'
      '/dev/sda1' '-t' 'ext3' '-o' 'noatime'
      exec /boot/flash

      The given UUID, [6f3c5e76-4bba-4c4e-b3d6-4d7fdc9f7e4e], is the correct
      UUID for my memstick. I have verified this, by booting with only memstick
      and doing:

      root@abydos:~$ /lib/udev/vol_id -d /dev/sda1
      ID_FS_USAGE=filesystem
      ID_FS_TYPE=ext3
      ID_FS_VERSION=16777216.0
      ID_FS_UUID=6f3c5e76-4bba-4c4e-b3d6-4d7fdc9f7e4e
      ID_FS_LABEL=
      ID_FS_LABEL_SAFE=


      * I don't get why it would need to specify /dev/sda1 in addition to the
      UUID though?
      * Isn't the purpose of mounting by UUIDs to skip the whole device name
      part?
      * What is the format of linuxrc file, the parameters (?) to 'exec' etc?
      Tried to search Wiki, but no docs on this.
      * I guess a possible solution would be to edit linuxrc to say /dev/sdb1
      instead, but this would break single-disk bootups instead.

      Any help is appreciated, thanks in advance.

      BR Bruce
    • Mike (mwester)
      ... Yes, that s Debian, and the two boot processes are very different. ... Well, sort of. Both kernel and the root filesystem are in the flash, but they are
      Message 2 of 13 , Feb 9, 2008
      • 0 Attachment
        Bruce Wayne wrote:
        > Hi,
        >
        > I've recently upgraded my NSLU2 to SlugOS BE, 4.8 beta, downloaded from
        > slug-firmware.net. I use a USB stick for my OS, which i've populated using
        > the turnup memstick ...-command. The system boots fine when I only use a
        > USB memstick, however, as soon as I connect my second usb storage, which
        > is a USB HDD, it will no longer boot (with memstick AND hdd). Or, it seems
        > to boot (it beeps and all that), however, SSHd never comes online, and it
        > does not reply to pings.
        >
        > To debug, I soldered a serial cable and viewed the output from the bootup,
        > when both memstick and Hdd is connected. It can be seen at
        > http://pastebin.com/m69affeca.
        >
        > The problem appears to be that when i only boot with memstick, it gets
        > mapped to /dev/sda. When I booth with both memstick and Hdd, the memstick
        > is mapped to /dev/sdb, and hdd to /dev/sda. Which of course is
        > problematic, because the kernel on flash expects an OS on /dev/sda1.
        >
        > How can this be fixed? I read about mounting by UUIDs, and in particular
        > this page on wiki:
        > http://www.nslu2-linux.org/wiki/HowTo/MountDisksByLabel
        >
        > It seems to be for Debian, but it describes the problems I'm having. I
        > attempted to follow this guide, but have run into a few difficulties.
        >
        Yes, that's Debian, and the two boot processes are very different.
        > First of all, SlugOS seems to always boot from flash
        > (root=/dev/mtdblock4), where the kernel lies.
        Well, sort of. Both kernel and the root filesystem are in the flash,
        but they are stored separately. The rootfs does not contain the
        kernel. That doesn't affect your problem in any way, but I just want to
        clarify that for those who may search the mailing list archives and end
        up confused on this point.
        > This kernel then boots, and
        > starts loading from the memstick. On Debian, it seems like it attempts to
        > boot directly from memstick. So i can't really follow the guide, because
        > SlugOS seems to handle things differently, I guess i still need the kernel
        > on flash for things to work, I cannot just skip it and try to boot
        > directly from memstick I guess?
        >
        Nope. That's a feature. IMO, one of the biggest differences between
        Debian and SlugOS is that SlugOS maintains a complete bootable rootfs in
        flash that you can use to recover your hard drive or memory stick in
        event of a problem. Debian boots directly from the external devices,
        and thus does not have this recovery ability.
        > I learned that SlugOS relies on /initrd/linuxrc to pick which device to
        > use as root, so I looked at this file:
        > root@abydos:~$ cat /initrd/linuxrc
        > #!/bin/sh
        > leds beep
        > sleep='10' UUID='6f3c5e76-4bba-4c4e-b3d6-4d7fdc9f7e4e' exec '/boot/disk'
        > '/dev/sda1' '-t' 'ext3' '-o' 'noatime'
        > exec /boot/flash
        >
        > The given UUID, [6f3c5e76-4bba-4c4e-b3d6-4d7fdc9f7e4e], is the correct
        > UUID for my memstick. I have verified this, by booting with only memstick
        > and doing:
        >
        > root@abydos:~$ /lib/udev/vol_id -d /dev/sda1
        > ID_FS_USAGE=filesystem
        > ID_FS_TYPE=ext3
        > ID_FS_VERSION=16777216.0
        > ID_FS_UUID=6f3c5e76-4bba-4c4e-b3d6-4d7fdc9f7e4e
        > ID_FS_LABEL=
        > ID_FS_LABEL_SAFE=
        >
        >
        > * I don't get why it would need to specify /dev/sda1 in addition to the
        > UUID though?
        > * Isn't the purpose of mounting by UUIDs to skip the whole device name
        > part?
        >
        In event of failure to resolve the UUID, it will attempt to use the
        device specified. SlugOS has been designed to as resilient as possible,
        since you don't have a console to read error messages in most cases.
        > * What is the format of linuxrc file, the parameters (?) to 'exec' etc?
        > Tried to search Wiki, but no docs on this.
        >
        You'll have to read the /boot/disk script; it's not documented elsewhere
        (and the script is itself pretty straightforward).
        > * I guess a possible solution would be to edit linuxrc to say /dev/sdb1
        > instead, but this would break single-disk bootups instead.
        >
        Yep, and it wouldn't solve this problem either. The boot script is
        correctly finding your partition, the one specified by UUID. The
        problem is that udev seems to have picked up a bad habit somewhere along
        the way -- it attempts to mount the devices it finds based on the
        information in the fstab. There's a boot-time script that fixes your
        fstab to reflect the current mapping of devices to UUIDs, but udev runs
        before that script -- with the result being that udev mounts /dev/sda1
        over top of the correctly-mounted rootfs, and everything goes to pieces
        at that point.

        The fix is simple - prevent udev from doing such anti-social
        activities. Boot up without the disk. In that state (all working
        correctly), edit /etc/udev/scripts/mount.sh. Find this block of code:

        if [ -x "$PMOUNT" ]; then
        $PMOUNT $DEVNAME 2> /dev/null
        elif [ -x $MOUNT ]; then
        $MOUNT $DEVNAME 2> /dev/null
        fi

        Change the "$MOUNT $DEVNAME 2> /dev/null" line to "# $MOUNT $DEVNAME 2>
        /dev/null" (if you just remove it altogether I think you'll end up with
        a shell syntax error, so stick with commenting it out).

        Reboot. All should be well. FYI, if your external disk doesn't end up
        automagically mounted on /media/sd<whatever> after you make that edit,
        that's a sign that you may have ended up with a syntax error in the
        mount.sh script above; check your work carefully.

        > Any help is appreciated, thanks in advance.
        >
        > BR Bruce
        >
        >
        Mike (mwester)
      • Brian Keck
        ... You ll probably get more educated & maybe more correct replies, because I use slugos with non-standard initrd scripts ... anyway ... I ve been under the
        Message 3 of 13 , Feb 10, 2008
        • 0 Attachment
          On Sat, 09 Feb 2008 14:50:22 BST, "Bruce Wayne" wrote:
          >...
          >I learned that SlugOS relies on /initrd/linuxrc to pick which device to
          >use as root, so I looked at this file:
          >root@abydos:~$ cat /initrd/linuxrc

          You'll probably get more educated & maybe more correct replies, because
          I use slugos with non-standard initrd scripts ... anyway ...

          I've been under the impression that it's /linuxrc that is run when
          root is the initrd.

          >...
          >sleep='10' UUID='6f3c5e76-4bba-4c4e-b3d6-4d7fdc9f7e4e' exec '/boot/disk'
          >'/dev/sda1' '-t' 'ext3' '-o' 'noatime'
          >...

          I'd check that your /boot/disk really accepts these arguments.

          >* I don't get why it would need to specify /dev/sda1 in addition to the
          >UUID though?
          >* Isn't the purpose of mounting by UUIDs to skip the whole device name
          >part?

          Yes (I use labels, but the principle is the same).

          >* What is the format of linuxrc file,

          It's just a sh script (as is /boot/disk), so you can find out
          what they do just by reading them, & it's easy to write your own,
          though the penalty for mistakes is a slugos reflash.

          >the parameters (?) to 'exec' etc?

          Exec is an ancient sh builtin command that just runs the command+args
          that follows it (almost the same as running command+args directly, but
          avoids creating a new Unix process).

          >...

          Brian Keck
        • pdyer62
          Hi I have a related problem. I have two hard disks with four partitions and to ensure that they mount correctly I ve used their UUID d in fstab. This seems
          Message 4 of 13 , Mar 26, 2008
          • 0 Attachment
            Hi

            I have a related problem. I have two hard disks with four partitions
            and to ensure that they mount correctly I've used their UUID'd in
            fstab. This seems to work OK - at least I have samba running
            successfully.

            However, except for the root partition, the partitions are also
            mounted on /media/sdxx - ie they're mounted twice!!

            I've tried commenting out almost all of the mount.sh script but this
            seems to have no effect at all and I can't see any reference
            to /media anywhere else.

            Any help would be very welcome

            Peter Dyer

            --- In nslu2-linux@yahoogroups.com, "Bruce Wayne" <huleborina@...>
            wrote:
            >
            > Hi,
            >
            > I've recently upgraded my NSLU2 to SlugOS BE, 4.8 beta, downloaded
            from
            > slug-firmware.net. I use a USB stick for my OS, which i've
            populated using
            > the turnup memstick ...-command. The system boots fine when I only
            use a
            > USB memstick, however, as soon as I connect my second usb storage,
            which
            > is a USB HDD, it will no longer boot (with memstick AND hdd). Or,
            it seems
            > to boot (it beeps and all that), however, SSHd never comes online,
            and it
            > does not reply to pings.
            >
            > To debug, I soldered a serial cable and viewed the output from the
            bootup,
            > when both memstick and Hdd is connected. It can be seen at
            > http://pastebin.com/m69affeca.
            >
            > The problem appears to be that when i only boot with memstick, it
            gets
            > mapped to /dev/sda. When I booth with both memstick and Hdd, the
            memstick
            > is mapped to /dev/sdb, and hdd to /dev/sda. Which of course is
            > problematic, because the kernel on flash expects an OS on /dev/sda1.
            >
            > How can this be fixed? I read about mounting by UUIDs, and in
            particular
            > this page on wiki:
            > http://www.nslu2-linux.org/wiki/HowTo/MountDisksByLabel
            >
            > It seems to be for Debian, but it describes the problems I'm
            having. I
            > attempted to follow this guide, but have run into a few
            difficulties.
            > First of all, SlugOS seems to always boot from flash
            > (root=/dev/mtdblock4), where the kernel lies. This kernel then
            boots, and
            > starts loading from the memstick. On Debian, it seems like it
            attempts to
            > boot directly from memstick. So i can't really follow the guide,
            because
            > SlugOS seems to handle things differently, I guess i still need the
            kernel
            > on flash for things to work, I cannot just skip it and try to boot
            > directly from memstick I guess?
            >
            > I learned that SlugOS relies on /initrd/linuxrc to pick which
            device to
            > use as root, so I looked at this file:
            > root@abydos:~$ cat /initrd/linuxrc
            > #!/bin/sh
            > leds beep
            > sleep='10' UUID='6f3c5e76-4bba-4c4e-b3d6-4d7fdc9f7e4e'
            exec '/boot/disk'
            > '/dev/sda1' '-t' 'ext3' '-o' 'noatime'
            > exec /boot/flash
            >
            > The given UUID, [6f3c5e76-4bba-4c4e-b3d6-4d7fdc9f7e4e], is the
            correct
            > UUID for my memstick. I have verified this, by booting with only
            memstick
            > and doing:
            >
            > root@abydos:~$ /lib/udev/vol_id -d /dev/sda1
            > ID_FS_USAGE=filesystem
            > ID_FS_TYPE=ext3
            > ID_FS_VERSION=16777216.0
            > ID_FS_UUID=6f3c5e76-4bba-4c4e-b3d6-4d7fdc9f7e4e
            > ID_FS_LABEL=
            > ID_FS_LABEL_SAFE=
            >
            >
            > * I don't get why it would need to specify /dev/sda1 in addition to
            the
            > UUID though?
            > * Isn't the purpose of mounting by UUIDs to skip the whole device
            name
            > part?
            > * What is the format of linuxrc file, the parameters (?) to 'exec'
            etc?
            > Tried to search Wiki, but no docs on this.
            > * I guess a possible solution would be to edit linuxrc to
            say /dev/sdb1
            > instead, but this would break single-disk bootups instead.
            >
            > Any help is appreciated, thanks in advance.
            >
            > BR Bruce
            >
          • Mike (mwester)
            ... You need to blacklist the device you don t want to have mounted on /media/sdxx. For example, in order to prevent /dev/sdb1 from being mounted as
            Message 5 of 13 , Mar 27, 2008
            • 0 Attachment
              pdyer62 wrote:
              > Hi
              >
              > I have a related problem. I have two hard disks with four partitions
              > and to ensure that they mount correctly I've used their UUID'd in
              > fstab. This seems to work OK - at least I have samba running
              > successfully.
              >
              > However, except for the root partition, the partitions are also
              > mounted on /media/sdxx - ie they're mounted twice!!

              You need to blacklist the device you don't want to have mounted on
              /media/sdxx. For example, in order to prevent /dev/sdb1 from being
              mounted as /media/sdb1, add "sdb1" to the end of the blacklist file in
              /etc/udev.

              > I've tried commenting out almost all of the mount.sh script but this
              > seems to have no effect at all and I can't see any reference
              > to /media anywhere else.
              >
              > Any help would be very welcome
              >
              > Peter Dyer

              Mike (mwester)
            • Scott Ruckh
              ... /etc/udev/mount.blacklist contains the following: ram[0-9]$ mtdblock[0-9]$ hd[a-z]$ sd[a-z]$ so in the /initrd/etc/udev/scripts/mount.sh script wouldn t it
              Message 6 of 13 , Mar 29, 2008
              • 0 Attachment
                pdyer62 wrote:
                >> Hi
                >>
                >> I have a related problem. I have two hard disks with four partitions
                >> and to ensure that they mount correctly I've used their UUID'd in
                >> fstab. This seems to work OK - at least I have samba running
                >> successfully.
                >>
                >> However, except for the root partition, the partitions are also
                >> mounted on /media/sdxx - ie they're mounted twice!!

                >You need to blacklist the device you don't want to have mounted on
                >/media/sdxx. For example, in order to prevent /dev/sdb1 from being
                >mounted as /media/sdb1, add "sdb1" to the end of the blacklist file in
                >/etc/udev.

                >> I've tried commenting out almost all of the mount.sh script but this
                >> seems to have no effect at all and I can't see any reference
                >> to /media anywhere else.

                /etc/udev/mount.blacklist contains the following:

                ram[0-9]$
                mtdblock[0-9]$
                hd[a-z]$
                sd[a-z]$

                so in the /initrd/etc/udev/scripts/mount.sh script wouldn't it exit immediately; for example, if the
                device is /dev/sda1 ?

                I would think this code would 'exit 0' the mount.sh script.

                for line in `cat /etc/udev/mount.blacklist | grep -v ^#`
                do
                if ( echo "$DEVNAME" | grep -q "$line" )
                then
                logger "udev/mount.sh" "[$DEVNAME] is blacklisted, ignoring"
                exit 0
                fi
                done

                I would not think this code gets executed:

                if [ -x "$PMOUNT" ]; then
                $PMOUNT $DEVNAME 2> /dev/null
                elif [ -x $MOUNT ]; then
                $MOUNT $DEVNAME 2> /dev/null
                fi

                I am trying to solve a similar issue from this thread where I would like to mount device by UUID so
                that the mappings are persistent.

                With /initrd/linuxrc looking like this:
                #!/bin/sh
                leds beep
                sleep='10' UUID='4416c3fc-0f5c-44b1-ad35-8d2d42aa55e5' exec '/boot/disk' '/dev/sda1' '-t' 'ext3' '-o'
                'defaults'
                exec /boot/flash

                and /boot/disk having this code:

                if test -n "$UUID" &&
                mount "$@" -U "$UUID" /mnt ||
                mount "$@" "$device" /mnt
                then

                I would think the 'test -n' would be a success (as UUID was set in initrd/linuxrc), and the 'mount -t
                ext3 -o defaults -U 4416c3fc-0f5c-44b1-ad35-8d2d42aa55e5 /mnt" would successfully mount the "root" disk
                successfully by UUID.

                Assuming that this is correct, I would think you could then mount other file systems via /etc/fstab,
                correct?

                For some reason this does not always seem to be the case. Does the /initrd/linuxrc file get updated,
                or does it stay mostly static.

                I do not always get successful boots where the disk with the above UUID get mounted properly, but I can
                not see why it does not work.

                I believe I am trying to solve the same problem from this thread, but everything looks like it should
                be OK.

                What am I missing?

                Thanks.
              • Mike (mwester)
                ... No. It exits if the device is /dev/sda -- the $ marks end-of-line. So this pattern ensures that we do not attempt to mount /dev/sda, rather we only mount
                Message 7 of 13 , Mar 29, 2008
                • 0 Attachment
                  Scott Ruckh wrote:
                  > pdyer62 wrote:
                  >>> Hi
                  >>>
                  >>> I have a related problem. I have two hard disks with four partitions
                  >>> and to ensure that they mount correctly I've used their UUID'd in
                  >>> fstab. This seems to work OK - at least I have samba running
                  >>> successfully.
                  >>>
                  >>> However, except for the root partition, the partitions are also
                  >>> mounted on /media/sdxx - ie they're mounted twice!!
                  >
                  >> You need to blacklist the device you don't want to have mounted on
                  >> /media/sdxx. For example, in order to prevent /dev/sdb1 from being
                  >> mounted as /media/sdb1, add "sdb1" to the end of the blacklist file in
                  >> /etc/udev.
                  >
                  >>> I've tried commenting out almost all of the mount.sh script but this
                  >>> seems to have no effect at all and I can't see any reference
                  >>> to /media anywhere else.
                  >
                  > /etc/udev/mount.blacklist contains the following:
                  >
                  > ram[0-9]$
                  > mtdblock[0-9]$
                  > hd[a-z]$
                  > sd[a-z]$
                  >
                  > so in the /initrd/etc/udev/scripts/mount.sh script wouldn't it exit immediately; for example, if the
                  > device is /dev/sda1 ?

                  No. It exits if the device is /dev/sda -- the $ marks end-of-line. So
                  this pattern ensures that we do not attempt to mount /dev/sda, rather we
                  only mount /dev/sda1, /dev/sda2, etc.

                  So if you wish to ensure that you do not have udev attempt to mount
                  /dev/sda<n>, you need to add:

                  sda[1-9]$

                  or you can get away with:

                  sda

                  (without the $, so that it matches only the first three characters. Or
                  you can just list the specific partitions to ignore:

                  sda1
                  sda2
                  sda3

                  > I would think this code would 'exit 0' the mount.sh script.
                  >
                  > for line in `cat /etc/udev/mount.blacklist | grep -v ^#`
                  > do
                  > if ( echo "$DEVNAME" | grep -q "$line" )
                  > then
                  > logger "udev/mount.sh" "[$DEVNAME] is blacklisted, ignoring"
                  > exit 0
                  > fi
                  > done
                  >
                  > I would not think this code gets executed:
                  >
                  > if [ -x "$PMOUNT" ]; then
                  > $PMOUNT $DEVNAME 2> /dev/null
                  > elif [ -x $MOUNT ]; then
                  > $MOUNT $DEVNAME 2> /dev/null
                  > fi
                  >
                  > I am trying to solve a similar issue from this thread where I would like to mount device by UUID so
                  > that the mappings are persistent.
                  >
                  > With /initrd/linuxrc looking like this:
                  > #!/bin/sh
                  > leds beep
                  > sleep='10' UUID='4416c3fc-0f5c-44b1-ad35-8d2d42aa55e5' exec '/boot/disk' '/dev/sda1' '-t' 'ext3' '-o'
                  > 'defaults'
                  > exec /boot/flash
                  >
                  > and /boot/disk having this code:
                  >
                  > if test -n "$UUID" &&
                  > mount "$@" -U "$UUID" /mnt ||
                  > mount "$@" "$device" /mnt
                  > then
                  >
                  > I would think the 'test -n' would be a success (as UUID was set in initrd/linuxrc), and the 'mount -t
                  > ext3 -o defaults -U 4416c3fc-0f5c-44b1-ad35-8d2d42aa55e5 /mnt" would successfully mount the "root" disk
                  > successfully by UUID.
                  >
                  > Assuming that this is correct, I would think you could then mount other file systems via /etc/fstab,
                  > correct?

                  Yes. But you can't necessarily count on udev to mount it by UUID for
                  you; the current udev implementation is very dumb, it is based on device
                  identifiers, which we know change with USB-based peripherals. If you
                  wish to mount by UUID you really need to re-write the udev mount.sh
                  yourself, or just blacklist all the sd[a-z] devices and do everything by
                  UUID at boot time.

                  (We are aware that the udev logic is lacking; suggestions are welcome,
                  but code implementing a better solution is preferred!)

                  > For some reason this does not always seem to be the case. Does the /initrd/linuxrc file get updated,
                  > or does it stay mostly static.

                  It is never updated; it is set when you issue the "turnup" command. The
                  only way to change it is to "turnup flash", reboot, and re-turnup to the
                  new rootfs.

                  > I do not always get successful boots where the disk with the above UUID get mounted properly, but I can
                  > not see why it does not work.

                  Your mount.sh should look like this -- if the section below is not
                  commented out as below, you may have problems (this is a recent fix):

                  if [ "$ACTION" = "add" ] && [ -n "$DEVNAME" ]; then
                  # SlugOS: we pivot to the rootfs based on UUID, not on fstab --
                  so the fstab may not
                  # be correct at this point in the boot. So we must not let
                  udev mount devices based
                  # solely on the fstab, lest we mount overtop the real rootfs.
                  For now we just comment
                  # out the logic below and let the automount logic (far below)
                  deal with all udev mount
                  # operations.
                  #if [ -x "$PMOUNT" ]; then
                  # $PMOUNT $DEVNAME 2> /dev/null
                  #elif [ -x $MOUNT ]; then
                  # $MOUNT $DEVNAME 2> /dev/null
                  #fi


                  > I believe I am trying to solve the same problem from this thread, but everything looks like it should
                  > be OK.
                  >
                  > What am I missing?

                  A serial console? That's a very helpful thing to have to debug this. :)

                  > Thanks.
                  >
                  >

                  Mike (mwester)
                • John
                  ... /dev/sda1 doesn t match any of those patterns. Have you tried blacklisting: sd[a-z][0-9]$
                  Message 8 of 13 , Mar 29, 2008
                  • 0 Attachment
                    On Sat, Mar 29, 2008 at 03:30:50PM -0700, Scott Ruckh wrote:
                    > /etc/udev/mount.blacklist contains the following:
                    >
                    > ram[0-9]$
                    > mtdblock[0-9]$
                    > hd[a-z]$
                    > sd[a-z]$
                    >
                    > so in the /initrd/etc/udev/scripts/mount.sh script wouldn't it
                    > exit immediately; for example, if the device is /dev/sda1 ?

                    /dev/sda1 doesn't match any of those patterns. Have you tried
                    blacklisting:

                    sd[a-z][0-9]$
                  • Scott Ruckh
                    This is what you said Mike (mwester) ... My regex skills (or lack of skills) are revealed. ... Where is boot time (I can t seem to follow the flow of the boot
                    Message 9 of 13 , Mar 30, 2008
                    • 0 Attachment
                      This is what you said Mike (mwester)
                      > Scott Ruckh wrote:
                      >> pdyer62 wrote:
                      >>>> Hi
                      >>>>
                      >>>> I have a related problem. I have two hard disks with four partitions
                      >>>> and to ensure that they mount correctly I've used their UUID'd in
                      >>>> fstab. This seems to work OK - at least I have samba running
                      >>>> successfully.
                      >>>>
                      >>>> However, except for the root partition, the partitions are also
                      >>>> mounted on /media/sdxx - ie they're mounted twice!!
                      >>
                      >>> You need to blacklist the device you don't want to have mounted on
                      >>> /media/sdxx. For example, in order to prevent /dev/sdb1 from being
                      >>> mounted as /media/sdb1, add "sdb1" to the end of the blacklist file in
                      >>> /etc/udev.
                      >>
                      >>>> I've tried commenting out almost all of the mount.sh script but this
                      >>>> seems to have no effect at all and I can't see any reference
                      >>>> to /media anywhere else.
                      >>
                      >> /etc/udev/mount.blacklist contains the following:
                      >>
                      >> ram[0-9]$
                      >> mtdblock[0-9]$
                      >> hd[a-z]$
                      >> sd[a-z]$
                      >>
                      >> so in the /initrd/etc/udev/scripts/mount.sh script wouldn't it exit immediately; for example, if the
                      >> device is /dev/sda1 ?
                      >
                      > No. It exits if the device is /dev/sda -- the $ marks end-of-line. So
                      > this pattern ensures that we do not attempt to mount /dev/sda, rather we
                      > only mount /dev/sda1, /dev/sda2, etc.
                      >

                      My regex skills (or lack of skills) are revealed.

                      >> I would think this code would 'exit 0' the mount.sh script.
                      >>
                      >> for line in `cat /etc/udev/mount.blacklist | grep -v ^#`
                      >> do
                      >> if ( echo "$DEVNAME" | grep -q "$line" )
                      >> then
                      >> logger "udev/mount.sh" "[$DEVNAME] is blacklisted, ignoring"
                      >> exit 0
                      >> fi
                      >> done
                      >>
                      >> I would not think this code gets executed:
                      >>
                      >> if [ -x "$PMOUNT" ]; then
                      >> $PMOUNT $DEVNAME 2> /dev/null
                      >> elif [ -x $MOUNT ]; then
                      >> $MOUNT $DEVNAME 2> /dev/null
                      >> fi
                      >>
                      >> I am trying to solve a similar issue from this thread where I would like to mount device by UUID so
                      >> that the mappings are persistent.
                      >>
                      >> With /initrd/linuxrc looking like this:
                      >> #!/bin/sh
                      >> leds beep
                      >> sleep='10' UUID='4416c3fc-0f5c-44b1-ad35-8d2d42aa55e5' exec '/boot/disk' '/dev/sda1' '-t' 'ext3' '-o'
                      >> 'defaults'
                      >> exec /boot/flash
                      >>
                      >> and /boot/disk having this code:
                      >>
                      >> if test -n "$UUID" &&
                      >> mount "$@" -U "$UUID" /mnt ||
                      >> mount "$@" "$device" /mnt
                      >> then
                      >>
                      >> I would think the 'test -n' would be a success (as UUID was set in initrd/linuxrc), and the 'mount -t
                      >> ext3 -o defaults -U 4416c3fc-0f5c-44b1-ad35-8d2d42aa55e5 /mnt" would successfully mount the "root"
                      >> disk
                      >> successfully by UUID.
                      >>
                      >> Assuming that this is correct, I would think you could then mount other file systems via /etc/fstab,
                      >> correct?
                      >
                      > Yes. But you can't necessarily count on udev to mount it by UUID for
                      > you; the current udev implementation is very dumb, it is based on device
                      > identifiers, which we know change with USB-based peripherals. If you
                      > wish to mount by UUID you really need to re-write the udev mount.sh
                      > yourself, or just blacklist all the sd[a-z] devices and do everything by
                      > UUID at boot time.

                      Where is boot time (I can't seem to follow the flow of the boot sequence)?

                      I tried black-listing all devices, and commenting out the code you suggested in mount.sh, but that did
                      not seem to help.

                      What is this code for in boot/disk ?

                      if test -d /mnt/initrd
                      then
                      swivel mnt initrd
                      else
                      swivel mnt mnt
                      fi

                      If /mnt is the filesystem that was mounted by UUID, is there an initrd sub-directory on /mnt? I
                      assumed the initrd directory was something that showed up post "swivel" after the new file system
                      becomes the root file system.

                      Plus I will admit I am not following exactly what is going on in the swivel function.

                      I have a case where I have a 500GB disk plugged into USB Port2. This disk contains /dev/sda1 (at least
                      when it is booted by itself). If it is being mounted by UUID, then it should be the disk that is
                      swiveled, or at least that is my assumption.

                      In port-1 of the NSLU2 is a USB hub. Plugged into Port-1 of the hub is a thumb drive that has been
                      configured for swap. When everything is "happy" the swap partition is /dev/sdb1.

                      I figured after a successfull "swivel" the script /etc/init.d/checkroot.sh (from the /dev/sda1
                      file-system) would then mount /dev/sdb1 as swap.

                      For whatever reason, if the hdd and the thumb drive are both plugged in and the NSLU2 is restarted, the
                      NSLU2 can not be contacted on the network. No ping, no SSH, no nothing. If the thumb drive is removed
                      and the NSLU2 is started is comes up as expected (of course with no swap). If the thumb drive is then
                      plugged in, the swap partition shows up as /dev/sdb1, and calling swapon /dev/sdb1 works without a
                      hitch.

                      I am having a hard time following the boot sequence, and definitely do not understand why the NSLU2
                      does not come up correctly when both devices are connected.

                      I would assume if I black-listed the devices from udev, then I could manually mount additional drives
                      in /etc/fstab (on the swiveled drive).


                      > A serial console? That's a very helpful thing to have to debug this. :)

                      Yes, this would be nice. Unfortunately I am supporting this many states away and I don't think a
                      laptop with ssh and a serial console are going to be available. I was going to throw some debug code
                      in, but I am not sure where I can send output. Do I put output on the original initrd file-system
                      before the swivel, and on the chroot'd files system after the swivel?

                      I am going to continue looking at all the parts, but I have been unable to crack the case so far.

                      Thanks!!!!!
                    • pdyer62
                      Thanks Mike that worked for me. Peter ... partitions ... in ... this
                      Message 10 of 13 , Mar 31, 2008
                      • 0 Attachment
                        Thanks Mike that worked for me.

                        Peter

                        --- In nslu2-linux@yahoogroups.com, "Mike (mwester)" <mwester@...>
                        wrote:
                        >
                        > pdyer62 wrote:
                        > > Hi
                        > >
                        > > I have a related problem. I have two hard disks with four
                        partitions
                        > > and to ensure that they mount correctly I've used their UUID'd in
                        > > fstab. This seems to work OK - at least I have samba running
                        > > successfully.
                        > >
                        > > However, except for the root partition, the partitions are also
                        > > mounted on /media/sdxx - ie they're mounted twice!!
                        >
                        > You need to blacklist the device you don't want to have mounted on
                        > /media/sdxx. For example, in order to prevent /dev/sdb1 from being
                        > mounted as /media/sdb1, add "sdb1" to the end of the blacklist file
                        in
                        > /etc/udev.
                        >
                        > > I've tried commenting out almost all of the mount.sh script but
                        this
                        > > seems to have no effect at all and I can't see any reference
                        > > to /media anywhere else.
                        > >
                        > > Any help would be very welcome
                        > >
                        > > Peter Dyer
                        >
                        > Mike (mwester)
                        >
                      • Scott Ruckh
                        ... Mike, I was wondering if you have feedback on this? Why doesn t the system come up correctly if the swiveled disk (500GB disk on port-2 of NSLU2; which is
                        Message 11 of 13 , Apr 10, 2008
                        • 0 Attachment
                          >
                          > This is what you said Mike (mwester)
                          >> Scott Ruckh wrote:
                          >>> pdyer62 wrote:
                          >>>>> Hi
                          >>>>>
                          >>>>> I have a related problem. I have two hard disks with four partitions
                          >>>>> and to ensure that they mount correctly I've used their UUID'd in
                          >>>>> fstab. This seems to work OK - at least I have samba running
                          >>>>> successfully.
                          >>>>>
                          >>>>> However, except for the root partition, the partitions are also
                          >>>>> mounted on /media/sdxx - ie they're mounted twice!!
                          >>>
                          >>>> You need to blacklist the device you don't want to have mounted on
                          >>>> /media/sdxx. For example, in order to prevent /dev/sdb1 from being
                          >>>> mounted as /media/sdb1, add "sdb1" to the end of the blacklist file in
                          >>>> /etc/udev.
                          >>>
                          >>>>> I've tried commenting out almost all of the mount.sh script but this
                          >>>>> seems to have no effect at all and I can't see any reference
                          >>>>> to /media anywhere else.
                          >>>
                          >>> /etc/udev/mount.blacklist contains the following:
                          >>>
                          >>> ram[0-9]$
                          >>> mtdblock[0-9]$
                          >>> hd[a-z]$
                          >>> sd[a-z]$
                          >>>
                          >>> so in the /initrd/etc/udev/scripts/mount.sh script wouldn't it exit immediately; for example, if the
                          >>> device is /dev/sda1 ?
                          >>
                          >> No. It exits if the device is /dev/sda -- the $ marks end-of-line. So
                          >> this pattern ensures that we do not attempt to mount /dev/sda, rather we
                          >> only mount /dev/sda1, /dev/sda2, etc.
                          >>
                          >
                          > My regex skills (or lack of skills) are revealed.
                          >
                          >>> I would think this code would 'exit 0' the mount.sh script.
                          >>>
                          >>> for line in `cat /etc/udev/mount.blacklist | grep -v ^#`
                          >>> do
                          >>> if ( echo "$DEVNAME" | grep -q "$line" )
                          >>> then
                          >>> logger "udev/mount.sh" "[$DEVNAME] is blacklisted, ignoring"
                          >>> exit 0
                          >>> fi
                          >>> done
                          >>>
                          >>> I would not think this code gets executed:
                          >>>
                          >>> if [ -x "$PMOUNT" ]; then
                          >>> $PMOUNT $DEVNAME 2> /dev/null
                          >>> elif [ -x $MOUNT ]; then
                          >>> $MOUNT $DEVNAME 2> /dev/null
                          >>> fi
                          >>>
                          >>> I am trying to solve a similar issue from this thread where I would like to mount device by UUID so
                          >>> that the mappings are persistent.
                          >>>
                          >>> With /initrd/linuxrc looking like this:
                          >>> #!/bin/sh
                          >>> leds beep
                          >>> sleep='10' UUID='4416c3fc-0f5c-44b1-ad35-8d2d42aa55e5' exec '/boot/disk' '/dev/sda1' '-t' 'ext3' '-o'
                          >>> 'defaults'
                          >>> exec /boot/flash
                          >>>
                          >>> and /boot/disk having this code:
                          >>>
                          >>> if test -n "$UUID" &&
                          >>> mount "$@" -U "$UUID" /mnt ||
                          >>> mount "$@" "$device" /mnt
                          >>> then
                          >>>
                          >>> I would think the 'test -n' would be a success (as UUID was set in initrd/linuxrc), and the 'mount -t
                          >>> ext3 -o defaults -U 4416c3fc-0f5c-44b1-ad35-8d2d42aa55e5 /mnt" would successfully mount the "root"
                          >>> disk
                          >>> successfully by UUID.
                          >>>
                          >>> Assuming that this is correct, I would think you could then mount other file systems via /etc/fstab,
                          >>> correct?
                          >>
                          >> Yes. But you can't necessarily count on udev to mount it by UUID for
                          >> you; the current udev implementation is very dumb, it is based on device
                          >> identifiers, which we know change with USB-based peripherals. If you
                          >> wish to mount by UUID you really need to re-write the udev mount.sh
                          >> yourself, or just blacklist all the sd[a-z] devices and do everything by
                          >> UUID at boot time.
                          >
                          > Where is boot time (I can't seem to follow the flow of the boot sequence)?
                          >
                          > I tried black-listing all devices, and commenting out the code you suggested in mount.sh, but that did
                          > not seem to help.
                          >
                          > What is this code for in boot/disk ?
                          >
                          > if test -d /mnt/initrd
                          > then
                          > swivel mnt initrd
                          > else
                          > swivel mnt mnt
                          > fi
                          >
                          > If /mnt is the filesystem that was mounted by UUID, is there an initrd sub-directory on /mnt? I
                          > assumed the initrd directory was something that showed up post "swivel" after the new file system
                          > becomes the root file system.
                          >
                          > Plus I will admit I am not following exactly what is going on in the swivel function.
                          >
                          > I have a case where I have a 500GB disk plugged into USB Port2. This disk contains /dev/sda1 (at least
                          > when it is booted by itself). If it is being mounted by UUID, then it should be the disk that is
                          > swiveled, or at least that is my assumption.
                          >
                          > In port-1 of the NSLU2 is a USB hub. Plugged into Port-1 of the hub is a thumb drive that has been
                          > configured for swap. When everything is "happy" the swap partition is /dev/sdb1.
                          >
                          > I figured after a successfull "swivel" the script /etc/init.d/checkroot.sh (from the /dev/sda1
                          > file-system) would then mount /dev/sdb1 as swap.
                          >
                          > For whatever reason, if the hdd and the thumb drive are both plugged in and the NSLU2 is restarted, the
                          > NSLU2 can not be contacted on the network. No ping, no SSH, no nothing. If the thumb drive is removed
                          > and the NSLU2 is started is comes up as expected (of course with no swap). If the thumb drive is then
                          > plugged in, the swap partition shows up as /dev/sdb1, and calling swapon /dev/sdb1 works without a
                          > hitch.
                          >
                          > I am having a hard time following the boot sequence, and definitely do not understand why the NSLU2
                          > does not come up correctly when both devices are connected.
                          >
                          > I would assume if I black-listed the devices from udev, then I could manually mount additional drives
                          > in /etc/fstab (on the swiveled drive).
                          >
                          >
                          >> A serial console? That's a very helpful thing to have to debug this. :)
                          >
                          > Yes, this would be nice. Unfortunately I am supporting this many states away and I don't think a
                          > laptop with ssh and a serial console are going to be available. I was going to throw some debug code
                          > in, but I am not sure where I can send output. Do I put output on the original initrd file-system
                          > before the swivel, and on the chroot'd files system after the swivel?
                          >
                          > I am going to continue looking at all the parts, but I have been unable to crack the case so far.
                          >
                          > Thanks!!!!!

                          Mike, I was wondering if you have feedback on this? Why doesn't the system come up correctly if the swiveled disk (500GB disk on
                          port-2 of NSLU2; which is presumed to be mounted by UUID according the the scripts) and the thumb-drive plugged into a USB HUB
                          (plugged into port-1 of NSLU2) are both connected at the same time? If I boot with just 500GB disk plugged into port-2 and let it
                          come up (with a few programs not being able to load), mount the flash drive (the swap file system) manually, and then restart the
                          daemons, everything functions as it should. I would like to achieve this same functionality between reboots without manual
                          intervention.

                          Thanks for your time and patience.
                        • Mike (mwester)
                          How about we start over on this? I don t remember the context and the mess of quoted emails below are just too painful to wade through to try to figure out
                          Message 12 of 13 , Apr 11, 2008
                          • 0 Attachment
                            How about we start over on this? I don't remember the context and the
                            mess of quoted emails below are just too painful to wade through to try
                            to figure out what we know and don't know -- it looks like multiple
                            different people's problems all globbed together!

                            What firmware? Symptoms? What have you tried to date to fix what's not
                            working?

                            Mike (mwester)



                            Scott Ruckh wrote:
                            >> This is what you said Mike (mwester)
                            >>> Scott Ruckh wrote:
                            >>>> pdyer62 wrote:
                            >>>>>> Hi
                            >>>>>>
                            >>>>>> I have a related problem. I have two hard disks with four partitions
                            >>>>>> and to ensure that they mount correctly I've used their UUID'd in
                            >>>>>> fstab. This seems to work OK - at least I have samba running
                            >>>>>> successfully.
                            >>>>>>
                            >>>>>> However, except for the root partition, the partitions are also
                            >>>>>> mounted on /media/sdxx - ie they're mounted twice!!
                            >>>>> You need to blacklist the device you don't want to have mounted on
                            >>>>> /media/sdxx. For example, in order to prevent /dev/sdb1 from being
                            >>>>> mounted as /media/sdb1, add "sdb1" to the end of the blacklist file in
                            >>>>> /etc/udev.
                            >>>>>> I've tried commenting out almost all of the mount.sh script but this
                            >>>>>> seems to have no effect at all and I can't see any reference
                            >>>>>> to /media anywhere else.
                            >>>> /etc/udev/mount.blacklist contains the following:
                            >>>>
                            >>>> ram[0-9]$
                            >>>> mtdblock[0-9]$
                            >>>> hd[a-z]$
                            >>>> sd[a-z]$
                            >>>>
                            >>>> so in the /initrd/etc/udev/scripts/mount.sh script wouldn't it exit immediately; for example, if the
                            >>>> device is /dev/sda1 ?
                            >>> No. It exits if the device is /dev/sda -- the $ marks end-of-line. So
                            >>> this pattern ensures that we do not attempt to mount /dev/sda, rather we
                            >>> only mount /dev/sda1, /dev/sda2, etc.
                            >>>
                            >> My regex skills (or lack of skills) are revealed.
                            >>
                            >>>> I would think this code would 'exit 0' the mount.sh script.
                            >>>>
                            >>>> for line in `cat /etc/udev/mount.blacklist | grep -v ^#`
                            >>>> do
                            >>>> if ( echo "$DEVNAME" | grep -q "$line" )
                            >>>> then
                            >>>> logger "udev/mount.sh" "[$DEVNAME] is blacklisted, ignoring"
                            >>>> exit 0
                            >>>> fi
                            >>>> done
                            >>>>
                            >>>> I would not think this code gets executed:
                            >>>>
                            >>>> if [ -x "$PMOUNT" ]; then
                            >>>> $PMOUNT $DEVNAME 2> /dev/null
                            >>>> elif [ -x $MOUNT ]; then
                            >>>> $MOUNT $DEVNAME 2> /dev/null
                            >>>> fi
                            >>>>
                            >>>> I am trying to solve a similar issue from this thread where I would like to mount device by UUID so
                            >>>> that the mappings are persistent.
                            >>>>
                            >>>> With /initrd/linuxrc looking like this:
                            >>>> #!/bin/sh
                            >>>> leds beep
                            >>>> sleep='10' UUID='4416c3fc-0f5c-44b1-ad35-8d2d42aa55e5' exec '/boot/disk' '/dev/sda1' '-t' 'ext3' '-o'
                            >>>> 'defaults'
                            >>>> exec /boot/flash
                            >>>>
                            >>>> and /boot/disk having this code:
                            >>>>
                            >>>> if test -n "$UUID" &&
                            >>>> mount "$@" -U "$UUID" /mnt ||
                            >>>> mount "$@" "$device" /mnt
                            >>>> then
                            >>>>
                            >>>> I would think the 'test -n' would be a success (as UUID was set in initrd/linuxrc), and the 'mount -t
                            >>>> ext3 -o defaults -U 4416c3fc-0f5c-44b1-ad35-8d2d42aa55e5 /mnt" would successfully mount the "root"
                            >>>> disk
                            >>>> successfully by UUID.
                            >>>>
                            >>>> Assuming that this is correct, I would think you could then mount other file systems via /etc/fstab,
                            >>>> correct?
                            >>> Yes. But you can't necessarily count on udev to mount it by UUID for
                            >>> you; the current udev implementation is very dumb, it is based on device
                            >>> identifiers, which we know change with USB-based peripherals. If you
                            >>> wish to mount by UUID you really need to re-write the udev mount.sh
                            >>> yourself, or just blacklist all the sd[a-z] devices and do everything by
                            >>> UUID at boot time.
                            >> Where is boot time (I can't seem to follow the flow of the boot sequence)?
                            >>
                            >> I tried black-listing all devices, and commenting out the code you suggested in mount.sh, but that did
                            >> not seem to help.
                            >>
                            >> What is this code for in boot/disk ?
                            >>
                            >> if test -d /mnt/initrd
                            >> then
                            >> swivel mnt initrd
                            >> else
                            >> swivel mnt mnt
                            >> fi
                            >>
                            >> If /mnt is the filesystem that was mounted by UUID, is there an initrd sub-directory on /mnt? I
                            >> assumed the initrd directory was something that showed up post "swivel" after the new file system
                            >> becomes the root file system.
                            >>
                            >> Plus I will admit I am not following exactly what is going on in the swivel function.
                            >>
                            >> I have a case where I have a 500GB disk plugged into USB Port2. This disk contains /dev/sda1 (at least
                            >> when it is booted by itself). If it is being mounted by UUID, then it should be the disk that is
                            >> swiveled, or at least that is my assumption.
                            >>
                            >> In port-1 of the NSLU2 is a USB hub. Plugged into Port-1 of the hub is a thumb drive that has been
                            >> configured for swap. When everything is "happy" the swap partition is /dev/sdb1.
                            >>
                            >> I figured after a successfull "swivel" the script /etc/init.d/checkroot.sh (from the /dev/sda1
                            >> file-system) would then mount /dev/sdb1 as swap.
                            >>
                            >> For whatever reason, if the hdd and the thumb drive are both plugged in and the NSLU2 is restarted, the
                            >> NSLU2 can not be contacted on the network. No ping, no SSH, no nothing. If the thumb drive is removed
                            >> and the NSLU2 is started is comes up as expected (of course with no swap). If the thumb drive is then
                            >> plugged in, the swap partition shows up as /dev/sdb1, and calling swapon /dev/sdb1 works without a
                            >> hitch.
                            >>
                            >> I am having a hard time following the boot sequence, and definitely do not understand why the NSLU2
                            >> does not come up correctly when both devices are connected.
                            >>
                            >> I would assume if I black-listed the devices from udev, then I could manually mount additional drives
                            >> in /etc/fstab (on the swiveled drive).
                            >>
                            >>
                            >>> A serial console? That's a very helpful thing to have to debug this. :)
                            >> Yes, this would be nice. Unfortunately I am supporting this many states away and I don't think a
                            >> laptop with ssh and a serial console are going to be available. I was going to throw some debug code
                            >> in, but I am not sure where I can send output. Do I put output on the original initrd file-system
                            >> before the swivel, and on the chroot'd files system after the swivel?
                            >>
                            >> I am going to continue looking at all the parts, but I have been unable to crack the case so far.
                            >>
                            >> Thanks!!!!!
                            >
                            > Mike, I was wondering if you have feedback on this? Why doesn't the system come up correctly if the swiveled disk (500GB disk on
                            > port-2 of NSLU2; which is presumed to be mounted by UUID according the the scripts) and the thumb-drive plugged into a USB HUB
                            > (plugged into port-1 of NSLU2) are both connected at the same time? If I boot with just 500GB disk plugged into port-2 and let it
                            > come up (with a few programs not being able to load), mount the flash drive (the swap file system) manually, and then restart the
                            > daemons, everything functions as it should. I would like to achieve this same functionality between reboots without manual
                            > intervention.
                            >
                            > Thanks for your time and patience.
                            >
                            > ------------------------------------
                            >
                            > Yahoo! Groups Links
                            >
                            >
                            >
                            >
                          • Scott Ruckh
                            The main issue: I have 500GB HDD and 1GB thumstick currently being used as storage devices. The 500GB HDD is plugged into Port-2 of the NSLU2. The thumb drive
                            Message 13 of 13 , Apr 11, 2008
                            • 0 Attachment
                              The main issue:
                               
                              I have 500GB HDD and 1GB thumstick currently being used as storage devices.
                               
                              The 500GB HDD is plugged into Port-2 of the NSLU2.
                              The thumb drive plugged into a USB hub which is plugged into Port-1 of the NSLU2.
                               
                              When SlugOS/BE 4.8-beta was first installed it was all done with only using the 500GB HDD.
                               
                              Everything worked fine.
                               
                              Later down the road I knew a USB-hub would be used so additional HDDs could be added to NSLU2.
                               
                              Later has come, and I was going to start with adding the Thumb-drive as a swap file system.
                               
                              I deleted the swap partition from the 500GB, and created a swap partition on the Thumb-drive.  I then manually mounted the thumb drive as swap, and everything was working fine like it is supposed to.
                               
                              Then the NSLU2 was rebooted.  After the reboot the NSLU2 is completely inaccessible.
                               
                              Without any storage medium plugged in the NSLU2 is accessible with the network settings that were configured during the initial configuration.
                               
                              If I look at /initrd/linuxrc with no devices plugged in it looks like the correct information is configured for mounting the swivel disk by UUID:
                               
                              #!/bin/sh
                              leds beep
                              sleep='10' UUID='4416c3fc-0f5c-44b1-ad35-8d2d42aa55e5' exec '/boot/disk' '/dev/sda1' '-t' 'ext3' '-o' 'defaults'
                              exec /boot/flash
                               
                              That is the correct UUID for the disk that is going to be swiveled.
                               
                              If I plug that single drive into port-2 of the NSLU2 and reboot, the system comes up, it is accessible, and some of the startup daemons get loaded (some do not due to no swap space).  If I now plug the thumb-drive into port-1, swapon /dev/sdb1, and restart the daemons that could not be loaded everything is working perfectly like it should.
                               
                              If I reboot with all devices plugged it, the NSLU2 is again completely inaccessible on the network.
                               
                              I tried the suggestion of adding devices to /etc/udev/mount.blacklist, but that did not help.
                               
                              I assumed /etc/init.d/checkroot.sh would be run from the swiveled drive and automatically mount /dev/sdb1 (the thumb drive) as a swap file system.
                               
                              I am not sure what happens, but apparently /dev/sda1 never gets swiveled, and the thumb-drive /dev/sdb1 never gets mounted as swap.  Even worse the NSLU2 is completely inaccessible.
                               
                              All I am trying to accomplish is to have the drives mount automatically just the same as I do manually using the above described method (of booting with only the 500 GB connected).
                               
                              I am obviously missing something in the boot process, but I have no idea what it is.  I am doing all of this remotely and do not have remote access or the ability to get a serial connection.
                               
                              Thank You.
                               
                            Your message has been successfully submitted and would be delivered to recipients shortly.