|
![]() |
GENERALDue to Gentoo Linux is so hard to build and compile for X86/32/64 platform, we offer a how to about making clones copies. This is related to help final users and friens with our experience because they may be doesn't have a hi-speed DSL or a good processor to run the gcc all the time, then we use to build on a distcc cluster or a much power PC for generic installations, they don't have that kind of hardware.HOW TO USEThe script should be modified, on the versions of Gentoo I ever build I have a special folder where gentoo stores the source code tarballs of almost the whole system, it is on /usr/portage/distfiles I use to move up to root folder /distfiles and placing a symlink to replace them, we suposse we have the root folder and /usr/portage folder on the same partition, we need to do that:
cd /usr/portage ls -lsh distfilesif you see a symlink to /distfiles leave it there if you don't see distfiles folder then may be your gentoo is a new one based on 2005.X. if you still having a real and big folder, move them to root folder: mv distfiles / ln -s /distfiles distfilesthat's all about the sources, you can back up this folder without compressing them, cause is already compressed. DOWNLOAD & INSTALLThe next steep is installing this script, you should copy it on the root folder [download] and places on /, to write on / you may need root access.
WARN: you can not backup your running system, cause special folders like /proc or /sys, or /dev have special nodes, this special nodes should not be stored cause this information is generated by Linux Kernel. You'll got garbage. Go to your GentooLiveCD and make two folders on root mkdir /mygentoo mkdir /mystoremount the system onto /mygentoo folder, you don't need to chroot your system we will use the LiveCD, mount your second partition where you wish to put the tarballs or the network shared onto /mystore folder, if you have files ordered you may be want to place all tarballs in a separated gentoo folder, make them: mount /dev/mysys /mygentoo mount /dev/mystore /mystore mkdir /mystore/gentoogo to /mygentoo folder, remember you already have mkBackup in the root folder. modify with nano if it's neccesary, there is the header of the script: #!/bin/bash #FOLDER CONFIG export FOLDERS="bin sbin boot etc root media tmp proc compartir dev mnt server srv sys cdrom dvd floppy" export BIGFOLDERS="usr opt home lib var" export REALLYBIGFOLDERS="usr/portage lib/modules usr/local usr/src usr/share usr/X11R6 usr/loki opt/kde3 usr/kde usr/lib" export DEST="/mystore/gentoo" ... ...As we see, we have 3 kind of folders:
cd /mygentoo ./mkBackupWARN: you need to go inside cause is a requirement, if you don't you'll got garbage+GentooLiveCD. USING THE TARBALLS
We have now the tarballs of our Gentoo Linux system on the network or a hard drive or a DVD drive on the system, run your LiveCD again in the empty computer, part your hard drive as required, mount your new root partition onto /mygentoo folder and the tarballs patition or network shared onto /mystore folder.
mkdir /mygentoo mkdir /mystore mount /dev/empty /mygentoo mount /dev/store /mystore cd /mygentoothen we are ready to install the packaged tarballs one by one with this single line: find /mystore/gentoo | while read tarball; do tar -xzvf "$tarball" ; donethat's all, or if you prefer more quiet and with an unpack test: find /mystore/gentoo -type f | while read tarball do echo -n "$tarball"; if tar -xzf "$tarball" then echo ":Ok" else echo "$tarball" > /error.txt echo ":Fail" fi; doneyou can check the file error.txt to see if some tarball are corrupted (you can have corrupted tarballs even you have new hard drives, if you get some XFS crash or NVIDIA crash some times I got a lot of corrupted tarballs). Then now you can chroot the new system you can copy the /distfiles folder and reinstall following the Gentoo Manual the lilo or grub as you did the 1st time, chapter 10, Installing the boot loader. WARN: You should never put distfiles on the same folders you put the tarballs of gentoo, if you do so, then you got every source package uncompressed on root folder uhhh :P |