Extra USB Drive - mpechner/Security-Camera GitHub Wiki

This page covers the info well enough . https://devtidbits.com/2013/03/21/using-usb-external-hard-disk-flash-drives-with-to-your-raspberry-pi/

Ok, break the rules, sudo -i, since you need to be root to do everything anyway. For the camera, better to store on a seperate drive.

Find and Format the Drive

Found the drive by running df -h. It initially showed as /dev/sda1 15G 37M 15G 1% /media/pi/Untitled

Making it ext4 is better than fat.

umount /media/pi/Untitled
mkfs.ext4 /dev/sda1 -L camera
mke2fs 1.43.4 (31-Jan-2017)
/dev/sda1 contains a hfsplus file system labelled 'Untitled'
Proceed anyway? (y,N) y
Creating filesystem with 3784703 4k blocks and 946560 inodes
Filesystem UUID: 87dff10d-6c48-4452-bce8-d31c3224d7ba
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done  

Mount it

mkdir /mnt/cameraimages

Edit /etc/fstab and add the following entry:

/dev/sda1 /mnt/cameraimages ext4 defaults,noatime 0 1

So it will be remounted each time the Pi boots.