View previous topic :: View next topic |
Author |
Message |
toralf Developer
Joined: 01 Feb 2004 Posts: 3922 Location: Hamburg
|
Posted: Sun Feb 16, 2014 10:47 am Post subject: putting /usr/portage into its own BTRFS file |
|
|
Inspired by http://blogs.gentoo.org/mgorny/2014/02/06/using-deltas-to-speed-up-squashfs-updates/ I created a 1.5 GB file /var/lib/portage.fs Code: | dd if=/dev/zero of=/var/lib/portage.fs bs=1024 count=1500K
mkfs.btrfs /var/lib/portage.fs | with BTRFS and moved all directories of /usr/portage/* into it. Before I moved ./distfiles out to /var/lib and symlinked it back afterwards: Code: | mv /usr/portage/distfiles /var/lib/ && ln -s /var/lib/distfiles /usr/portage/ | With the following entry in /etc/fstab : Code: | /var/lib/portage.fs /usr/portage btrfs auto,noatime,compress=lzo | the portage directory is mounted automatically.
Advantage: a huge speed up in the rsync process for my very slow external hard disk.
Update: added used commands/Update
Last edited by toralf on Mon Feb 17, 2014 9:31 pm; edited 2 times in total |
|
Back to top |
|
|
dambacher Apprentice
Joined: 11 Feb 2003 Posts: 289 Location: Germany
|
Posted: Sun Feb 16, 2014 1:27 pm Post subject: |
|
|
I put everything about portage and layman to /pkg
wich is on an extra subvolume.
And I removed everything from the the original places, without leaving links and set in make.conf:
Code: | # install my portage and layman files to /pkg
PORTDIR="/pkg/portage"
DISTDIR="/pkg/distfiles"
PKGDIR="/pkg/packages"
PORTDIR_OVERLAY="
/pkg/overlays/gentoo-ulda
$PORTDIR_OVERLAY
"
source /pkg/layman/make.conf
|
and layman.conf:
Code: | storage : /pkg/layman
|
|
|
Back to top |
|
|
kernelOfTruth Watchman
Joined: 20 Dec 2005 Posts: 6111 Location: Vienna, Austria; Germany; hello world :)
|
|
Back to top |
|
|
toralf Developer
Joined: 01 Feb 2004 Posts: 3922 Location: Hamburg
|
Posted: Mon Feb 17, 2014 8:02 pm Post subject: |
|
|
FWIW it is important to mount the BTRFS file with option compres=... before you move the data. Then the effect of the compression is maximal as seen here : Code: | # df -m
Filesystem 1M-blocks Used Available Use% Mounted on
...
/dev/loop1 400 63 334 16% /var/db/pkg
/dev/loop0 1500 571 736 44% /usr/portage
# du -ms /usr/portage/
724 /usr/portage/
# du -ms /var/db/pkg
182 /var/db/pkg |
And of course /var/tmp/portage is on a tmpfs : Code: | # grep /var/tmp/portage /etc/fstab
tmpfs /var/tmp/portage tmpfs auto,noatime,size=4G
|
|
|
Back to top |
|
|
John R. Graham Administrator
Joined: 08 Mar 2005 Posts: 10587 Location: Somewhere over Atlanta, Georgia
|
Posted: Mon Feb 17, 2014 9:21 pm Post subject: |
|
|
Moved from Installing Gentoo to Documentation, Tips & Tricks. I think this is worthy of preserving where it won't get lost in the chaff. Might even deserve a sticky.
- John _________________ I can confirm that I have received between 0 and 499 National Security Letters. |
|
Back to top |
|
|
|