Raspberry Pi: mount flash disks at boot

Now that I got a little time to work on my Raspberry Pi, I decided to have 2 2GB flash drives mounted at boot to save some write cycles on the SD card:

After a few failed times, I googled for a while and the important bit is the 6th field in your /etc/fstab file. Here's mine:

 

[root@pi ~]# cat /etc/fstab
#
# /etc/fstab: static file system information
#
# <file system>        <dir>         <type>    <options>          <dump> <pass>
devpts                 /dev/pts      devpts    defaults            0      0
shm                    /dev/shm      tmpfs     nodev,nosuid        0      0
/dev/mmcblk0p1  /boot           vfat    defaults        0       0

/dev/sda1       /var       ext4    defaults          0       2
/dev/sda2       /data      ext4    defaults          0       2
/dev/sda3       /tmp       ext4    defaults          0       2
/dev/sdb1       /home      ext4    defaults          0       2

 

The "2" in the 6th field tells the kernel to wait for the drive to be available before trying to mount it.

Here's the "mount" command output:

/dev/mmcblk0p1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=ascii,shortname=mixed,errors=remount-ro)
/dev/sdb1 on /home type ext4 (rw,relatime,user_xattr,barrier=1,data=ordered)
/dev/sda2 on /data type ext4 (rw,relatime,user_xattr,barrier=1,data=ordered)
/dev/sda3 on /tmp type ext4 (rw,relatime,user_xattr,barrier=1,data=ordered)
/dev/sda1 on /var type ext4 (rw,relatime,user_xattr,barrier=1,data=ordered)

 

 

 

Tagged , , , , . Bookmark the permalink.

Leave a Reply