Mounting Drives

For the new installation of Weewx I’m setting up an external drive.  Once I plugged the drive in and had given it a moment to connect I tested for its existence with

sudo fdisk -l

Now I needed to create a mount point and give my weewx user permission to use this.

sudo mkdir /mnt/weewxdata
sudo chown weewx:weewx weewxdata/

lastly I could mount it with

sudo mount -t vfat -o uid=pi,gid=pi /dev/sda1 /mnt/weewxdata

To unmount it I would

sudo umount /mnt/weewxdata

If I wanted the disk to mount every time the RPi was started then I would open up the fstab and add the second line

sudo nano /etc/fstab
/dev/sda1 /mnt/weewxdata vfat uid=pi,gid=pi 0 0

Leave a Reply

Your e-mail address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.