Raspberry Pi command line: Connect to storage

Raspberry Pi command line: Connect to storage

Although Raspbian will, when booted as far as the GUI, automatically mount any disk-type device (USB flash key, camera, etc.) plugged into the USB port and offer to open it for you, you may wish to get more direct control of the process. Or, as is more often the case, you may want to mount a disk when the Raspberry Pi is running a project that doesn’t involve anyone getting as far as typing startx at the command line, as such graphical fripperies aren’t necessary for most connected devices. For more command line tips and projects such as this, you should check out our brand new Ebook, Conquer the Command Line. It’s available on all the usual digital services so you could own it instantly. Connected or mounted? Plugging a drive or flash memory device into your Pi (connecting it to your computer) is not the same as making it available for the Pi to interact with (mounting it) so that Raspbian knows what’s on it and can read, write, and alter files there. It’s an odd concept to accept: the computer knows there’s a disk plugged in, but its contents remain invisible until the Pi is told to mount it. It’s a bit like seeing a book on your shelf, but not being allowed to open or read it. Disks and disk-like devices are mounted by Raspbian on a virtual file system, and you’ll rarely need to worry about what goes on beneath that layer of abstraction, but to see some of it, type mount. The information displayed is of the form device on mount point, file-system type, options. You’ll see a lot of device “none” for various bits of the virtual system that you don’t need to worry about; the devices that concern us start with /dev/  and have names like /dev/mmcblk0p1  for partitions of the Pi’s SD card, and /dev/sda1  for plugged-in USB drives. Plug in a USB drive (remember that the Pi is not happy to power drives itself: either use a powered drive, or plug a USB flash drive into a powered USB hub). If you haven’t yet typed startx , then the disk will not get automatically mounted; if you have, then you need to unmount it. mount  will show an entry beginning something like “/dev/sda1 on /media/FLASH DRIVE… ” and you can unmount with sudo umount /dev/sda1  (yes, that is umount without an “n”). An error…
Source: Raspberry Pi command line: Connect to storage

답글 남기기

이메일은 공개되지 않습니다. 필수 입력창은 * 로 표시되어 있습니다.