Find the answer to your Linux question:
Results 1 to 6 of 6
Hi there, I am currently running a Knoppmyth system and am having a slight problem automounting a USB harddrive. I have ammendned the fstab file with a line which supposedly ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2007
    Posts
    1

    How do i automount a USB Harddrive


    Hi there,

    I am currently running a Knoppmyth system and am having a slight problem automounting a USB harddrive. I have ammendned the fstab file with a line which supposedly automounts the external drive. However what i want to happen is for me to be able to browse the drive without first having to type 'mount -a' or without first having to double click on the harddrive in Konqueror. My reason for this is that unless i do either of these options MythTv wont find the files on the device.

    Where might i go about adding the 'mount -a' command to sort out my problem?

    Many thanks

    Rob

  2. #2
    Linux Newbie
    Join Date
    May 2006
    Location
    Kansas
    Posts
    187
    I found this from another site a while back:

    New user often gets confused with Linux security permissions. Simple mounting of a USB flash drive as a normal user (non-root) can be hard task.

    Truth:
    The mount command can be issued only as the root user.

    Solution:
    Give permission to normal user to mount a USB pen or flash drive.

    #1: Create a directory
    Code:
      mkdir /mnt/usbdrv
    #2: Find out USB drive name

    Code:
      fdisk –l
    Output of fdisk -l command:
    Disk /dev/hdb: 80.0 GB, 80060424192 bytes
    255 heads, 63 sectors/track, 9733 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot Start End Blocks Id System
    /dev/hdb1 * 1 2432 19535008+ 83 Linux
    /dev/hdb2 2433 2554 979965 82 Linux swap / Solaris
    /dev/hdb3 2555 6202 29302560 83 Linux
    /dev/hdb4 6203 9733 28362757+ 5 Extended
    /dev/hdb5 6203 9733 28362726 83 Linux

    Disk /dev/sda: 256 MB, 256901120 bytes
    8 heads, 62 sectors/track, 1011 cylinders
    Units = cylinders of 496 * 512 = 253952 bytes

    Device Boot Start End Blocks Id System
    /dev/sda1 1 1011 250697 b W95 FAT32
    In the above output, /dev/sda1 is my flash drive.

    #3: Open /etc/fstab file
    Append following line:
    Code:
    /dev/sda1      /mnt/usbdrv      auto    noauto,user,rw,exec 0 0

    #4: Save the file and login as the normal user:
    Code:
    mount /mnt/usbdrv
    Last edited by devils casper; 05-07-2007 at 07:21 PM. Reason: added 'code' tags.

  3. #3
    Linux User IsaacKuo's Avatar
    Join Date
    Feb 2005
    Location
    Baton Rouge, LA, USA
    Posts
    385
    Quote Originally Posted by rflook View Post
    I am currently running a Knoppmyth system and am having a slight problem automounting a USB harddrive. I have ammendned the fstab file with a line which supposedly automounts the external drive.
    Could you post your /etc/fstab file?

    Is there a line which looks something like this?

    Code:
    /dev/sda1      /mnt/usbdrv      auto    noauto,user,rw,exec 0 0
    If so, then the USB harddrive will NOT automatically mount. The "auto" in the above only means that the file system type will be detected automatically. The "noauto" in the options list means the harddrive will NOT be automatically mounted on boot-up.

    You want to change the "noauto" in the options list into "auto" in order to have the drive mount automatically.

    (Note, the above advice assumes that you want the exact opposite of what you seem to want. I'm assuming you want the drive to automatically mount on boot-up with no manual intervention. The other guy seems to think you want it to NOT boot up except by manually entering the mount command.)
    Isaac Kuo, ICQ 29055726 or Yahoo mechdan

  4. #4
    Linux Newbie
    Join Date
    May 2006
    Location
    Kansas
    Posts
    187
    IsaacKuo, thanks for pointing that out auto/noauto. I just updated my personal documentation.

  5. #5
    Just Joined!
    Join Date
    May 2005
    Posts
    3

    problem with usb detection

    HI

    I have installed Knoppix 5.1 (knx2hd) on my compaq evo n160 laptop. when i insert a usb drive i can see it via usbview but on doing fdisk -l i donot see any device for that.
    How can i mount the usb device.

    Thanks

  6. #6
    Linux Newbie
    Join Date
    May 2006
    Location
    Kansas
    Posts
    187
    Try this:

    # mkdir /usbdrive
    # mount -t auto /dev/sda1 /usbdrive

    You can unmount it with

    # umount /usbdrive

Posting Permissions

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