Find the answer to your Linux question:
Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 27
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2006
    Location
    London Uk
    Posts
    93

    how to mount an usb drive


    we know that the linux automatically detects the usb drive and mounts to a known directory. but it actually mounts only when we open one of the folders in the usb drive using the file manager.

    so, if i directly wanted to access from command prompt, i am not able to do it. so i want to know, how to mount an usb drive? normally mounting involes specifying something like /dev/hda, etc., i do not know what should i put for usb drive?

    any clues..

  2. #2
    Just Joined!
    Join Date
    Aug 2006
    Location
    Germany
    Posts
    26
    Hi!

    If you don't use autofs or something like that, the usb drive is only mounted if the /etc/fstab says so (auto flag).

    Your usb drive should be /dev/sd* depending on the used usb port. Just grep your dmesg!

    Regards.

  3. #3
    Banned jan1024188's Avatar
    Join Date
    Jul 2006
    Location
    EU, SLOVENIA
    Posts
    1,549
    hi
    check this link
    http://www.thelinuxpimp.com/main/mod...rticle&sid=561
    it will realy help you(i hope)

  4. $spacer_open
    $spacer_close
  5. #4
    Banned jan1024188's Avatar
    Join Date
    Jul 2006
    Location
    EU, SLOVENIA
    Posts
    1,549
    or just open a terminal and type
    Code:
    mkdir /mnt/usbdrive
    Code:
    gedit /etc/fstab
    and add this line
    Code:
    /dev/sda1 /mnt/usbdrive auto user,noauto 0 0
    leave empty the end line
    save and reboot
    your HDD should be mounted in /mnt

  6. #5
    Just Joined!
    Join Date
    Aug 2006
    Location
    London Uk
    Posts
    93
    from /proc/partitions i came to know that it is scsi and referred as /dev/sda1.
    so a mount command like this works
    Code:
    mount /dev/sda1 /mnt/usb
    but after a line to /etc/fstab
    Code:
    /dev/sda1 /mnt/usb auto user,noauto 0 0
    when i insert the usb drive, it opens up a new window asking either to open or configure...

    when i click on open in a new window, it tries to open, "system:/media/sda1" and says, 'Permissions denied'. anyway i am still logged in as root.

    why is this error happening and it does not get mounted as well..

    anybody tell what is "auto user,noauto 0 0" in /etc/fstab's last line

  7. #6
    Banned jan1024188's Avatar
    Join Date
    Jul 2006
    Location
    EU, SLOVENIA
    Posts
    1,549
    hi raghavan20
    after editing fstab you have saved the file and than rebooted.
    Connect usb drive, turn on a computer ,boot into linux and open /mnt/usb
    All files from usb drive will be there
    you can also make a shortcut (symlink) on your desktop with this command
    Code:
    ln -sf /mnt/usb ~/Desktop/usb

  8. #7
    Banned jan1024188's Avatar
    Join Date
    Jul 2006
    Location
    EU, SLOVENIA
    Posts
    1,549
    auto = all types of parition (auto detect)
    user =for all users
    0 0 are permissions

    if im wrong please correct me

    what is the filesystem type of usb drive?(ext3,ext2,FAT,NTFS are filesystem types)

  9. #8
    Just Joined!
    Join Date
    Aug 2006
    Location
    London Uk
    Posts
    93
    jan is used mount -a after saving the new /etc/fstab file so I think we do not have to restart the system.

    the usb file type is FAT 16.

    I have one more line in /etc/fstab file.
    Code:
    /dev/hda6 /mnt/windows/windows_e ntfs ro,defaults,umask=0 0 0
    i think now we now use ntfs instead of auto
    what is ro,defaults?
    i understand this umask would be the default for all new files created in this partition...hopefully i am right?

  10. #9
    Banned jan1024188's Avatar
    Join Date
    Jul 2006
    Location
    EU, SLOVENIA
    Posts
    1,549
    wait a second ..leave that line
    Code:
    /dev/hda6 /mnt/windows/windows_e ntfs ro,defaults,umask=0 0 0
    dont change it...is correct
    thats the windows partition on your hda

  11. #10
    Banned jan1024188's Avatar
    Join Date
    Jul 2006
    Location
    EU, SLOVENIA
    Posts
    1,549
    after editing fstab you have to reboot...always
    if you dont, nothing changes

Posting Permissions

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