This is the old SliTaz forum - Please use the main forum.slitaz.org

Want to mount at boot
  • molmol August 2010
    Hi

    I would like to mount an usb key (sdb1 formated in ext3) at boot

    So i've write this in /etc/init.d/local.sh

    mount -t ext3 /dev/sdb1 /media/flash

    ... but doesn't work .... :( ... despite that, once Slitaz is running, I can write the same command
    in xterm and it works !

    So why I can't do it at boot time ?

    In boot log, I have this message


    Starting local startup commands...
    mount: mounting /dev/sdb1 on /media/flash failed: No such device or address


    Please help

  • mojomojo August 2010
    Perhaps /etc/init.d/local.sh is executing the mount command before the kernel recognizes the usb device.Try mounting by UUID in case the device name is wrong. Find the UUID with the blkid command, mount UUID= instead of /dev/sdb1.Verify the UUID is correct in terminal with a manual mount if you have problem. If this fails then use /etc/fstab with UUID.
  • molmol August 2010
    Thx 4 answering

    First, you should know that I lauch the command from a .sh which is launched by the config= option in menu.lst from Grub ..

    So in that script I've just put this :

    ------------------------------

    cd /etc/init.d

    cat >> local.sh << "EOF"<br />
    mount /dev/disk/by-uuid/4356388c3-954f-4aa7-9365-ef7e03c5421u /media/usbdisk

    --------------------------------

    This script adds the line in the file
    But it doesn't works at boot, but (as before) it works manualy after boot

    ++++++++++++++++++++++++++++++++++++++++++++

    So, as u suggest, I've rather write in fstab with this script

    --------------------------------

    cd /etc

    cat >> fstab << "EOF"<br />
    UUID=4356388c3-954f-4aa7-9365-ef7e03c5421u /media/usbdisk ext3 defaults 0 0

    ------------------------------

    After boot, my usb hasn't been mounted. But when I manuely click on it (inside the folder browser) , the usb is mounted on "usbdisk" ... so that's a good thing.

    But how can have it automatically mounted ? I need it as I use my usb to store programs (thanks to "tazpkg link)


    THX


  • kultexkultex August 2010
    the file to mount devices was and is fstab .... so google and you will find the answer ....
  • TotoetsasoeurTotoetsasoeur August 2010
    A great link about fstab:
    http://www.tuxfiles.org/linuxhelp/fstab.html

    Cheers
    Stephane
  • molmol August 2010
    But that's what I've done ..

    I effectively add this in fstab

    UUID=236388c3-954f-4ba7-9365-ef7e03c6988e /media/usbdisk ext3 defaults 0 0

    But the device is not mounted after boot. But when I click on it manually
    with PcManFm, the device is mounted on /media/usbdisk
    (and not on /media/disk as it is by default) .

    I've add this in /etc/init.d/local.sh

    mount -t ext3 /dev/disk/by-uuid/236388c3-954f-4ba7-9365-ef7e03c6988e /media/usbdisk

    But it change nothing ...

    So the first command seems to allocate a mount point but the second command
    doesn't mount it automatically

    ---------

    For internal harddrives, the last command is suffisent and works, but
    for SDcard and USB , it doesn't work and I've tested it on 2 PC


    @ Toto, I've read that page. But I think that I've put the right option
    "defaults"
  • TotoetsasoeurTotoetsasoeur August 2010
    Just an idea. Maybe the system needs time before the usb device is recognized. It may explain why it works in manual but not in auto.

    To find out, try to add the following to kernel option line in your /boot/grub/menu.lst:
    rootdelay=10

    Hope this helps.
    Stephane
  • molmol August 2010
    Hi Stephane,

    I though about it , I've tested it ..... but no ..

    Also, I've try/put this command in local.sh

    mount -a

    But, as before, it works only if I do it manually after boot in a terminal
    (the device is mounted in the right place)

    As usual, I've got this message in the Boot LOG


    Starting local startup commands...
    mounting UUID=236388c3-954f-4ba7-9365-ef7e03c6988e on /media /usbdisk failed: No such file or directory
    Starting all daemons specified in /etc/rcS.conf...

    (So it show that local.sh is effectively executed)

    I will search for a way to execute the mount later in the boot chronology.

  • molmol August 2010
    Okééééé

    The solution is to mount it later in boot time.

    So, simply adding the command :

    mount -t ext3 /dev/disk/by-uuid/236.. the UUID of your device.... 3c6988e /media/usbdisk

    at the end of /etc/init.d/rcS file is the solution .

    I don't know if is at suitable solution , but it works.



    Beside this, The advantage to specify the mount point in fstab , apparently, is that the device will be always related to that one. So, If you unmount it , and then re-mount it , it still be associated with the mount point specified in fstab (and not /media/disk by default) . Another advantage to specify in fstab, is that you can precise the mount options (like read-only)


    cya

  • molmol August 2010
    Bad news,

    If another usb is plugged , your usb won't be mounted ...
    And you will have the message in PcManFm

    Erreur org.freedesktop.Hal.Device.Volume.UnknownFailure

    So, not completely ok..
  • molmol August 2010
    Last report,

    Actually, if you want have your usb automatically mounted, you have to avoid to plug another usb (even a mouse) or try to launch a package on it, both before open pcmanfm or acces the usb's folders with Xterm.

    .... :(

    Slitaz should have a kind of gui box to manage automatic mount .

    Is anybody wanting to share some feedback of their experience ?
  • XavierJXavierJ August 2010
    Maybe you could write a udev rule.
    This way you can specify a particular device name to your usb key. It also alows you to execute a script whenever the usb key is plugged.

    How to write udev rules : http://www.reactivated.net/writing_udev_rules.html#syntax
  • KrupptusKrupptus August 2010
    In /etc/init.d/local.sh

    Add this line to the script file? (note busybox sleep cmd)
    Change sleep option/variable accordingly, depending on how long you need before kernel actually activates usb devices?

    /bin/busybox sleep 10;
    mount -t ext3 /dev/sdb1 /media/flash

    In response to original OP question

    Kruppt

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

SliTaz Social