You are not logged in.

#1 2013-10-01 14:20:37

arcon
Member
Registered: 2013-05-27
Posts: 128

How about having a different partition for pacman related stuff..

I don't know if it is worth a thread or not but i can't to this right now on my system so, i think it is better to post here and see what others think..

So, i was reading this thread and this thing struck to my mind "how about creating a separate partition/drive for (pacman) which refers to the directory(/var/cache/pacman)" and not for /var.
in this way directory tree for /var/cache/pacman looks like:

#ls /var/cache/pacman 
pkg sources abs

where pkg contains packages(as usual), sorces contains diffrent source files(eg linux sources and other useful stuff) and abs contains various abs files and aur pkgbuild files etc and in this manner we can use this directory for building and keeping sources.

In this way we have all the pacman as well as arch related stuff away from home where all other personal project sources resides.

Also having seperate external drive for this kinda stuff can be of some use.

So, my question here is,

i) Is this as simple as creating separate /boot partition, or it is different.
ii) What if i have multiple arch installation on different partitions and i want to access that(pacman) partition(to save some hdd space) from different arch's, is there any chance of permissions problem or conflict between those arch's.

Last edited by arcon (2013-10-01 14:21:38)


The short cuts are only short because they don't actually go anywhere. -- Trilby
Nothing feels better than being understood -- awayand
A pathetic dreamer smile

Offline

#2 2013-10-01 14:30:41

mamamia88
Member
Registered: 2012-08-29
Posts: 483

Re: How about having a different partition for pacman related stuff..

What exactly is wrong with a separate var partition?

Offline

#3 2013-10-01 14:39:12

arcon
Member
Registered: 2013-05-27
Posts: 128

Re: How about having a different partition for pacman related stuff..

having a seperate (pacman i say) partition is sort of a repo for arch packages and there source codes and even PKGBUILD files at one place,

which can be shared by different arch installations and if we can use a different external drive for that purpose, it is like having an arch repository by your side everytime.

On the other side i never said that there's anything wrong with having a /var partition.


The short cuts are only short because they don't actually go anywhere. -- Trilby
Nothing feels better than being understood -- awayand
A pathetic dreamer smile

Offline

#4 2013-10-01 15:01:05

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,787
Website

Re: How about having a different partition for pacman related stuff..

For things like pacman cache, it's fine.

For example, on my work machine, I have a separate btrfs partition for my pacman cache, my virtual images, and my clean chroots:

UUID=f3cd1b68-22fb-43e0-931c-76156eb662fc /var/lib/archbuild      btrfs defaults,subvol=chroots,noauto,x-systemd.automount    0 0
UUID=f3cd1b68-22fb-43e0-931c-76156eb662fc /var/lib/libvirt/images btrfs defaults,subvol=kvm,noauto,x-systemd.automount        0 0
UUID=f3cd1b68-22fb-43e0-931c-76156eb662fc /var/cache/pacman/pkg   btrfs defaults,subvol=pkgcache,noauto,x-systemd.automount   0 0

And everything works fine.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#5 2013-10-01 15:02:38

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: How about having a different partition for pacman related stuff..

You can rsync pacman cache to the external drive and point pacman.conf to use that. You can mount that drive in /var/cache/pacman/pkg/ if you want to have just one copy of the cache (no need for rsyncing in this case).


Is there any particular use case for this?

Offline

#6 2013-10-01 15:14:17

mamamia88
Member
Registered: 2012-08-29
Posts: 483

Re: How about having a different partition for pacman related stuff..

arcon wrote:

having a seperate (pacman i say) partition is sort of a repo for arch packages and there source codes and even PKGBUILD files at one place,

which can be shared by different arch installations and if we can use a different external drive for that purpose, it is like having an arch repository by your side everytime.

On the other side i never said that there's anything wrong with having a /var partition.

You can change the cache directory in pacman.conf  Heck couldn't you even write a simple bash script that rsyncs the cache wherever you want after every update?  Would be pretty simple.

Last edited by mamamia88 (2013-10-01 15:14:29)

Offline

