how to automount partion as /opt ?

Discussion in 'Tomato Firmware' started by maurer, Jan 22, 2010.

  1. maurer

    maurer Network Guru Member

    I'm using TB mod for RT-N16 with an attached usb 160 GB HDD.
    I want to have some script that is auto-mounting my /dev/sda2 partition as /opt.
    I found some post and added in the webgui init script as:
    "sleep 3
    mount /dev/sda2 /opt"
    but is no working...

    pls help
  2. michse

    michse Addicted to LI Member


    the mount command only works in linux, if you have the detailed mount options in /etc/fstab. If not IMHO you have to write out the whole mount command.
    Are you shure, sda is the correct dev-name?
  3. maurer

    maurer Network Guru Member

    yes, it is the correct name - below is the output of the command fdisk -l

    root@unknown:/tmp/home/root# fdisk -l

    Disk /dev/sda: 160.0 GB, 160041885696 bytes
    255 heads, 63 sectors/track, 19457 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot Start End Blocks Id System
    /dev/sda1 1 80 642568+ 83 Linux
    /dev/sda2 81 19457 155645752+ 83 Linux
  4. michse

    michse Addicted to LI Member

    Mh, try
    mkdir /tmp/mnt
    mount -t auto /dev/sda2 /tmp/mnt

  5. greenythebeast

    greenythebeast LI Guru Member

    I'm using the same mod that you are using and my script is as follows:

    sleep 3
    mount /dev/discs/disc0/part1 /opt
    sleep 1
    swapon /dev/discs/disc0/part2

    Perhaps you should try something like that?

    Try the command df to get the proper disc and part #
  6. n3IVI0

    n3IVI0 Addicted to LI Member

    Here's what teddy_bear recommends, and it works very well:

    Make sure the label on your opt partition is "optware", or something similar (you'll need to change the LABEL part accordingly). Then enter each line from the CLI and hit enter after each, and voila! Your opt partition will automount as /opt.
  7. hapahopi

    hapahopi LI Guru Member

    when i tried the first command it's saying that /etc/fstab as read only???
  8. n3IVI0

    n3IVI0 Addicted to LI Member

    If your partition is ext3, try changing that in the first line. I forgot to mention that...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice