Taillieu.Info

More Than a Hobby..

Cheat Sheet - USB drives

The following is a cheat sheet of some of the more common commands for using a USB drive with a Pi. I've written an extensive tutorial on using USB drives on a Pi shell at http://ipggi.wordpress.com/2013/03/21/u ... pberry-pi/. It covers power supply issues, mounts, performance, disk file formats, compatibility and formating.

To mount a USB drive:

Code: Select all

sudo mkdir /mnt/usbdrive
sudo mount /dev/sda1 /mnt/usbdrive
ls /mnt/usbdrive

To list your file systems:

Code: Select all

sudo fdisk -l
sudo mount -l
df -h

Before disconnecting a USB drive:

Code: Select all

sudo umount /dev/sda1

Format a drive to Linux EXT4

Code: Select all

sudo mkfs.ext4 /dev/sda1 -L untitled

Add Apple OS X HFS+ read/write support

Code: Select all

sudo apt-get install hfsutils hfsprogs hfsutils

Format a drive to HFS+

Code: Select all

sudo mkfs.hfsplus /dev/sda1 -v untitled

Add Windows NTFS read/write support

Code: Select all

sudo apt-get install ntfs-3g

Format a drive to NTFS

Code: Select all

sudo mkfs.ntfs /dev/sda1 -f -v -I -L untitled

Add Windows/DOS FAT32 read/write support

Code: Select all

sudo apt-get install dosfstools

Format a drive to FAT32

Code: Select all

sudo mkfs.vfat /dev/sda1 -n untitled