#7 2013-10-01 15:41:13

arcon
Member
Registered: 2013-05-27
Posts: 128

Re: How about having a different partition for pacman related stuff..

mamamia88 wrote:

You can change the cache directory in pacman.conf  Heck couldn't you even write a simple bash script that rsyncs the cache wherever you want after every update?  Would be pretty simple.

Yeah i know, it's pretty simple what you describe(for that matter i may be lazy) but don't you think it'll be easy having a partition dedicated for pacman stuff where we don't need to change anything in pacman.conf or using rsync. Just i'm not sure, having this shared (pacman) partition for different arch installation because i can't do it right now on my system that's why i'm asking.

It's like:

i)   do

pacman -Syu

ii)    pacman will do all the downloading.
iii)   all the packages will be stored in (pacman) partition.
iv)   update the system.
v)    reboot
vi)   login different arch.
vii)  do

pacman -Syu

viii) no need to download anything.
ix)   update the system.
x)    Everyone is happy. smile


The short cuts are only short because they don't actually go anywhere. -- Trilby
Nothing feels better than being understood -- awayand
A pathetic dreamer smile

Offline

#8 2013-10-01 15:44:23

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: How about having a different partition for pacman related stuff..

I'm not sure why would you have multiple identical Arch installs on the same machine and what's so hard about changing a single line in pacman.conf.

There's also https://wiki.archlinux.org/index.php/Ne … cman_cache

Offline

#9 2013-10-01 15:59:30

arcon
Member
Registered: 2013-05-27
Posts: 128

Re: How about having a different partition for pacman related stuff..

karol wrote:

I'm not sure why would you have multiple identical Arch installs on the same machine and what's so hard about changing a single line in pacman.conf.

multiple arch installs - I want to have multi boot system and i love arch so "may be that's the reason".

what so hard about changing a single line - nothing, i'm thinking about a different approach.

But all i want to ask is if i do such a thing, did pacman will do it's work nicely or what??


The short cuts are only short because they don't actually go anywhere. -- Trilby
Nothing feels better than being understood -- awayand
A pathetic dreamer smile

Offline

#10 2013-10-01 16:07:16

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,739

Re: How about having a different partition for pacman related stuff..

You may have trouble when it comes to the linux package.  By default, the boot partition will use the same kernel name and initrd file names in /boot.  You can either chainload two different boot partitions, or you can manually intervene.

Is this a philosophy thread, or is it a support thread.  If it is a support thread, it does not belong here.  If it is a philosophy thread, let's stay away from specific solutions.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#11 2013-10-01 18:02:38

arcon
Member
Registered: 2013-05-27
Posts: 128

Re: How about having a different partition for pacman related stuff..

roll kinda both, but more of a philosophy thread smile


The short cuts are only short because they don't actually go anywhere. -- Trilby
Nothing feels better than being understood -- awayand
A pathetic dreamer smile

Offline

#12 2013-10-01 19:16:14

mamamia88
Member
Registered: 2012-08-29
Posts: 483

Re: How about having a different partition for pacman related stuff..

arcon wrote:
karol wrote:

I'm not sure why would you have multiple identical Arch installs on the same machine and what's so hard about changing a single line in pacman.conf.

multiple arch installs - I want to have multi boot system and i love arch so "may be that's the reason".

what so hard about changing a single line - nothing, i'm thinking about a different approach.

But all i want to ask is if i do such a thing, did pacman will do it's work nicely or what??

How about just mounting the var partiton from one install on the other and setup pacman to pull from that partition?  Surerly it could be done

Offline

#13 2013-10-01 19:25:37

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,362

Re: How about having a different partition for pacman related stuff..

I have a /var/cache/pacman/pkg just for the packages so it doesn't fill up root.  It's as simple as creating a new partition and making the appropriate /etc/fstab entries.  Then you can update your other machines using pacman's -r option to that directory.  Or if they are other remote machines across the network use pacserve.When you update linux to another directory, you just have to mount a couple directories at the bottom.  But arch makes this process so easy to do.


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#14 2013-10-01 19:44:00

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: How about having a different partition for pacman related stuff..

