Friday, September 2, 2011

Mounting Mount a USB stick in FreeBSD

Mounting Mount a USB stick in FreeBSD

Plug in your USB drive into FreeBSD box

See if the system has detected the drive:
# tail /var/log/message
Mar 4 09:25:07 web1 kernel: umass1: SCSI over Bulk-Only; quirks = 0x0000
Mar 4 09:25:08 web1 kernel: umass1:2:1:-1: Attached to scbus2
Mar 4 09:25:09 web1 kernel: da5 at umass-sim1 bus 1 scbus2 target 0 lun 0
Mar 4 09:25:09 web1 kernel: da5: Fixed Direct Access SCSI-0 device
Mar 4 09:25:09 web1 kernel: da5: 40.000MB/s transfers
Mar 4 09:25:09 web1 kernel: da5: 152627MB (312581808 512 byte sectors: 255H 63S/T 19457C)

Note: we can see that the device is in /dev/da5. Normally, USB sticks are formatted, with 1 slice covering the entire device. Thus, you should try mounting /dev/da5s1 and not /dev/da5

If it is formatted as FAT:
# mount -t msdosfs /dev/da5s1 /mnt

If it is formatted as NTFS:
# mount -t ntfs /dev/da5s1 /mnt

Check if it's mounted:
# df -h

After you are done, leave /mnt directory:
# cd ~

Umount /mnt
# umount /mnt

Check if it's unmounted:
# df -h

No comments: