LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   mount usb hard drive (https://www.linuxquestions.org/questions/debian-26/mount-usb-hard-drive-423159/)

ckamheng 03-09-2006 09:15 AM

mount usb hard drive
 
1) what is the command to mount usb hard drive manually?
2) Can i auto mount a usb hard drive? that means whenever i plug in the usb hard drive, it will automatic mount the drive and unmount once it is unplug?

thanks.

dracae 03-09-2006 10:03 AM

Assuming it is formatted with fat(vfat) and it is the only sata/scsi/usb drive connected(sda).
mount -t vfat /dev/sda1 /mnt

If you use gnome, install pmount and gnome-volume-manager to have it mounted automatically.

Also, the sync option does not work correctly with vfat so you should always unmount it before disconnecting it.

ckamheng 03-09-2006 07:42 PM

Quote:

Originally Posted by dracae
Assuming it is formatted with fat(vfat) and it is the only sata/scsi/usb drive connected(sda).
mount -t vfat /dev/sda1 /mnt

If you use gnome, install pmount and gnome-volume-manager to have it mounted automatically.

Also, the sync option does not work correctly with vfat so you should always unmount it before disconnecting it.

i do not have X windows/gnome/kde install. any idea to make it auto mount/unmount?

dracae 03-09-2006 09:14 PM

autofs? hotplug script?

lavluda 03-09-2006 11:05 PM

Quote:

Originally Posted by ckamheng
1) what is the command to mount usb hard drive manually?
2) Can i auto mount a usb hard drive? that means whenever i plug in the usb hard drive, it will automatic mount the drive and unmount once it is unplug?

thanks.

Before the boot you please plug in the usb hdd device.
And then check the output of "fdisk -l"

cferron 03-15-2006 10:21 PM

Quote:

Originally Posted by dracae
Assuming it is formatted with fat(vfat) and it is the only sata/scsi/usb drive connected(sda).

If a SATA drive is present and it is normally assigned /dev/sda would this new connected USB drive automatically go under /dev/sdb?

Thanks

Claude

farslayer 03-16-2006 10:13 AM

tail -f /var/log/messages now plug in the USB drive and watch the scrolling messages to see what device was assigned to the drive..

Quote:

itg-debian:/etc/network# tail -f /var/log/messages

Mar 16 11:09:46 localhost kernel: usb 2-2: new full speed USB device using address 7
Mar 16 11:09:46 localhost kernel: scsi3 : SCSI emulation for USB Mass Storage devices
Mar 16 11:09:46 localhost kernel: Vendor: OTi Model: Flash Disk Rev: 1.89
Mar 16 11:09:46 localhost kernel: Type: Direct-Access ANSI SCSI revision: 02
Mar 16 11:09:46 localhost kernel: sda: Unit Not Ready, sense:
Mar 16 11:09:46 localhost kernel: Current : sense key Unit Attention
Mar 16 11:09:46 localhost kernel: Additional sense: Not ready to ready change, medium may have changed
Mar 16 11:09:46 localhost kernel: SCSI device sda: 128000 512-byte hdwr sectors (66 MB)
Mar 16 11:09:46 localhost kernel: sda: assuming Write Enabled
Mar 16 11:09:46 localhost kernel: /dev/scsi/host3/bus0/target0/lun0: p1
Mar 16 11:09:46 localhost kernel: Attached scsi removable disk sda at scsi3, channel 0, id 0, lun 0
Mar 16 11:09:47 localhost scsi.agent[18166]: sd_mod: loaded sucessfully (for disk)
Mar 16 11:09:47 localhost usb.agent[18157]: usb-storage: already loaded

so this device was detected as /dev/sda and would be mounted using /dev/sda1

dracae 03-16-2006 10:21 AM

So does /dev/sda1 exist?

dracae 03-16-2006 10:25 AM

Here is a howto for setting up autofs. http://www.greenfly.org/tips/usb_drive.html


All times are GMT -5. The time now is 10:16 AM.