Page 1 of 2 12 LastLast
Results 1 to 15 of 28

Thread: disable auto-mounting on boot time

  1. #1

    disable auto-mounting on boot time

    Hi, i am following this http://wl500g.info/showthread.php?t=10307 tutorial to install and configure olegs firmware.

    i get to 4b - Startup-scripts

    at this point a get a problem - the partitions didnt mount correctly at the startup

    i figured out,that somehow the partitons are mounted automaticaly , under /tmp/harddisk/..., first partition at /tmp/harddisk, second partiton at /tmp/harddisk/part1, ... etc

    i want to disable this and mount the partitons manualy in post-boot script, but i dont know how to achieve that.

    thx for any suggestion or help!

  2. #2
    Join Date
    Jul 2007
    Location
    Austria
    Posts
    1,336
    There are 2 ways how to get a storage mounted to a specified folder/directory:

    1.) write in your post-boot:

    mount /dev/discs/disc0/part1 /tmp/harddisk/somewhere

    (provided somewhere exist!)
    ....where disc0 is your first hdd or stick and part1 up to partx are the
    partitions.
    But you have to read tutorial to understand what you need to get a
    running system:
    http://wl500g.info/showthread.php?t=10307 (read 4b)
    2.) create file fstab, provided you use olegs 8 (newest fw)
    (If you wanna use fstab and don't know how, let me know)

  3. #3

    swap ist aout mounted as /tmp/harddrive

    i am stuck at exactly the same point as nameless_one!

    i used wl-hdd for a year and everything was ok, the tutorial was a great help to me. but now i changed to wl-500gp and the show is over for me at point 4b of tutorial

    --
    mount
    /dev/root on / type squashfs (ro)
    none on /dev type devfs (rw)
    proc on /proc type proc (rw)
    ramfs on /tmp type ramfs (rw)
    usbfs on /proc/bus/usb type usbfs (rw)
    /dev/discs/disc0/part2 on /opt type ext3 (rw)
    /dev/discs/disc0/part1 on /tmp/harddisk type vfat (ro,noatime)
    --

    but fdisk says:

    --
    fdisk -l

    Disk /dev/scsi/host0/bus0/target0/lun0/disc: 40.0 GB, 40007761920 bytes
    255 heads, 63 sectors/track, 4864 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot Start End Blocks Id System
    /dev/scsi/host0/bus0/target0/lun0/part1 1 63 506016 82 Linux swap
    /dev/scsi/host0/bus0/target0/lun0/part2 64 313 2008125 83 Linux
    /dev/scsi/host0/bus0/target0/lun0/part3 314 4864 36555907+ 83 Linux
    --

    system lof says something like:

    --
    Jan 1 01:00:08 kernel: USB Mass Storage support registered.
    Jan 1 01:00:13 kernel: kjournald starting. Commit interval 5 seconds
    Jan 1 01:00:13 kernel: EXT3 FS 2.4-0.9.19, 19 August 2002 on sd(8,2), internal journal
    Jan 1 01:00:13 kernel: EXT3-fs: recovery complete.
    Jan 1 01:00:13 kernel: EXT3-fs: mounted filesystem with ordered data mode.
    Jan 1 01:00:14 kernel: Adding Swap: 506008k swap-space (priority -1)
    Jan 1 01:00:17 kernel: VFS: Can't find ext3 filesystem on dev sd(8,0).
    Jan 1 01:00:17 kernel: MSDOS FS: Using codepage 950
    Jan 1 01:00:17 kernel: MSDOS FS: IO charset cp950
    Jan 1 01:00:17 kernel: FAT: bogus logical sector size 19781
    Jan 1 01:00:17 kernel: VFS: Can't find a valid FAT filesystem on dev 08:00.
    Jan 1 01:00:17 kernel: FAT: freeing iocharset=cp950
    Jan 1 01:00:17 kernel: FAT: bogus logical sector size 19781
    Jan 1 01:00:17 kernel: VFS: Can't find a valid FAT filesystem on dev 08:00.
    Jan 1 01:00:17 kernel: VFS: Can't find ext3 filesystem on dev sd(8,1).
    Jan 1 01:00:17 kernel: MSDOS FS: Using codepage 950
    Jan 1 01:00:17 kernel: MSDOS FS: IO charset cp950
    Jan 1 01:00:17 kernel: Directory 1: bad FAT
    Jan 1 01:00:17 kernel: attempt to access beyond end of device
    --


    as i am drunk now i think its no good trying anymore, maaybe later someone solves this damn problem. this seams to be common to many people ,hum?
    could it be a bug in WL500gp-1.9.2.7-8 fw while trying to get a external hdd connected?

    and once again from me:
    wengi you did a great job and also thanks to all the others spending all the hours trying and trying and trying...

  4. #4
    Join Date
    Jul 2007
    Location
    Austria
    Posts
    1,336
    I never experienced a problem regarding partitions - the only difference was, that I created all partitions on my pc. I've used paragons partition manager.

  5. #5
    Join Date
    Feb 2007
    Location
    Moscow, Russia
    Posts
    3,805
    I suggest the following:
    1) are you sure that you executed
    PHP Code:
    mkswap /dev/discs/disc0/part1 
    2) if no then dismount this fake partition and do it; if yes then goto 3)
    3) best of all create file /etc/fstab

    PHP Code:
    cat > /etc/fstab ___eof
    /dev/discs/disc0/part1  swap       swap
    /dev/discs/disc0/part2  /opt       ext3    noatime,nodiratime      1 1
    /dev/discs/disc0/part3  /home      ext3    noatime,nodiratime      1 2
    ___eof

    echo "/etc/fstab" >> /usr/local/.files

    flashfs save 
    && ... 
    If you don't have fstab you have to execute swapon /dev/discs/disc0/part1 on every boot

  6. #6
    Join Date
    Jul 2007
    Location
    Austria
    Posts
    1,336
    well, you have to mount with the -a option.

    Just to allow you to adjust my fstab and post-boot to your needs, I've attached the two files.
    Attached Files Attached Files

  7. #7
    Join Date
    Feb 2007
    Location
    Moscow, Russia
    Posts
    3,805
    When using fstab, mount -a and swapon -a are not really needed, as they are executed automatically

    The nice thing is that even if you attach some storage later which has correct record in fstab it is automounted in the right place.

  8. #8
    Join Date
    Jul 2007
    Location
    Austria
    Posts
    1,336
    Quote Originally Posted by al37919 View Post
    When using fstab, mount -a and swapon -a are not really needed, as they are executed automatically

    The nice thing is that even if you attach some storage later which has correct record in fstab it is automounted in the right place.
    Sounds pretty good, but I got no device mounted without mount -a
    Anyhow, I'll try your fstab (adjusted to my network).

    Further, I've to mount sometimes up to 5 (and more) Sticks and hdds.
    My Problem is, that I do not know at boot-time which stick has which /dev/discs/.... entry.
    Or is there a solution I do not know?
    For instance: Sales people have stored their orders on sticks (>20pce).
    I have to store their database to specific folders like:
    /tmp/harddisk/huber_gerhard
    If I would be able to store it automatically, it would be a great help!
    I know, with some scripting I can read a file on the sticks and......anyhow, I'll do it when I've more time, because you know , Asus routers are a hobby and need plenty of time.

  9. #9
    Join Date
    Feb 2007
    Location
    Moscow, Russia
    Posts
    3,805
    At least for the very late fw (preview 1.9.2.7-8.7) mount -a is not needed. I can't say for sure about 1.9.2.7-7g/8, because I started to use fstab only very recently after upgrade of hdd.

    Or is there a solution I do not know?
    Unfortunately by now --- no

  10. #10
    Join Date
    Jul 2007
    Location
    Austria
    Posts
    1,336
    Well, thanks for your hint - I had a closer look at my fstab and found a fault.
    (Just a "#" at the beginning was missing)
    The funny thing is that a mount -a in my post-boot worked well.
    But now I got an other fault, do you have any ideas?

    [admin@Asus root]$ mount
    /dev/root on / type squashfs (ro)
    none on /dev type devfs (rw)
    proc on /proc type proc (rw)
    ramfs on /tmp type ramfs (rw)
    usbfs on /proc/bus/usb type usbfs (rw)
    /dev/discs/disc0/part1 on /opt type ext3 (rw)
    /dev/discs/disc0/part3 on /tmp/harddisk type ext3 (rw)

    This is ok, but when I try to unmount:

    [admin@Asus root]$ umount /tmp/harddisk
    umount: Couldn't umount /tmp/harddisk: Invalid argument
    [admin@Asus root]$ umount /dev/discs/disc0/part3
    umount: Couldn't umount /dev/scsi/host0/bus0/target0/lun0/part3: Invalid argument
    [admin@Asus root]$

    Is there no way to umount all like umount -a? (mtab file)
    Many thanks!

  11. #11
    I had the same problem.

    At first my usb-drive would not be mounted, so I added in my post-boot:

    insmod scsi_mod
    insmod sd_mod
    instmod usb-storage

    After that my usb-drive mounted, but...

    I have two partitions on my usb drive (swap first). It always mounted my swap on /tmp/harddisk, but when I "cleaned" my drive with dd it started to mount my second partition on /tmp/harddisk. So now I first mount my second partition to opt and then umount /tmp/harddisk (and ofcourse activate swap).

    Well, it kind of works now with the mount and umount of /tmp/harddisk. I haven't tried with fstab, but my problem is that I have to manually load the modules above (with post-boot).

  12. #12
    Join Date
    Jul 2007
    Location
    Austria
    Posts
    1,336
    Ok, but everybody is loading the modules like here:
    http://wl500g.info/showpost.php?p=76131&postcount=6
    (Have a closer look at post-boot.txt)

    My prob is the umount after a proper mount of partitions.

  13. #13
    I tried with fstab and it worked, but I have to use swapon -a and mount -a in post-boot, but I no longer need to umount /tmp/harddisk

  14. #14
    Join Date
    Jul 2007
    Location
    Austria
    Posts
    1,336
    Ok, now you got the same as I had - maybe it's a copy fault.
    Just look at the beginning of your fstab file:
    If you have taken my fstab, then insert a "#" in the first description line, right before device
    Then you can remove swap and mount -a in post-boot.

  15. #15
    Join Date
    Feb 2007
    Location
    Moscow, Russia
    Posts
    3,805
    umount was always problem when some services were already started which might use this partition.

    However there is another option to do: instead of unmounting perform remounting in read only mode. When done so you can safely disconnect hdd or turn off power. To remount all ext3 partitions based on fstab you can use e.g.:

    PHP Code:
    for i in `awk '/ext3/{print($1)}' /etc/fstab`
    do
      
    mount -o remount,ro $i
    done 
    You can have a look on this topic which was discussed recently: http://wl500g.info/showthread.php?t=12221 Despite it is in Russian, still the pieces of the code should be more or less self-explanatory. However, it is describing the situation in the latest preview (version >8), because pre-mount file was introduced only there.

    The key finding is that it is strongly recommended to make such remounting into ro-state of all filesystems in pre-shutdown file, as asus itself apparently makes no effort of doing that. So, actually halt or reboot commands have the same effect as taking off power.

    To perform routine e2fsck check of all fs on booting is another good idea, and one more suggestion was done about updating of the rc.unslung file so that it can accept start|stop parameter and be also used in pre-shutdown to exit some daemons gracefully.

    In overall with these late changes the pre&post files have been largely simplified and obtained more clear meaning.

    lutkebab:
    use fstab it should solve the problem with wrongly mounted swap
    but my problem is that I have to manually load the modules above (with post-boot).
    in the next version of the fw there will be a checkbox in web-IF which enables automatic loading of these modules
    Last edited by al37919; 06-01-2008 at 14:11.

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 2
    Last Post: 27-04-2010, 09:47
  2. Exclusive AUTO INSURANCE! - Best Choice!
    By ireneaveline in forum German Discussion - Deutsch (DE)
    Replies: 0
    Last Post: 06-09-2007, 04:10
  3. WL-500gP with a WD my book pro II 1TB I/O errors
    By golem in forum WL-500gP Q&A
    Replies: 1
    Last Post: 14-06-2007, 21:14
  4. Firewall dies
    By confused in forum WL-500g Q&A
    Replies: 0
    Last Post: 04-11-2006, 18:09

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •