Oh, this is an old trick. I remember using it with portage. Some remarks:
mount point doesn't have to be empty, so you can keep your database backup in /var/lib/pacman (after umounting)
no need to compress old database. Simply mount the image somewhere and copy all files there.
XFS is better for cache-like filesystems, so you may try to use mkfs.xfs.
If your mkfs has to take device instead of file (it works on now on my arch but I remember having problems with it) use:
# losetup /dev/loop0 pacman.xfs
# mkfs.xfs /dev/loop0
# mount /dev/loop0 /var/lib/pacman
9 comments
I just wanted to upvote the blog for including undo instructions.
The pacman database is insanely inefficient. Merging it into one file increases performance dramatically (I know because I've done it).
in the future pacman would read directly from core.db.tar.gz and the speed is noticeable (translation HUGE improvement)
Oh, this is an old trick. I remember using it with portage. Some remarks:
mount point doesn't have to be empty, so you can keep your database backup in /var/lib/pacman (after umounting)
no need to compress old database. Simply mount the image somewhere and copy all files there.
XFS is better for cache-like filesystems, so you may try to use mkfs.xfs.
If your mkfs has to take device instead of file (it works on now on my arch but I remember having problems with it) use: # losetup /dev/loop0 pacman.xfs # mkfs.xfs /dev/loop0 # mount /dev/loop0 /var/lib/pacman
After this you can do simple mount -o loop
you'd have to benchmark before choosing xfs or reiser. Reiser is very fast in small files, like the ones used by pacamn.
Well I'll be damned, this is much faster.
For pacman -Syy, just on my root partition: 0m7.187s And the same on a 100mb reiserfs: 0m2.151s
Searching is much faster too, though harder to calculate. To search for "fish" there's a difference of 12 seconds vs 0.4 seconds.
The most elegant solution would be a SQLite backend for
pacman. But until then this will do just fine.I have a question: Is it possible or worthwhile to do this to any other parts of the system?
upvoted for yo dawg