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

Fixed device to port assignment. Help!

Expand Messages
  • mingchu
    Hi Group, I have 2 drives attached to the port 1 and 2 of the slug. memstick - port 1 harddrive - port 2 I have setup opendebian on the memstick and after
    Message 1 of 9 , Apr 27, 2006
    • 0 Attachment
      Hi Group,

      I have 2 drives attached to the port 1 and 2 of the slug.
      memstick -> port 1
      harddrive -> port 2

      I have setup opendebian on the memstick and after everything is
      working, I attached the harddrive in port 2 and reboot. Now the
      problems comes.

      Before attaching the hdd:
      memstick -> port 1 -> /dev/sda

      After attaching the hdd and reboot:
      memstick -> port 1 -> /dev/sdb
      harddrive -> port 2 -> /dev/sda

      So how to I make it survive a reboot and still maintain this:
      memstick -> port 1 -> /dev/sda
      harddrive -> port 2 -> /dev/sdb

      I used Unslung 5.5 beta before and it didn't have this problem.

      Thanks.
    • Patrick Schneider
      Hello,mingchu schrieb: Hi Group, I have 2 drives attached to the port 1 and 2 of the slug. memstick - port 1 harddrive - port 2 I have
      Message 2 of 9 , Apr 27, 2006
      • 0 Attachment
        Hello,

        mingchu schrieb:
        > Hi Group,
        >
        > I have 2 drives attached to the port 1 and 2 of the slug.
        > memstick -> port 1
        > harddrive -> port 2
        >
        > I have setup opendebian on the memstick and after everything is
        > working, I attached the harddrive in port 2 and reboot. Now the
        > problems comes.
        >
        > Before attaching the hdd:
        > memstick -> port 1 -> /dev/sda
        >
        > After attaching the hdd and reboot:
        > memstick -> port 1 -> /dev/sdb
        > harddrive -> port 2 -> /dev/sda
        >
        > So how to I make it survive a reboot and still maintain this:
        > memstick -> port 1 -> /dev/sda
        > harddrive -> port 2 -> /dev/sdb
        >

        You should try to set volume labels on your partitions and use them in
        your /etc/fstab (see http://www.pro-linux.de/news/2003/5938.html /
        http://babelfish.altavista.com/babelfish/trurl_load?lp=de_en&url=http%3A%2F%2Fwww.pro-linux.de%2Fnews%2F2003%2F5938.html
        for an example, or use google to see how this works).

        Regards,

        Patrick





        ___________________________________________________________
        Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de
      • mingchu
        ... http://babelfish.altavista.com/babelfish/trurl_load?lp=de_en&url=http%3A%2F%2Fwww.pro-linux.de%2Fnews%2F2003%2F5938.html ... Thanks for info, Patrick. I
        Message 3 of 9 , Apr 27, 2006
        • 0 Attachment
          >
          > You should try to set volume labels on your partitions and use them in
          > your /etc/fstab (see http://www.pro-linux.de/news/2003/5938.html /
          >
          http://babelfish.altavista.com/babelfish/trurl_load?lp=de_en&url=http%3A%2F%2Fwww.pro-linux.de%2Fnews%2F2003%2F5938.html
          > for an example, or use google to see how this works).
          >

          Thanks for info, Patrick. I don't think it will serve my purpose. My
          problem is that the drives will be automatically detected as sda or
          sdb depending on the sequence of the detection. And it probably takes
          less time to find the hdd then finding the flash.

          I want to have whatever attached to port 1 always goes to /dev/sda and
          port 2 to /dev/sdb. So giving the drives a label doesn't help because
          the label will always get assigned randomly to either sda or sdb
          depends on which one is detected first at that time.

          I saw something in this group about editing linuxrc, but the
          information is very brief for linux novice like me. Can someone please
          expand on that?

          Thanks.

          -Ming
        • Gerald L. Clark
          ... Wrong. Labels do not get assigned at boot. You label the filesystem. You then mount the file system by label, not device. The filesystem always has the
          Message 4 of 9 , Apr 27, 2006
          • 0 Attachment
            mingchu wrote:
            >>
            >> You should try to set volume labels on your partitions and use them in
            >> your /etc/fstab (see http://www.pro-linux.de/news/2003/5938.html /
            >>
            > http://babelfish.altavista.com/babelfish/trurl_load?lp=de_en&url=http%3A%2F%2Fwww.pro-linux.de%2Fnews%2F2003%2F5938.html
            > <http://babelfish.altavista.com/babelfish/trurl_load?lp=de_en&url=http%3A%2F%2Fwww.pro-linux.de%2Fnews%2F2003%2F5938.html>
            >> for an example, or use google to see how this works).
            >>
            >
            > Thanks for info, Patrick. I don't think it will serve my purpose. My
            > problem is that the drives will be automatically detected as sda or
            > sdb depending on the sequence of the detection. And it probably takes
            > less time to find the hdd then finding the flash.
            >
            > I want to have whatever attached to port 1 always goes to /dev/sda and
            > port 2 to /dev/sdb. So giving the drives a label doesn't help because
            > the label will always get assigned randomly to either sda or sdb
            > depends on which one is detected first at that time.
            >
            > I saw something in this group about editing linuxrc, but the
            > information is very brief for linux novice like me. Can someone please
            > expand on that?
            >
            > Thanks.
            >
            > -Ming
            >
            Wrong.
            Labels do not get assigned at boot.
            You label the filesystem.
            You then mount the file system by label, not device.
            The filesystem always has the same label. It does not matter if it is on
            sda1 or sdb1.
          • Jonny Vassdal
            Hi. I have had a similar problem which i solved by a ugly hack. :) I made this on open slug but if it is similar it should work. Dont do this if the linuxrc
            Message 5 of 9 , Apr 28, 2006
            • 0 Attachment
              Hi.

              I have had a similar problem which i solved by a ugly hack. :) I made this on open slug but if it is similar it should work. Dont do this if the linuxrc are to different.

              First you boot the slug without any disk attached. Then you telnet/ssh into the box and see if you have a linuxrc in /. I modified mine to contain 2 extra lines and modified the line that boots the disk. Here is mine:
              ------------------------------------------------------------------------------------------------
              #!/bin/sh
              /diskchooser.sh                     
              BOOT=$(exec /bin/cat /media/ram/root.disk)
              exec '/boot/disk' '/dev/'$BOOT '-t' 'ext3' '-o' 'noatime'
              exec /boot/flash
              -------------------------------------------------------------------------------------------------

              Then i made a diskchooser.sh script in the root that i made executable by doing a chmod +x /diskchooser.sh
              it looks like this:
              -----------------------------------------------------------------------------------------------------
              #!/bin/sh
              #This is partisions that can contain root fs.
              DISKS="sda1 sdb1"
              #Create files in ram insted of in flash
              TMPDIR=/media/ram
              #temp dir i will mount rootfs on
              TMPMNT=/media/tmp

              for D in $DISKS; do
                      /bin/mount /dev/$D $TMPMNT -t ext3
                      if [ -e $TMPMNT/.rootdisk ]; then
                              /bin/echo $D > $TMPDIR/root.disk
                              /bin/cp $TMPMNT/etc/fstab.$D $TMPMNT/etc/fstab
                              /bin/umount $TMPMNT
                              exit
                      fi
                      /bin/umount $TMPMNT
              done

              /bin/echo " " > /no-usb-root-device-found
              --------------------------------------------------------------------------------------------------------

              You have to make sure the tmpmnt dir exists. This is how i made it on my openslug. On my hd i then had 2 files in /etc named fstab.sdb1 and fstab.sda1 so it copied it over fstab to make it right. hope  this can help.


              -jonny

              mingchu wrote:
              Hi Patrick,

              I tried changing the label by removing the '/' but still no luck. I
              even changed the /linuxrc script like this:
              exec '/boot/disk' 'LABEL=FLASHMAIN' '-t' 'ext3' '-o' 'noatime'

              And it just won't boot if both disks are attached before booting.

              Any advice?

              -Ming

              --- In nslu2-linux@yahoogroups.com, Patrick Schneider
              <patrick.schneider1980@...> wrote:
              >
              > Hi Ming,
              >
              >
              > mingchu schrieb:
              >
              > > Yes, you are right about the labels. However, I still cannot get it to
              > > work!
              > >
              > > $ tune2fs -L /FLASHMAIN /dev/sda1
              > > $ tune2fs -L /HDDMAIN /dev/sdb1
              > >
              > > my fstab:
              > > LABEL=/FLASHMAIN / ext3 noatime 1 1
              > > LABEL=/HDDMAIN /home ext3 defaults 1 2
              > > /dev/sda2 swap swap defaults 0 0
              > > proc /proc proc defaults 0 0
              > > usbfs /proc/bus/usb usbfs defaults 0 0
              >
              > I'm not sure, but I think you should try to use the labels without the
              > leading slash. The "/" could be interpreted as some sort of switch.
              >
              > Use e.g. FLASHMAIN instead of /FLASHMAIN as label:
              > tune2fs -L FLASHMAIN /dev/sda1
              > ...
              > LABEL=FLASHMAIN / ....
              > ....
              >
              > Regards,
              >
              > Patrick
              >
              >
              >
              >      
              >
              >      
              >            
              > ___________________________________________________________
              > Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier
              anmelden: http://mail.yahoo.de
              >




            • mingchu
              Hi Gerald, ... Yes, you are right about the labels. However, I still cannot get it to work! $ tune2fs -L /FLASHMAIN /dev/sda1 $ tune2fs -L /HDDMAIN /dev/sdb1
              Message 6 of 9 , Apr 28, 2006
              • 0 Attachment
                Hi Gerald,

                > Wrong.
                > Labels do not get assigned at boot.
                > You label the filesystem.
                > You then mount the file system by label, not device.
                > The filesystem always has the same label. It does not matter if it is on
                > sda1 or sdb1.
                >
                Yes, you are right about the labels. However, I still cannot get it to
                work!

                $ tune2fs -L /FLASHMAIN /dev/sda1
                $ tune2fs -L /HDDMAIN /dev/sdb1

                my fstab:
                LABEL=/FLASHMAIN / ext3 noatime 1 1
                LABEL=/HDDMAIN /home ext3 defaults 1 2
                /dev/sda2 swap swap defaults 0 0
                proc /proc proc defaults 0 0
                usbfs /proc/bus/usb usbfs defaults 0 0

                After reboot, I'm seeing that none of the drives are mount as only the
                default OpenDebianSlug fstab residing in flash is being used. And
                nothing in my external flash drive is loaded.

                Please help!

                -Ming
              • Patrick Schneider
                Hi Ming,mingchu schrieb:Yes, you are right about the labels. However, I still cannot get it to work! $ tune2fs -L /FLASHMAIN /dev/sda1 $
                Message 7 of 9 , Apr 28, 2006
                • 0 Attachment
                  Hi Ming,


                  mingchu schrieb:

                  > Yes, you are right about the labels. However, I still cannot get it to
                  > work!
                  >
                  > $ tune2fs -L /FLASHMAIN /dev/sda1
                  > $ tune2fs -L /HDDMAIN /dev/sdb1
                  >
                  > my fstab:
                  > LABEL=/FLASHMAIN / ext3 noatime 1 1
                  > LABEL=/HDDMAIN /home ext3 defaults 1 2
                  > /dev/sda2 swap swap defaults 0 0
                  > proc /proc proc defaults 0 0
                  > usbfs /proc/bus/usb usbfs defaults 0 0

                  I'm not sure, but I think you should try to use the labels without the
                  leading slash. The "/" could be interpreted as some sort of switch.

                  Use e.g. FLASHMAIN instead of /FLASHMAIN as label:
                  tune2fs -L FLASHMAIN /dev/sda1
                  ...
                  LABEL=FLASHMAIN / ....
                  ....

                  Regards,

                  Patrick







                  ___________________________________________________________
                  Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de
                • mingchu
                  Hi Patrick, I tried changing the label by removing the / but still no luck. I even changed the /linuxrc script like this: exec /boot/disk LABEL=FLASHMAIN
                  Message 8 of 9 , Apr 29, 2006
                  • 0 Attachment
                    Hi Patrick,

                    I tried changing the label by removing the '/' but still no luck. I
                    even changed the /linuxrc script like this:
                    exec '/boot/disk' 'LABEL=FLASHMAIN' '-t' 'ext3' '-o' 'noatime'

                    And it just won't boot if both disks are attached before booting.

                    Any advice?

                    -Ming

                    --- In nslu2-linux@yahoogroups.com, Patrick Schneider
                    <patrick.schneider1980@...> wrote:
                    >
                    > Hi Ming,
                    >
                    >
                    > mingchu schrieb:
                    >
                    > > Yes, you are right about the labels. However, I still cannot get it to
                    > > work!
                    > >
                    > > $ tune2fs -L /FLASHMAIN /dev/sda1
                    > > $ tune2fs -L /HDDMAIN /dev/sdb1
                    > >
                    > > my fstab:
                    > > LABEL=/FLASHMAIN / ext3 noatime 1 1
                    > > LABEL=/HDDMAIN /home ext3 defaults 1 2
                    > > /dev/sda2 swap swap defaults 0 0
                    > > proc /proc proc defaults 0 0
                    > > usbfs /proc/bus/usb usbfs defaults 0 0
                    >
                    > I'm not sure, but I think you should try to use the labels without the
                    > leading slash. The "/" could be interpreted as some sort of switch.
                    >
                    > Use e.g. FLASHMAIN instead of /FLASHMAIN as label:
                    > tune2fs -L FLASHMAIN /dev/sda1
                    > ...
                    > LABEL=FLASHMAIN / ....
                    > ....
                    >
                    > Regards,
                    >
                    > Patrick
                    >
                    >
                    >
                    >
                    >
                    >
                    >
                    > ___________________________________________________________
                    > Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier
                    anmelden: http://mail.yahoo.de
                    >
                  • mingchu
                    Hi Jonny, Haven t tried your hack yet. But I get this to work by changing the sda1 to sdb1 in /linuxrc. This works because my flash drive is always detected as
                    Message 9 of 9 , May 2, 2006
                    • 0 Attachment
                      Hi Jonny,

                      Haven't tried your hack yet. But I get this to work by changing the
                      sda1 to sdb1 in /linuxrc. This works because my flash drive is always
                      detected as /dev/sdb if both drives are plugged in. And it would not
                      work for any one of the following conditions:
                      1. Drives are randomly detected. In my case, the flash drive is always
                      detected after hdd, so it would be fine.
                      2. Both drives have to be plugged in at the same time before boot.
                      Otherwise, if only the flash drive is plugged in, it would be detected
                      as /dev/sda, and /linuxrc would not see it.

                      Your way is a more general solution and eliminate the above
                      conditions. Thanks.

                      For developers, is there plan to get this multiple drives problem fix?

                      Thanks.

                      -Ming

                      --- In nslu2-linux@yahoogroups.com, Jonny Vassdal <jon.vas@...> wrote:
                      >
                      > Hi.
                      >
                      > I have had a similar problem which i solved by a ugly hack. :) I made
                      > this on open slug but if it is similar it should work. Dont do this if
                      > the linuxrc are to different.
                      >
                      > First you boot the slug without any disk attached. Then you telnet/ssh
                      > into the box and see if you have a linuxrc in /. I modified mine to
                      > contain 2 extra lines and modified the line that boots the disk.
                      Here is
                      > mine:
                      >
                      ------------------------------------------------------------------------------------------------
                      > #!/bin/sh
                      > /diskchooser.sh
                      > BOOT=$(exec /bin/cat /media/ram/root.disk)
                      > exec '/boot/disk' '/dev/'$BOOT '-t' 'ext3' '-o' 'noatime'
                      > exec /boot/flash
                      >
                      -------------------------------------------------------------------------------------------------
                      >
                      > Then i made a diskchooser.sh script in the root that i made executable
                      > by doing a chmod +x /diskchooser.sh
                      > it looks like this:
                      >
                      -----------------------------------------------------------------------------------------------------
                      > #!/bin/sh
                      > #This is partisions that can contain root fs.
                      > DISKS="sda1 sdb1"
                      > #Create files in ram insted of in flash
                      > TMPDIR=/media/ram
                      > #temp dir i will mount rootfs on
                      > TMPMNT=/media/tmp
                      >
                      > for D in $DISKS; do
                      > /bin/mount /dev/$D $TMPMNT -t ext3
                      > if [ -e $TMPMNT/.rootdisk ]; then
                      > /bin/echo $D > $TMPDIR/root.disk
                      > /bin/cp $TMPMNT/etc/fstab.$D $TMPMNT/etc/fstab
                      > /bin/umount $TMPMNT
                      > exit
                      > fi
                      > /bin/umount $TMPMNT
                      > done
                      >
                      > /bin/echo " " > /no-usb-root-device-found
                      >
                      --------------------------------------------------------------------------------------------------------
                      >
                      > You have to make sure the tmpmnt dir exists. This is how i made it
                      on my
                      > openslug. On my hd i then had 2 files in /etc named fstab.sdb1 and
                      > fstab.sda1 so it copied it over fstab to make it right. hope this can
                      > help.
                      >
                      >
                      > -jonny
                      >
                      > mingchu wrote:
                      >
                      > > Hi Patrick,
                      > >
                      > > I tried changing the label by removing the '/' but still no luck. I
                      > > even changed the /linuxrc script like this:
                      > > exec '/boot/disk' 'LABEL=FLASHMAIN' '-t' 'ext3' '-o' 'noatime'
                      > >
                      > > And it just won't boot if both disks are attached before booting.
                      > >
                      > > Any advice?
                      > >
                      > > -Ming
                      > >
                      > > --- In nslu2-linux@yahoogroups.com, Patrick Schneider
                      > > <patrick.schneider1980@> wrote:
                      > > >
                      > > > Hi Ming,
                      > > >
                      > > >
                      > > > mingchu schrieb:
                      > > >
                      > > > > Yes, you are right about the labels. However, I still cannot
                      get it to
                      > > > > work!
                      > > > >
                      > > > > $ tune2fs -L /FLASHMAIN /dev/sda1
                      > > > > $ tune2fs -L /HDDMAIN /dev/sdb1
                      > > > >
                      > > > > my fstab:
                      > > > > LABEL=/FLASHMAIN / ext3 noatime 1 1
                      > > > > LABEL=/HDDMAIN /home ext3 defaults 1 2
                      > > > > /dev/sda2 swap swap defaults 0 0
                      > > > > proc /proc proc defaults 0 0
                      > > > > usbfs /proc/bus/usb usbfs defaults 0 0
                      > > >
                      > > > I'm not sure, but I think you should try to use the labels
                      without the
                      > > > leading slash. The "/" could be interpreted as some sort of switch.
                      > > >
                      > > > Use e.g. FLASHMAIN instead of /FLASHMAIN as label:
                      > > > tune2fs -L FLASHMAIN /dev/sda1
                      > > > ...
                      > > > LABEL=FLASHMAIN / ....
                      > > > ....
                      > > >
                      > > > Regards,
                      > > >
                      > > > Patrick
                      > > >
                      > > >
                      > > >
                      > > >
                      > > >
                      > > >
                      > > >
                      > > > ___________________________________________________________
                      > > > Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier
                      > > anmelden: http://mail.yahoo.de
                      > > >
                      > >
                      > >
                      > >
                      > >
                      > >
                      > > SPONSORED LINKS
                      > > Communication and networking
                      > >
                      <http://groups.yahoo.com/gads?t=ms&k=Communication+and+networking&w1=Communication+and+networking&w2=Wireless+communication+and+networking&w3=Linksys+nslu2&c=3&s=96&.sig=ncJ7zHuN94kilWuTSDl3Vw>

                      > > Wireless communication and networking
                      > >
                      <http://groups.yahoo.com/gads?t=ms&k=Wireless+communication+and+networking&w1=Communication+and+networking&w2=Wireless+communication+and+networking&w3=Linksys+nslu2&c=3&s=96&.sig=-1Cy7rgDdkUo3T3bGhOAAw>

                      > > Linksys nslu2
                      > >
                      <http://groups.yahoo.com/gads?t=ms&k=Linksys+nslu2&w1=Communication+and+networking&w2=Wireless+communication+and+networking&w3=Linksys+nslu2&c=3&s=96&.sig=j3mKdhnq2Dp0IwkO41UTZg>

                      > >
                      > >
                      > >
                      > >
                      ------------------------------------------------------------------------
                      > > YAHOO! GROUPS LINKS
                      > >
                      > > * Visit your group "nslu2-linux
                      > > <http://groups.yahoo.com/group/nslu2-linux>" on the web.
                      > >
                      > > * To unsubscribe from this group, send an email to:
                      > > nslu2-linux-unsubscribe@yahoogroups.com
                      > >
                      <mailto:nslu2-linux-unsubscribe@yahoogroups.com?subject=Unsubscribe>
                      > >
                      > > * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
                      > > Service <http://docs.yahoo.com/info/terms/>.
                      > >
                      > >
                      > >
                      ------------------------------------------------------------------------
                      > >
                      >
                    Your message has been successfully submitted and would be delivered to recipients shortly.