IMO your proposed 'sources' and 'abs' directories are in the wrong place. pacman installs binary packages, it knows nothing about package building, nor does it care. I also firmly believe that all package building should be done under $HOME, not in some system directory, so that's where these resources should be.

Offline

#15 2013-10-01 19:48:20

mr.MikyMaus
Member
From: disabled
Registered: 2006-03-31
Posts: 285

Re: How about having a different partition for pacman related stuff..

mamamia88 wrote:

How about just mounting the var partiton from one install on the other and setup pacman to pull from that partition?  Surerly it could be done

not a good idea. there is a lot of system-specific data in /var. in fact, /var is probably THE system directory (save for /etc) where's what make a system the system. You certainly don't want to share the entire var with another system.

That being said, I guess it would be perfectly ok to share the /var/cache directory (or just /var/cache/pacman). It could be done by having it on a specific partition, subvolume (btrfs), binded or symlinked. It should not affect pacman in any (negative) way.

However, just to clarify, that directory is not the pacman directory, it's just an unimportant, expendable cache. The actual pacman directory is /var/lib/pacman and that should definitely be kept clean of any interference.

just my $0.05

-miky.


What happened to Arch's KISS? systemd sure is stupid but I must have missed the simple part ...

... and who is general Failure and why is he reading my harddisk?

Offline

#16 2013-10-01 20:08:54

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,787
Website

Re: How about having a different partition for pacman related stuff..

tomk wrote:

IMO your proposed 'sources' and 'abs' directories are in the wrong place. pacman installs binary packages, it knows nothing about package building, nor does it care. I also firmly believe that all package building should be done under $HOME, not in some system directory, so that's where these resources should be.

So long as people build in clean chroots, they can store their source files wherever they want imo. tongue


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#17 2013-10-01 21:07:31

Awebb
Member
Registered: 2010-05-06
Posts: 6,275

Re: How about having a different partition for pacman related stuff..

You don't even need a mount point or bind mount. On my media center, I have Arch on the SSD and /var/cache/pacman behind a symlink pointing at the HDD raid on its own LVM volume. I don't have tested every possible catastrophe scenario, but the setup has been running for two years without hickups now.

Offline

#18 2013-10-01 21:32:55

mamamia88
Member
Registered: 2012-08-29
Posts: 483

Re: How about having a different partition for pacman related stuff..

mr.MikyMaus wrote:
mamamia88 wrote:

How about just mounting the var partiton from one install on the other and setup pacman to pull from that partition?  Surerly it could be done

not a good idea. there is a lot of system-specific data in /var. in fact, /var is probably THE system directory (save for /etc) where's what make a system the system. You certainly don't want to share the entire var with another system.

That being said, I guess it would be perfectly ok to share the /var/cache directory (or just /var/cache/pacman). It could be done by having it on a specific partition, subvolume (btrfs), binded or symlinked. It should not affect pacman in any (negative) way.

However, just to clarify, that directory is not the pacman directory, it's just an unimportant, expendable cache. The actual pacman directory is /var/lib/pacman and that should definitely be kept clean of any interference.

just my $0.05

-miky.

Hey cool thanks for that.  Now I know where to find files provided by a package without visiting the package database on here. And isn't the cache important for if an upgrade causes issues because that's where the old versions are stored?

Offline

#19 2013-10-01 21:57:52

Awebb
Member
Registered: 2010-05-06
Posts: 6,275

Re: How about having a different partition for pacman related stuff..

mamamia88 wrote:

And isn't the cache important for if an upgrade causes issues because that's where the old versions are stored?

Yes, it isn't. The last time I had to downgrade a package that had something to do with the network connection and had no Arch installer or other live distro at hand to download it, was never. I only kept the cache, when I was without an internet connection for a few months last year, because I wanted to mess around with Arch regardless.

Offline

#20 2013-10-02 05:25:31

arcon
Member
Registered: 2013-05-27
Posts: 128

Re: How about having a different partition for pacman related stuff..

WorMzy wrote:
tomk wrote:

