Linux: mounting of a FAT16/FAT32 USB flash drive
Posted by jpluimers on 2013/09/09
A while ago, I had to transfer a couple of files from a Linux machine where I did have console access, but no proper network access.
This was the sequence to get it connected and copy a directory to the USB flash drive:
- Stick the USB flash drive in a USB port (duh <g>) on the Linux system
- Run the fdisk command to see on which device it got loaded:
# fdisk -l
It will give you something like this:
Disk /dev/sdd: 8019 MB, 8019509248 bytes
20 heads, 16 sectors/track, 48947 cylinders
Units = cylinders of 320 * 512 = 163840 bytes
Device Boot Start End Blocks Id System
/dev/sdd1 * 1 48948 7831512 b Win95 FAT32 - Create a
/mnt/USB
directory to mount the device to using themkdir
command:
# mkdir /mnt/USB
- Use the
modprobe
command to make sure thevfat
file system support is loaded:
# modprobe vfat
- Use the
mount
command to mount the device from the first step (/dev/sdd1
) to the directory you created (/mnt/USB
)
# mount /dev/sdd1 /mnt/USB
- Use the
rsync
command to recursively (-p) copy a directory maintaining timestamps (-t) and showing progress (-v)
# rsync -rtv /home/user/directory/ /mnt/USB/directory/
- Use the
umount
command to unmount the directory (and therefore the device)
# umount /mnt/USB
–jeroen
Leave a Reply