You are not logged in.

#1 2017-05-30 10:14:41

Steranoid
Member
Registered: 2017-05-30
Posts: 7

[Solved] /var as symlink

Hi,
As it is said in the wiki, it may be interesting to preserve the root partition from the var directory expansion, especially if you are in my case and you will log a large amount of things for your server.

So I wanted to make a partition for the root dir and another one for "data" (with a really large meaning of what "data" is).
So I wanted to mount my filesystem like this
/ which basically contains only /usr and /etc
/boot on its own partition (as an ESP)
and /data with symlinks to it :
/var -> /data/var
/home -> /data/home
/srv -> /data/srv
/root -> /data/root
/opt -> /data/opt

The problem is : pacman don't seems to like it, when I try to install some things, it try to check for file conflicts and says things like :
error: failed to commit transaction (conflicting files)
dkms: /var exists in filesystem
Errors occured, no packages were upgraded
(dkms in this case because I try to install virtualbox-guest-dkms for linux-hardened kernel in my vm)

So my questions are: Is pacman the only problem here ? And/or is it just not possible/recommended to do so ?

I could use some binds to avoid this problem but ... Well, I don't find bindings really elegant. And Archlinux already use symlinks with /bin, /sbin, /lib64 and /lib/.
Another solution is to use LVM to make multiples logical partition and then make a partition for each directories as mounting points but that makes things harder to manage and kinda rigid, even with lvm: If I see that my logs take too much place I must redimension my other partitions expand the filesystem (making the use of some filesystems impossible, like XFS that you can't shrink) making the whole process really timeconsumming in the end.
Another one would be to use btrfs subvolumes and quotas but it not that stable yet ...

Have a good day,
(I'm sorry if my english is not that well, but I'm French, yes, that's an excuse)

Last edited by Steranoid (2017-06-07 06:48:21)

Offline

#2 2017-05-30 10:15:24

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,385
Website

Re: [Solved] /var as symlink

Bind mount.

Offline

#3 2017-05-30 13:54:47

Steranoid
Member
Registered: 2017-05-30
Posts: 7

Re: [Solved] /var as symlink

Well, you don't really answer the questions

Offline

#4 2017-05-30 14:08:18

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,911

Re: [Solved] /var as symlink

support for symlinking directories like /var was removed from pacman in version 4.2.0 (around dec 2014 ).
bind mounts are the recommended solution .

Note : putting /var on it's own partition works fine.

Last edited by Lone_Wolf (2017-05-30 14:10:23)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#5 2017-05-30 14:21:37

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: [Solved] /var as symlink

Steranoid wrote:

I could use some binds to avoid this problem but ... Well, I don't find bindings really elegant.

Binds do exactly what you want and are the recommended way to do it. How are they any less elegant than symlinks or LVM partitions?


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#6 2017-05-31 07:36:18

Steranoid
Member
Registered: 2017-05-30
Posts: 7

Re: [Solved] /var as symlink

Binds it is then. I don't really know why I find this not elegant, maybe because it's poluting fstab and mount. Why /bin, /sbin, /lib and /lib64 are symlinks and not binds then ?

Mod Note: Deleted duplicate post \V1del

Last edited by V1del (2017-05-31 08:51:47)

Offline

#7 2017-05-31 07:58:27

ayekat
Member
Registered: 2011-01-17
Posts: 1,589

Re: [Solved] /var as symlink

Steranoid wrote:

Why /bin, /sbin, /lib and /lib64 are symlinks and not binds then ?

Because those paths are not supposed to be around anymore. They are just kept as a (hopefully temporary) workaround for programs that still use an older hierarchy standard (when there was /bin, /sbin, /lib, /var/run, ...). It's the filesystem saying: "You're searching in the wrong place! Let me redirect you to the right place!"

In your situation, the hierarchy standard dictates that the directory must be there. The filesystem is more like: "You're searching in the right place! Let me just hide the fact that it's really somewhere different!". A good example for this is /home, which often resides in a separate filesystem.

--edit--
Of course, the second case could still be solved using symbolic links, but then pacman would yell at you.
Also, it would be ugly, because the hierarchy standard dictates that it must be a directory, and deviating from that would be—strictly speaking—incorrect (even though the hierarchy standard doesn't mention symlinks at all).

Last edited by ayekat (2017-06-02 07:14:39)


pkgshackscfgblag

Offline

#8 2017-06-07 06:47:10

Steranoid
Member
Registered: 2017-05-30
Posts: 7

Re: [Solved] /var as symlink

Thanks a lot, that was very helpful for my understanding.

Offline

Board footer

Powered by FluxBB