Jump to content
Sign in to follow this  

Question about fstab - move var and tmp to separate folders different disk

Recommended Posts



Background - can skip this, it may be boring:

So I have been given an very old Fuijitsu Siemens server that was ment to be scrapped. That thing was probably made in 1999 or maybe earlier as it have an P3 CPU. The point with this pc is to use it as a test rig - just because it is more fun to test on an actual machine rather than on a virtual one. Another thing is that CPU have no support of SSE2, so whenever I try to use Midori to post on forum, it crashes after just a few minutes and before I can write the post and send it. This is written on another computer therefore. Have another computer that also have a CPU (AMD Athlon XP 2000+) without SSE2 support, where Midori act the very same way so that is why I assume it must be a SSE2 problem. None of this is relevant to the original problem, but I just write this so you folks know it something bad happens with the Linux installation, there is no harm done.



To the issue:

I have installed three HDD into the computer. The boot drive is a 60GB drive. It is partitioned something like this:

800 MB /boot

9000 MB /

8000 MB / home

2000 MB swap

The rest: an old NTFS partition hangs from the Windows XP days. It just have survived some previous tests (just a bounch of installations going bad because not many distros actually accept this old HW).


Then I have two 2GB HDD that I have formatted as Btrfs as - I think it's called "bucket" or something, the same as MS called "spanned drives", so it's not actually RAID, but the final size of the usable volume adds up to 4GB here.

I have run the chmod command to let anyone have full access to the volume, and I have also prior to that run chown so I'm the owner of the volume.


Then I have created two folders on the Btrfs root: systmp and sysvar. The goal here is to mount those folders as /var and /tmp.


Current output from blkid command:

/dev/sda3: LABEL="lagra" UUID="3EF4F2736F1F3E35" TYPE="ntfs" PARTUUID="c192987b-03"
/dev/sda5: UUID="dcd834a7-bc03-4ee5-853e-deebfdd5c592" TYPE="ext4" PARTUUID="c192987b-05"
/dev/sda6: UUID="2b4c4357-05e1-4454-9708-10684b65f00e" TYPE="ext4" PARTUUID="c192987b-06"
/dev/sda7: UUID="9ad6a564-eb44-43e4-a83a-279d66ef8669" UUID_SUB="5976254e-794e-435b-bf17-0f3d578bd593" TYPE="btrfs" PARTUUID="c192987b-07"
/dev/sda8: UUID="1c891396-7412-4eb3-ac8c-bd48ed2eb09b" TYPE="swap" PARTUUID="c192987b-08"
/dev/sdc: UUID="ae9561d2-155d-4b74-a499-229bdad0ea13" UUID_SUB="92d3b3c5-c6e9-499e-8df5-ab13a0732cc8" TYPE="btrfs"
/dev/sdb: UUID="ae9561d2-155d-4b74-a499-229bdad0ea13" UUID_SUB="0ddb800f-6051-476d-906e-68363a6b1f57" TYPE="btrfs"
/dev/sdd1: LABEL="K_CLAS" UUID="9C66-CCD5" TYPE="vfat" PARTUUID="4cf11113-01"

So I tried to read about fstab, but I cannot find documentation for mounting in folders, only mounting /var and /tmp on wholde partitions.


Therefore I had a guess - so I tried to di this in fstab:

# /etc/fstab: static file system information.
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda6 during installation
UUID=2b4c4357-05e1-4454-9708-10684b65f00e /               ext4    errors=remount-ro 0       1
# /boot was on /dev/sda5 during installation
UUID=dcd834a7-bc03-4ee5-853e-deebfdd5c592 /boot           ext4    defaults        0       2
# /home was on /dev/sda7 during installation
UUID=9ad6a564-eb44-43e4-a83a-279d66ef8669 /home           btrfs   defaults,subvol=@home 0       2
# swap was on /dev/sda8 during installation
UUID=1c891396-7412-4eb3-ac8c-bd48ed2eb09b none            swap    sw              0       0

# 17. desember 2017 - sdb og sdc
# /dev/sdb/systmp/     /tmp           btrfs   defaults,subvol=@tmp 0       2

# /dev/sdb/sysvar/       /var            btrfs   defaults,subvol=@var 0       2

As you can see, the bottom lines is commenting out - simly because it wouldn't work. Managed to do that using single user mode (was thrown there as the system wouldn't boot into desktop) and using Nano.


So here is the things I need answer for to get further and hopefully get this to work:

* The pointer to /dev/sdb/systmp/ might not work like that in fstab. What does work? UUID - but can that be mixed up and combined with folder names?

* The subvol=@tmp parameter is unknown to me. I found that it is done in similar way for /home (that line is not touched by me) so I guessed that it should be that way. Have no idea what it does.

* May there be a problem that - if the mounting in fstab actually work - the /var and /tmp folders is empty? Could that be a reason why Linux Bodhi won't boot into desktop?

Share this post

Link to post
Share on other sites

Before anything else I would suggest to remove the ending slashes after /dev/sdb/systmp/ and /dev/sdb/sysvar/ 

Then it might work, not sure.


You might try to create a line in fstab for the spanned volume (or LVM) /dev/sdb (using the UID) to a mountpoint like /mnt/lvm (have to make that dir first).


Next in your / partition (sda6) you can replace the /var and /tmp directory with symlinks to the /mnt/lvm/sysvar and /mnt/lvm/systmp  folders. That way what gets "written" to /var and /tmp in reality is written to the lvm disks.


NB: Don't forget to copy the content of those dirs before replacing them.


Hope this gives you some ideas.




  • Like 1

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this