Storage
Give recordings a disk of their own, so they do not fill the system disk. Use a USB drive, or a disk image with a fixed size.
Use a USB drive
-
Find the drive:
sudo fdisk -l -
Mount it at
/mnt/ext_diskwithautofs(reference). Replace/dev/sda1with your drive:sudo apt install autofs echo '/- /etc/auto.usb --timeout=5' | sudo tee -a /etc/auto.master > /dev/null echo '/mnt/ext_disk -fstype=auto,nofail,nodev,nosuid,noatime,async,umask=000 :/dev/sda1' | sudo tee -a /etc/auto.usb > /dev/null sudo systemctl restart autofs -
Record to it:
./pi-webrtc ... --record-path=/mnt/ext_disk/video
Use a disk image
You do not need a USB drive. A disk image file limits recording to a fixed size.
-
Create a 16 GB image:
dd if=/dev/zero of=/home/pi/16gb.img bs=1M count=16384 -
Format it:
mkfs.ext4 /home/pi/16gb.img -
Mount it:
mkdir -p /home/pi/limited_folder sudo mount -o loop /home/pi/16gb.img /home/pi/limited_folder -
Make it writable:
sudo chmod 777 /home/pi/limited_folder -
Record to it:
./pi-webrtc ... --record-path=/home/pi/limited_folder/ -
To mount it at every boot, add this line to
/etc/fstab:/home/pi/16gb.img /home/pi/limited_folder ext4 loop,noatime 0 2
Caution
A mistake in /etc/fstab can stop the system from booting. Test the mount by hand first.