IMO your proposed 'sources' and 'abs' directories are in the wrong place. pacman installs binary packages, it knows nothing about package building, nor does it care. I also firmly believe that all package building should be done under $HOME, not in some system directory, so that's where these resources should be.

So long as people build in clean chroots, they can store their source files wherever they want imo. tongue

Yes, that is the reason why i put sources and abs directories in (/var/cache/pacman) but i'm not sure how safe it is now??

Awebb wrote:

I have Arch on the SSD and /var/cache/pacman behind a symlink pointing at the HDD raid on its own LVM volume.

symlink is fine, but i'm looking at the possibilty where one can share that drive with friends or girlfriend(i never had one sad so i likely to share it with my friends) to update our systems, not only on a single machine but even on different one's too.

mamamia88 wrote:
mr.MikyMaus wrote:
mamamia88 wrote:

How about just mounting the var partiton from one install on the other and setup pacman to pull from that partition?  Surerly it could be done

not a good idea. there is a lot of system-specific data in /var. in fact, /var is probably THE system directory (save for /etc) where's what make a system the system. You certainly don't want to share the entire var with another system.

That being said, I guess it would be perfectly ok to share the /var/cache directory (or just /var/cache/pacman). It could be done by having it on a specific partition, subvolume (btrfs), binded or symlinked. It should not affect pacman in any (negative) way.

However, just to clarify, that directory is not the pacman directory, it's just an unimportant, expendable cache. The actual pacman directory is /var/lib/pacman and that should definitely be kept clean of any interference.

just my $0.05

-miky.

Hey cool thanks for that.  Now I know where to find files provided by a package without visiting the package database on here.

Yes, thanks!!
I previously knew about it but now i *understand*.
But as i see, is there any specific reason for having "sync " directory in "/var/lib/pacman" instead of "/var/cache/pacman".

Last edited by arcon (2013-10-02 05:26:05)


The short cuts are only short because they don't actually go anywhere. -- Trilby
Nothing feels better than being understood -- awayand
A pathetic dreamer smile

Offline

#21 2013-10-02 11:05:30

Awebb
Member
Registered: 2010-05-06
Posts: 6,275

Re: How about having a different partition for pacman related stuff..

arcon wrote:

But as i see, is there any specific reason for having "sync " directory in "/var/lib/pacman" instead of "/var/cache/pacman".

Make sure you have read and understood the Filesystem Hierarchy Standard. Be adviced, that there have been many changes (the current version is 9 years old), but the general idea persists.

More specifically, the cache tree must be able to be reproduced by the respective application, while the lib tree contains variable information about the state of the system. Package information is "state information", so it has nothing to do in cache, while tarballs of installed packages are not required for the system to function. In Arch's case, they are not required for updates either, so they are only kept, as long as pacman needs them (for the installation) and are not discarded, because it has shown to be convenient for the user to have access to all sorts of program caches.

About the girlfriend part... brush your teeth, clip your nails, trim your beard and smell good. That's the base group. They might come to you automatically. However, actively spending time around women increases your chances, so the base-devel group contains the urge to be social and refining your conversation skills. See the AUR for specific tools.

Offline

#22 2013-10-02 13:56:23

arcon
Member
Registered: 2013-05-27
Posts: 128

Re: How about having a different partition for pacman related stuff..

Awebb wrote:

Make sure you have read and understood the Filesystem Hierarchy Standard. Be adviced, that there have been many changes (the current version is 9 years old), but the general idea persists.

Thanks!!

Awebb wrote:

More specifically, the cache tree must be able to be reproduced by the respective application, while the lib tree contains variable information about the state of the system. Package information is "state information", so it has nothing to do in cache, while tarballs of installed packages are not required for the system to function. In Arch's case, they are not required for updates either, so they are only kept, as long as pacman needs them (for the installation) and are not discarded, because it has shown to be convenient for the user to have access to all sorts of program caches.

sad it means all the ".db" files should go into that cache pacman directory and all the sylinks to those ".db" files should go in lib pacman directory.

Awebb wrote:

