Hardware Reference
In-Depth Information
$ su -c 'mkdir /mnt/raspi-boot'
$ su -c 'mkdir /mnt/raspi-root'
These directories will serve as anchors for mounting the partitions from the MMC
block device.
Then, use the mount command to mount the boot and root partitions:
$ su -c 'mount /dev/mmcblk0p1 /mnt/raspi-boot'
$ su -c 'mount /dev/mmcblk0p2 /mnt/raspi-root'
If these mount commands return without errors, it means they have mounted suc-
cessfully. You can confirm they have mounted by running mount again and piping the
output through a grep for the MMC block device name ( mmcblk0 ):
$ mount | grep mmcblk0
/dev/mmcblk0p1 on /mnt/raspi-boot type vfat (rw,rela
time,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,er
rors=remount-ro)
/dev/mmcblk0p2 on /mnt/raspi-root type ext4 (rw,relatime,data=ordered)
You should also now be able to see files in the /mnt/raspi-boot and /mnt/raspi-root
directories.
It is also possible to mount the /boot partition inside the mounted / partition, but we
recommend keeping them separate. That way, if you forget to mount the boot parti-
tion, it is more obvious, and you avoid the problem of accidentally copying files into
the /boot directory on the root partition. Remember, Linux mounts the boot partition
on top of that /boot directory, and any files that get copied into that directory when
the boot partition is not mounted are not visible!
Mounting the SD card is especially useful to make quick changes to the config.txt
file that lives in the Raspberry Pi Linux /boot partition. If you need to change the ouput
display settings for a new monitor (or an old HDMI TV with less than amusing quirks),
it's a lot easier to do it from a mounted SD card than from a headless Raspberry Pi.
Just make sure the boot partition is mounted, and then change into that directory
( /mnt/raspi-boot ) and directly edit config.txt (as root). Save your changes, and then
run sync to make sure the buffers get written back to the SD card.
When that finishes, change out of the directory (if you do not, Linux will not let you
cleanly unmount the partition) and unmount both of the partitions (as root) with the
umount command:
$ cd /mnt/raspi-boot/
$ su -c 'vi config.txt'
$ sync;sync;sync;
$ cd /mnt
Search WWH ::




Custom Search