Difference between revisions of "Raspberry PI USB Drives"

From WA2IAC Wiki
Jump to: navigation, search
(Mounting and Using USB Drives on the Raspberry Pi)
 
(Mounting Drive Partitions)
Line 8: Line 8:
 
If you're running your Pi "headless" (ie. without keyboard, mouse or monitor) and remotely logging in via another computer, both USB ports on the model 'B' will be available for use with USB flash drives, without excessive drain on the Pi's power supply. ('''NB:''' Only tested on a 'B' model acquired July 2012)
 
If you're running your Pi "headless" (ie. without keyboard, mouse or monitor) and remotely logging in via another computer, both USB ports on the model 'B' will be available for use with USB flash drives, without excessive drain on the Pi's power supply. ('''NB:''' Only tested on a 'B' model acquired July 2012)
 
==Mounting Drive Partitions==
 
==Mounting Drive Partitions==
You can plug in a USB flash or hard disk drive while the Pi is running without any problem.  The USB device will be sensed by the Pi, however, it probably won't be added to the operating system's file system.  That will require some manual intervention to "mount" the device onto the file system.  A flash or hard drive may be configured with one, or more, partitions, which you can create yourself in the unlikely event that the drive doesn't already have any. Creating partitions is covered in a separate tutorial: [TBD]
+
You can plug in a USB flash or hard disk drive while the Pi is running without any problem.  The USB device will be sensed by the Pi, however, it probably won't be added to the operating system's file system.  That will require some manual intervention to "mount" the device onto the file system.  A flash or hard drive may be configured with one, or more, partitions, which you can create yourself in the unlikely event that the drive doesn't already have any.
 
===USB Drive Hierarchy===
 
===USB Drive Hierarchy===
 
Linux hardware devices are organized and identified by letters under the file system's device hierarchy, <code>/dev</code>.  USB drives attached to the Pi are found under the file system as <code>/dev/sdX</code>, where "X" starts with the letter "a" representing the first USB drive, "b" for the second drive, "c" for the third, etc.  The individual partitions on each drive are represented by incremented numbers, starting with "1".  So, the first partition on the first USB drive is located in the file system as <code>/dev/sda1</code>, the second partition on that drive is <code>/dev/sda2</code>, the third partition on a third drive would be <code>/dev/sdc3</code>, etc.
 
Linux hardware devices are organized and identified by letters under the file system's device hierarchy, <code>/dev</code>.  USB drives attached to the Pi are found under the file system as <code>/dev/sdX</code>, where "X" starts with the letter "a" representing the first USB drive, "b" for the second drive, "c" for the third, etc.  The individual partitions on each drive are represented by incremented numbers, starting with "1".  So, the first partition on the first USB drive is located in the file system as <code>/dev/sda1</code>, the second partition on that drive is <code>/dev/sda2</code>, the third partition on a third drive would be <code>/dev/sdc3</code>, etc.
Line 59: Line 59:
  
 
You can copy or move files and directories to or from any directory in the mounted partition by just referring to the appropriate path to that directory in the partition.
 
You can copy or move files and directories to or from any directory in the mounted partition by just referring to the appropriate path to that directory in the partition.
 +
 
==Unmounting a Partition Before Drive Disconnection==
 
==Unmounting a Partition Before Drive Disconnection==
 
When you're done with a drive and want to disconnect it from the Pi, you should unmount the drive by using the "umount" command (notice there is no letter "n" between the "u" and the "m") and referring to the mount point:
 
When you're done with a drive and want to disconnect it from the Pi, you should unmount the drive by using the "umount" command (notice there is no letter "n" between the "u" and the "m") and referring to the mount point:

Revision as of 04:01, 2 May 2013