About the girlfriend part... brush your teeth, clip your nails, trim your beard and smell good. That's the base group. They might come to you automatically. However, actively spending time around women increases your chances, so the base-devel group contains the urge to be social and refining your conversation skills. See the AUR for specific tools.

base group already installed and while doing installation for base-devel: i'm getting this error "404: package could not be found" and on the other hand, don't know what to search in AUR.


The short cuts are only short because they don't actually go anywhere. -- Trilby
Nothing feels better than being understood -- awayand
A pathetic dreamer smile

Offline

#23 2013-10-02 15:06:33

Awebb
Member
Registered: 2010-05-06
Posts: 6,275

Re: How about having a different partition for pacman related stuff..

arcon wrote:
Awebb wrote:

More specifically, the cache tree must be able to be reproduced by the respective application, while the lib tree contains variable information about the state of the system. Package information is "state information", so it has nothing to do in cache, while tarballs of installed packages are not required for the system to function. In Arch's case, they are not required for updates either, so they are only kept, as long as pacman needs them (for the installation) and are not discarded, because it has shown to be convenient for the user to have access to all sorts of program caches.

sad it means all the ".db" files should go into that cache pacman directory and all the sylinks to those ".db" files should go in lib pacman directory.

No, it means, that you should really take your time reading the FHS document. A database is not a cache item. Pacman does not create the database on its own as a result of its actions. Pacman has no means to reconstruct the local database, should the file be missing. Browse through your /var/cache folder, look at the files. In simple terms, cache is like tmp, but unlike tmp, that only holds volatile data, that will be deleted on reboot, files in cache probably have a reason to be kept, so the respective program does not need to repeat all the work after a reboot.

Offline

#24 2013-10-02 16:25:20

arcon
Member
Registered: 2013-05-27
Posts: 128

Re: How about having a different partition for pacman related stuff..

Awebb wrote:

No, it means, that you should really take your time reading the FHS document. A database is not a cache item.

I will study, and i know database is not cache whereas data items can be cached.

But here, thing is about having a different partition for pacman cache and for that matter "*.db" files is also be needed because whole /var would be a overhead and also one partition could not be mounted on two directories(i may be wrong here) so the options left are:
i) place *.db of sync to pacman partition and symlink it to sync.
ii) Or tell pacman to blindly install pakages without the need of a database.(it somewhat is a vague approach and don't know if it can be done, but seems cool).

guys if you think it is not going in the right direction, please tell i'll stop.


The short cuts are only short because they don't actually go anywhere. -- Trilby
Nothing feels better than being understood -- awayand
A pathetic dreamer smile

Offline

#25 2013-10-04 13:44:17

mr.MikyMaus
Member
From: disabled
Registered: 2006-03-31
Posts: 285

Re: How about having a different partition for pacman related stuff..

arcon wrote:

But here, thing is about having a different partition for pacman cache and for that matter "*.db" files is also be needed because whole /var would be a overhead and also one partition could not be mounted on two directories(i may be wrong here) so the options left are:
i) place *.db of sync to pacman partition and symlink it to sync.
ii) Or tell pacman to blindly install pakages without the need of a database.(it somewhat is a vague approach and don't know if it can be done, but seems cool).

guys if you think it is not going in the right direction, please tell i'll stop.

Neither is a good idea. Although I'm not sure what you want to acheive here. It is quite possible to have a partition (say sda3) mounted to /var and another partition (say sda4) mounted to /var/cache. There is no reason to treat the cache together with pacman control files.

As for mounting a partition to two places: this could be possible for some filesystems but it's unwise. A proper solution would be avoiding hierarchy duplication at all or using symlinks in specific scenarios. There is also one other way where symlinks are not feasible: mount-binding. You can mount an existing directory to another, resulting in two identical hierarchies under different directories - the result is similar to a directory hard link. Anyway, this should be avoided if possible.

-m.


What happened to Arch's KISS? systemd sure is stupid but I must have missed the simple part ...

... and who is general Failure and why is he reading my harddisk?

Offline

Board footer

Powered by FluxBB