LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to mount usb thumb drive (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-mount-usb-thumb-drive-691591/)

KHOO YIH CHYUAN 12-18-2008 08:45 PM

how to mount usb thumb drive
 
hi all,
what command should type for mounting a usb thumb drive. please help me to solve this problem. Thank you.

saagar 12-18-2008 09:34 PM

In Red Hat Linux:

1.When we plug in the usb drive, automatically it will be mounted and u can see the USB symbol and manufacturer name of the thumb drive in the Desktop or when we click the "computer" icon. From there we can access the USB drive.
2.Else, we can manually mount it from the command line:
a.[ ]#mount /dev/sda1 /mnt
Note: (thumb drive is detected as a SCSI (sda) subsytem in Red Hat Linux)
[ ]#cd /mnt
[ ]# ls



Hope this helps.

jschiwal 12-18-2008 09:37 PM

Which distro are you using? Please put it in your user profile. If you are using SuSE linux, you can use the "halmount" command to automount the device in the /media directory.

If you don't know the device used, you can use "halmount --udi" to list each device and the devices udi. If the pendrive has a label, "halmount <label>" will work as well.

You can also use the mount command. See the "man mount" manpage.
Here is how an sd card is mounted on my desktop:
/dev/sdf1 on /media/disk type vfat (rw,nosuid,nodev,noatime,flush,uid=1000,utf8,shortname=lower)

I could have manually mounted it for example:
sudo mkdir /mnt/disk
sudo mount -t vfat /dev/sdf1 /mnt/disk -o rw,nosuid,nodev,noatime,flush,uid=jschiwal,utf8,shortname=lower

The uid option is needed for a fat32 formatted pendrive to change the ownership. This gives me permission to read and write to the drive. The "nosuid,nodev" options are standard for non linux filesystems or globally writable partition. They can prevent accidentally running malware that someone put on the pendrive.
The noatime option extends the life of the device. Pen drives have a limited number of write cycles. So you don't want the access times updated after reading a file. ( plus fat32 doesn't support access times anyway )

Notice the advantage of the halmount command. I didn't need to be root to mount the device.

Are you running a very old distro, or a minimal desktop environment. Using KDE or Gnome on a recent distro, the drive should be automounted.


All times are GMT -5. The time now is 12:06 PM.