3

Few weeks ago I installed Opensuse 13.2. I partitioned the disk so that root '/', /var, /tmp and /home are on different partitions. Today I noticed that although /var is on partition sda8, all directories in /var, such as /var/tmp and /var/spool are on sda5 along with the root!!

Here are dumps of df, and /etc/fstab:

wsl@wsl-home:~> df
Filesystem     1K-blocks     Used Available Use% Mounted on
/dev/sda5       20978688  6735728  13435504  34% /
devtmpfs         8165516        4   8165512   1% /dev
tmpfs            8172456       92   8172364   1% /dev/shm
tmpfs            8172456     2272   8170184   1% /run
tmpfs            8172456        0   8172456   0% /sys/fs/cgroup
/dev/sda5       20978688  6735728  13435504  34% /.snapshots
/dev/sda5       20978688  6735728  13435504  34% /usr/local
/dev/sda5       20978688  6735728  13435504  34% /srv
/dev/sda5       20978688  6735728  13435504  34% /opt
/dev/sda5       20978688  6735728  13435504  34% /boot/grub2/x86_64-efi
/dev/sda5       20978688  6735728  13435504  34% /boot/grub2/i386-pc
/dev/sda1          98304    29763     68541  31% /boot/efi
/dev/sda7       20510716  6516980  12928780  34% /home
/dev/sda9        8123832    19528   7668592   1% /tmp
/dev/sda8        8122808   256472   7430676   4% /var
/dev/sda5       20978688  6735728  13435504  34% /var/tmp
/dev/sda5       20978688  6735728  13435504  34% /var/spool
/dev/sda10     688740348 30521160 658219188   5% /home/wsl/data
/dev/sda5       20978688  6735728  13435504  34% /var/opt
/dev/sda5       20978688  6735728  13435504  34% /var/log
/dev/sda5       20978688  6735728  13435504  34% /var/lib/pgsql
/dev/sda5       20978688  6735728  13435504  34% /var/lib/named
/dev/sda5       20978688  6735728  13435504  34% /var/crash
/dev/sda5       20978688  6735728  13435504  34% /var/lib/mailman

wsl@wsl-home:~> cat /etc/fstab 
UUID=4d3e8ed7-ebcf-4b7f-b5d0-dc6c34d8cfaa swap swap defaults 0 0
UUID=75b8af56-c4bd-4067-b8d8-091cd244aed0 / btrfs defaults 0 0
UUID=75b8af56-c4bd-4067-b8d8-091cd244aed0 /boot/grub2/i386-pc btrfs subvol=boot/grub2 /i386-pc 0 0
UUID=75b8af56-c4bd-4067-b8d8-091cd244aed0 /boot/grub2/x86_64-efi btrfs subvol=boot/grub2 /x86_64-efi 0 0
UUID=75b8af56-c4bd-4067-b8d8-091cd244aed0 /opt btrfs subvol=opt 0 0
UUID=75b8af56-c4bd-4067-b8d8-091cd244aed0 /srv btrfs subvol=srv 0 0
UUID=55fc7bae-856b-42f1-87de-f8e0f96017c6 /tmp ext4 acl,user_xattr 1 2
UUID=75b8af56-c4bd-4067-b8d8-091cd244aed0 /usr/local btrfs subvol=usr/local 0 0
UUID=c40639b5-7e55-4194-a1c4-7ec7a88046bf /var ext4 acl,user_xattr 1 2
UUID=75b8af56-c4bd-4067-b8d8-091cd244aed0 /var/crash btrfs subvol=var/crash 0 0
UUID=75b8af56-c4bd-4067-b8d8-091cd244aed0 /var/lib/mailman btrfs subvol=var/lib/mailman 0 0
UUID=75b8af56-c4bd-4067-b8d8-091cd244aed0 /var/lib/named btrfs subvol=var/lib/named 0 0
UUID=75b8af56-c4bd-4067-b8d8-091cd244aed0 /var/lib/pgsql btrfs subvol=var/lib/pgsql 0 0
UUID=75b8af56-c4bd-4067-b8d8-091cd244aed0 /var/log btrfs subvol=var/log 0 0
UUID=75b8af56-c4bd-4067-b8d8-091cd244aed0 /var/opt btrfs subvol=var/opt 0 0
UUID=75b8af56-c4bd-4067-b8d8-091cd244aed0 /var/spool btrfs subvol=var/spool 0 0
UUID=75b8af56-c4bd-4067-b8d8-091cd244aed0 /var/tmp btrfs subvol=var/tmp 0 0
UUID=525E-0482 /boot/efi vfat umask=0002,utf8=true 0 0
UUID=9efb5733-8a11-4cf2-83c9-3a72548f3748 /home ext4 acl,user_xattr 1 2
UUID=75b8af56-c4bd-4067-b8d8-091cd244aed0 /.snapshots btrfs subvol=.snapshots 0 0
UUID=27E244980138EAC9 /home/wsl/data ntfs-3g uid=1000,gid=100,umask=0026 0 0

Now I need to move all these directories inside /var to sda8. Also I'd like to know what possibly caused this?! Surely I did not create all these mount points when installing Opensuse!

Thank you.

  • You need to add `btrfs` to your tags... those directories are mounted on a subvolume of the `btrfs` filesystem that's also used for your root filesystem. Apparently this is a feature of opensuse? The point of this is not quite obvious to me... perhaps so that you can make snapshots of each individual mount point. – wurtel Dec 31 '14 at 12:10
  • `btrfs` tag added, thanks for the tip. It may be a feature to make snapshots, but it defeats one of the main reasons for partitioning, which is not to have var directory filling the root. I am surely missing something here, so I'll just wait for a btrfs guru to take the initiative and offer me some guidance. – Waleed Lotfy Dec 31 '14 at 21:45

1 Answers1

2

It looks like the openSUSE installer placed a bunch of directories under /var onto btrfs subvolumes. I do not know how you would disable this behavior in the installer. However, for this installed system, if you need to get rid of the subvolumes, you can probably boot into rescue mode, mount /var and mount the subvolumes, then for each subvolume mounted at mountpoint i, mkdir i.tmp, move everything from i/ to i.tmp/, umount i, rm i, mv i.tmp to i, and finally comment out the line for i in fstab.

Please note that what you were probably trying to accomplish by isolating the /var tree into a separate filesystem has apparently already been accomplished for you through the use of btrfs subvolumes.

If you want to learn more about btrfs, consider taking a look at this video tutorial about installing Arch Linux on btrfs:

https://www.youtube.com/watch?v=fBIqG2bEjrE

Youssef Eldakar
  • 141
  • 1
  • 5
  • Thank you Youssef for sharing such interesting video and info about btrfs. To test if directories inside /var are isolated from the root, I dd'ed zeros in a file till it filled up /var/tmp subvolume, and it turned out the root was also 100% used. So I think they are not quite isolated. Maybe I have to configure these subvolumes by setting an upper limit for them, or maybe just do the rescue mode trick. – Waleed Lotfy Dec 31 '14 at 19:53