How can I free space for my Turris Omnia?
uname -a: Linux turris 4.4.199-a890a5a94ebb621f8f1720c24d12fef1-0 #1 SMP Wed Jan 15 01:42:52 CET 2020 armv7l GNU/Linux
uptime: 04:50:01 up 14:07, load average: 0.00, 0.00, 0.00
OpenWRT-Version: 15.05
Filesystem Size Used Available Use% Mounted on
/dev/mmcblk0p1 7.3G 6.7G 706.9M 91% /
tmpfs 1010.8M 4.7M 1006.1M 0% /tmp
tmpfs 512.0K 0 512.0K 0% /dev
/dev/sdb1 58.6G 5.4G 50.2G 10% /mnt/TO-Backup
/dev/sda 931.5G 5.8G 924.7G 1% /srv
/dev/sdb1 58.6G 5.4G 50.2G 10% /tmp/run/mountd/sdb1
You can use du
to find what consumes your space. Start in the root directory (after logging in via SSH):
du -sxh /*
And then you can dive deeper into directories which contain the most portions of data, for example:
du -sxh /var/*
du -sxh /root/*
And so on.
All directories (expect /srv) are much less than 6.7G from df -h.
srv should be mounted on /dev/sda.
root@turris:/# du -sxh /*
1.8M /bin
2.7M /boot
12.0K /cp-turris-rhythmbox.sh
8.0K /cp-turris-rhytmbox_alt.sh
0 /dev
5.3M /etc
4.0K /init
10.8M /lib
0 /mnt
0 /proc
4.0K /rom
12.0K /root
8.0K /run
4.2M /sbin
5.8G /srv
0 /sys
6.0M /tmp
352.8M /usr
4.0K /var
root@turris:/# df -h
Filesystem Size Used Available Use% Mounted on
/dev/mmcblk0p1 7.3G 6.7G 706.9M 91% /
tmpfs 1010.8M 6.2M 1004.5M 1% /tmp
tmpfs 512.0K 0 512.0K 0% /dev
/dev/sdb1 58.6G 5.4G 50.2G 10% /mnt/TO-Backup
/dev/sda 931.5G 5.8G 924.7G 1% /srv
Maybe try sudo btrfs filesystem df /dev/mmcblk0p1
?
Why is there an error ?
root@turris:/# btrfs filesystem df /dev/mmcblk0p1
> ERROR: not a btrfs filesystem: /dev/mmcblk0p 1
root@turris:/# btrfs filesystem df /
System, single: total=4.00MiB, used=4.00KiB
Data+Metadata, single: total=7.28GiB, used=6.59GiB
GlobalReserve, single: total=136.00MiB, used=0.00B
well, because I did not test whether /dev/mmcblk0p1was the correct mount point name, sorry, was working from memory and your post and failedâŠ
That looks pretty full⊠any snapshots or data intensive services running?
I think this is the correct mount point for â/â
root@turris:/ # df -h
Filesystem Size Used Available Use% Mounted on
/dev/mmcblk0p1 7.3G 6.7G 706.9M 91% /
tmpfs 1010.8M 7.0M 1003.7M 1% /tmp
tmpfs 512.0K 0 512.0K 0% /dev
/dev/sdb1 58.6G 5.4G 50.2G 10% /mnt/TO-Backup
/dev/sda 931.5G 5.8G 924.7G 1% /srv
/dev/sdb1 58.6G 5.4G 50.2G 10% /tmp/run/mountd/sdb1
intensive services should be all on /dev/sda which is mounted on /srv.
root@turris:/# schnapps list
# | Type | Size | Date | Description
------±----------±------------±----------------------------±-----------------------------------
33 | rollback | 68.46MiB | 2018-10-16 19:35:18 +0000 | Rollback to snapshot 32
140 | post | 11.72MiB | 2020-02-06 07:03:27 +0100 | Automatic post-update snapshot
145 | single | 11.55MiB | 2020-03-02 09:29:10 +0100 | User created snapshot
152 | rollback | 12.35MiB | 2020-03-02 14:39:42 +0100 | Rollback to snapshot 145
153 | pre | 228.00KiB | 2020-03-03 09:14:56 +0100 | Automatic pre-update snapshot
154 | post | 112.00KiB | 2020-03-03 09:22:13 +0100 | Automatic post-update snapshot
All snaps together less then 1GB.
So what are the other 6GB used on â/â ?
1 Like
Try running:
btrfs filesystem du -s /*
root@turris:/# btrfs filesystem du -s /*
Total Exclusive Set shared Filename
1.35MiB 0.00B 1.35MiB /bin
2.72MiB 0.00B 2.72MiB /boot
12.00KiB 0.00B 12.00KiB /cp-turris-rhythmbox.sh
8.00KiB 0.00B 8.00KiB /cp-turris-rhytmbox_alt.sh
ERROR: cannot check space of â/devâ: Not a tty
2.04MiB 24.00KiB 2.02MiB /etc
0.00B 0.00B 0.00B /init
10.55MiB 0.00B 10.55MiB /lib
0.00B 0.00B 0.00B /mnt
ERROR: cannot check space of â/procâ: Not a tty
0.00B 0.00B 0.00B /rom
0.00B 0.00B 0.00B /root
0.00B 0.00B 0.00B /run
3.89MiB 0.00B 3.89MiB /sbin
5.77GiB 5.77GiB 0.00B /srv
ERROR: cannot check space of â/sysâ: Not a tty
ERROR: cannot check space of â/tmpâ: Not a tty
329.03MiB 0.00B 329.03MiB /usr
ERROR: cannot check space of â/varâ: Not a tty
204.00KiB 0.00B 204.00KiB /www
Check whether there are some snapshots not listed by schnapps
:
btrfs subvolume list -st /
(There are always two special snapshots: @factory
for the factory default state and @
for the currently mounted snapshot.)
If there are such snapshots you can retrieve information about them. For example, there is a snapshot with ID=254. The command would be:
btrfs subvolume show -r 254 /
Indeed, I suspect there are subvolumes/snapshots not listed by schnapps that may be the problem here.
Unfortunately, the btrfs tools doesnât include a way to list all subvolumes and their size. But you can use something like https://raw.githubusercontent.com/agronick/btrfs-size/master/btrfs-size.sh to do just that - it will have to be modified slightly since it uses sudo though. Iâve uploaded a modified version here: https://gist.githubusercontent.com/HomerSp/fc24b9c96cc691aaf53cdbaacb1a8993/raw/1a1469405d45dbaeef42e399abd93df9000086e8/btrfs-size.sh
Simply ssh to the router and then
cd /tmp
wget https://gist.githubusercontent.com/HomerSp/fc24b9c96cc691aaf53cdbaacb1a8993/raw/1a1469405d45dbaeef42e399abd93df9000086e8/btrfs-size.sh
bash btrfs-size.sh
Ok, its not a snapshot Problem:
root@turris:/srv/skripts# bash btrfs-size.sh
Snapshot / Subvolume Total Exclusive Data ID
@factory 103.68MB 258
certbackup 20.00KB 260
@33 110.66MB 280
@152 6.22GB 346
@140 6.22GB 408
@145 6.22GB 413
@ 6.39GB 420
@153 6.22GB 421
@154 6.39GB 422
Exclusive Total: 180.40MB
vcunat
March 4, 2020, 4:43pm
13
It isnât? What do these 6.xxGB mean? From the listing Iâd expect at least some of them store gigabytes of data.
Oh. I havent seen the GB.
But thats all together over 36GB !
Schnapps shows something very different:
root@turris:/srv/skripts# schnapps list
| Type | Size | Date | Description
------±----------±------------±----------------------------±-----------------------------------
33 | rollback | 68.46MiB | 2018-10-16 19:35:18 +0000 | Rollback to snapshot 32
140 | post | 11.72MiB | 2020-02-06 07:03:27 +0100 | Automatic post-update snapshot
145 | single | 11.55MiB | 2020-03-02 09:29:10 +0100 | User created snapshot
152 | rollback | 12.35MiB | 2020-03-02 14:39:42 +0100 | Rollback to snapshot 145
153 | pre | 228.00KiB | 2020-03-03 09:14:56 +0100 | Automatic pre-update snapshot
154 | post | 112.00KiB | 2020-03-03 09:22:13 +0100 | Automatic post-update snaps
And â/â maxspace is 7,3GB on /dev/mmcblk0p1.
root@turris:/srv/skripts# df -h
Filesystem Size Used Available Use% Mounted on
/dev/mmcblk0p1 7.3G 6.7G 706.9M 91% /
tmpfs 1010.8M 7.6M 1003.1M 1% /tmp
tmpfs 512.0K 0 512.0K 0% /dev
/dev/sdb1 58.6G 5.4G 50.2G 10% /mnt/TO-Backup
/dev/sda 931.5G 5.8G 924.7G 1% /srv
/dev/sdb1 58.6G 5.4G 50.2G 10% /tmp/run/mountd/sdb1
vcunat
March 4, 2020, 5:11pm
15
Apparently thereâs something wrong in the accounting, perhaps in the script, as the sum of âtotal exclusive dataâ is too large. Still, it seems likely that data in some snapshots cause the high usage.
I think the script displays the size of the used data if you were to restore those snapshots - so it doesnât actually show the size of the snapshot itself.
Just to test everything: If you unmount the external devices (like /srv and /mnt/TO-Backup), do you get the same output from df -h? I know this shouldnât cause an issue like this, but from what I can tell it doesnât seem like the snapshots use up any unnecessary space.
I unmount /mnt/TO-Backup in Luci.
Unmounting /srv in Foris does not work.
How can I unmounting /dev/sda /srv ?
root@turris:/# umount /srv
umount: /srv: target is busy
(In some cases useful info about processes that
use the device is found by lsof(8) or fuser(1).)
Iâm assuming you have something running that uses /srv - you will need to stop that/those processes to unmount it. If you donât know whatâs using it, you can do:
lsof | grep /srv
and then you can simply stop those processes.
1 Like
My samba shares are on /srv and my new installed nextcloud.
Now with unmount: /mnt/TO-Backup (USB-Stick)
root@turris:/# df -h
Filesystem Size Used Available Use% Mounted on
/dev/mmcblk0p1 7.3G 6.7G 731.9M 90% /
tmpfs 1010.8M 5.3M 1005.5M 1% /tmp
tmpfs 512.0K 0 512.0K 0% /dev
/dev/sda 931.5G 17.3G 913.2G 2% /srv
root@turris:/# du -sxh /*
1.8M /bin
2.7M /boot
12.0K /cp-turris-rhythmbox.sh
8.0K /cp-turris-rhytmbox_alt.sh
0 /dev
5.3M /etc
4.0K /init
10.8M /lib
0 /mnt
0 /proc
4.0K /rom
12.0K /root
8.0K /run
4.2M /sbin
17.4G /srv
0 /sys
5.1M /tmp
352.8M /usr
4.0K /var
424.0K /www
I have copy for testing a 12 GB File to /srv.
What Files or Programms normaly (factory standart) on /srv ?