TheWaterbug
Posts: 77
Joined: Fri Feb 05, 2016 12:35 am
Location: Los Angeles, CA, USA, Earth

No Space Left on Device for ffmpeg

Mon Jan 29, 2018 6:22 pm

¡Hola! I'm trying to compile ffmpeg on top of an "installation from image" of a this PHP/Bootstrap Web Interface for the Pi Camera project.

I've successfully compiled ffmpeg on a fresh Stretch image, and also on top of the older version of the above-linked project, but I'm having trouble compiling on top of this newer version of the project, perhaps because it seems to have shrunk certain portions of the filesystem.

So immediately after writing the image and applying a few known fixes, I'm attempting to compile ffmpeg:

Code: Select all

sudo mount -o remount rw /
cd /usr/src
sudo mkdir ffmpeg
sudo chown pi:users ffmpeg
git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
cd ffmpeg
sudo chmod 1777 /tmp
./configure
I need to sudo chmod 1777 /tmp to avoid "./configure: Unable to create temporary file in /tmp", because the camera project write-protects a bunch of the filesystem.

Then ./configure failed with a "segmentation fault," as it did last time, but running ./configure again completed successfully.

make && sudo make install succeeded on top of the old camera project, but on this new project it got through a bunch of compiling, and then failed with:

Code: Select all

CC	libavcodec/mpc.o
CC	libavcodec/mpc7.o
/tmp/ccghLv15.s: Assembler messages:
/tmp/ccghLv15.s: Fatal error: can't write libavcodec/mpc7.o: No space left on device
/tmp/ccghLv15.s: Fatal error: can't close libavcodec/mpc7.o: No space left on device
ffbuild/common.mak:60: recipe for target 'libavcodec/mpc7.o' failed
make: *** [libavcodec/mpc7.o] Error 1
Rebooting and running:

Code: Select all

sudo mount -o remount rw /
sudo chmod 1777 /tmp
make && sudo make install
results in the same /tmp/ccghLv15.s: Fatal error: can't write libavcodec/mpc7.o: No space left on device error. The SD card is 32 GB, so I have plenty of space in hardware, but I think the image file has different volumes defined with smaller sizes. df returns:

Code: Select all

Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/root        1478848 1399764        64 100% /
devtmpfs          437052       0    437052   0% /dev
tmpfs             441384    2576    438808   1% /dev/shm
tmpfs             441384   11432    429952   3% /run
tmpfs               5120       0      5120   0% /run/lock
tmpfs             441384       0    441384   0% /sys/fs/cgroup
tmpfs             441384       8    441376   1% /tmp
tmpfs             441384       0    441384   0% /var/tmp
tmpfs             441384      16    441368   1% /var/log
/dev/mmcblk0p1     63503   20757     42746  33% /boot
It certainly appears as if this is the problem: /dev/root 1478848 1399764 64 100% /
I tried using raspi-config to expand the fs to the available size, which reports:

Code: Select all

Welcome to fdisk (util-linux 2.25.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): Disk /dev/mmcblk0: 29.6 GiB, 31724666880 bytes, 61962240 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xa947644d

Device         Boot  Start     End Sectors  Size Id Type
/dev/mmcblk0p1        8192  137215  129024   63M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      137216 3209215 3072000  1.5G 83 Linux


Command (m for help): Partition number (1,2, default 2): 
Partition 2 has been deleted.

Command (m for help): Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p): Partition number (2-4, default 2): First sector (2048-61962239, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (137216-61962239, default 61962239): 
Created a new partition 2 of type 'Linux' and of size 29.5 GiB.

Command (m for help): Disk /dev/mmcblk0: 29.6 GiB, 31724666880 bytes, 61962240 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xa947644d

Device         Boot  Start      End  Sectors  Size Id Type
/dev/mmcblk0p1        8192   137215   129024   63M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      137216 61962239 61825024 29.5G 83 Linux


Command (m for help): The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: Device or resource busy

The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).
Upon reboot I see a failure in the boot log:

Code: Select all

systemctl status resize2fs_once.service
● resize2fs_once.service - LSB: Resize the root filesystem to fill partition
   Loaded: loaded (/etc/init.d/resize2fs_once)
   Active: failed (Result: exit-code) since Wed 1969-12-31 16:00:08 PST; 48 years 0 months ago
  Process: 378 ExecStart=/etc/init.d/resize2fs_once start (code=exited, status=1/FAILURE)
What do I need to edit to make more space at /dev/root, given that much of the file system is currently write-protected?

Code: Select all

[email protected]:~ $ cat /etc/fstab
proc            /proc           proc    defaults              0 0
/dev/mmcblk0p1  /boot           vfat    ro,defaults           0 2
/dev/mmcblk0p2  /               ext4    ro,defaults,noatime   0 1
tmpfs           /var/log        tmpfs   nodev,nosuid          0 0
tmpfs           /var/tmp        tmpfs   nodev,nosuid          0 0
tmpfs           /tmp            tmpfs   nodev,nosuid          0 0


Thanks!

Return to “General discussion”