View previous topic :: View next topic |
Author |
Message |
carpman Advocate
Joined: 20 Jun 2002 Posts: 2202 Location: London - UK
|
Posted: Thu Dec 16, 2004 11:16 am Post subject: build for another system |
|
|
Hello, ok i need to save some time on an install. I am waiting for server to arrive but would like to build base system from stage 1 on current machine and be able to tar it and then untar onto server when i get it.
Server will by P3 current system amd 64bit running 32 bit gentoo .
Any howtos about?
did a search but got so many which did fit the bill.
cheers _________________ Work Station - 64bit
Gigabyte GA X48-DQ6 Core2duo E8400
8GB GSkill DDR2-1066
SATA Areca 1210 Raid
BFG OC2 8800 GTS 640mb
--------------------------------
Notebook
Samsung Q45 7100 4gb |
|
Back to top |
|
|
Fleta n00b
Joined: 12 Dec 2004 Posts: 68
|
|
Back to top |
|
|
carpman Advocate
Joined: 20 Jun 2002 Posts: 2202 Location: London - UK
|
Posted: Thu Dec 16, 2004 11:45 am Post subject: |
|
|
thanks for reply, but i don't a windows based install and do wnat to do a stage1 install as i want to to do ntpl and udev system plus optimise for server usage. _________________ Work Station - 64bit
Gigabyte GA X48-DQ6 Core2duo E8400
8GB GSkill DDR2-1066
SATA Areca 1210 Raid
BFG OC2 8800 GTS 640mb
--------------------------------
Notebook
Samsung Q45 7100 4gb |
|
Back to top |
|
|
Fleta n00b
Joined: 12 Dec 2004 Posts: 68
|
|
Back to top |
|
|
carpman Advocate
Joined: 20 Jun 2002 Posts: 2202 Location: London - UK
|
Posted: Thu Dec 16, 2004 1:05 pm Post subject: |
|
|
Thanks for that, what i really want to know is can i create a dir on current system, chroot into and build system for P3?
If so what is best way and what tar option to use when tarring it up ready for new system? _________________ Work Station - 64bit
Gigabyte GA X48-DQ6 Core2duo E8400
8GB GSkill DDR2-1066
SATA Areca 1210 Raid
BFG OC2 8800 GTS 640mb
--------------------------------
Notebook
Samsung Q45 7100 4gb |
|
Back to top |
|
|
Fleta n00b
Joined: 12 Dec 2004 Posts: 68
|
Posted: Thu Dec 16, 2004 1:38 pm Post subject: |
|
|
Sure you can do that, just copy over resolv.conf and chroot as usual (no need to mount proc or dev).
When you finish, you can:
Code: | # cd /mnt/gentoo (say this is your temp dir)
# tar -cj --exclude-from /root/exclude-list -pivOf /path/to/the-tar-ball *
|
Write the exclude-list file like this:
Code: | usr/portage/distfiles
var/tmp/portage
home/yourusername/music
home/yourusername/video |
|
|
Back to top |
|
|
carpman Advocate
Joined: 20 Jun 2002 Posts: 2202 Location: London - UK
|
Posted: Thu Dec 16, 2004 1:52 pm Post subject: |
|
|
Cheers, what i was looking for, though question on the exclude list, i take it i do the tar after leaving chroot?
if so i just add any dir/partitions from main install so it just tarballs the new build i have just created or is this to exclude portage stuff so as to keep tarball smaller?
Also do i have to use /mnt to do install?
Or can i use another dir for building on another partitions which has more space?
cheers _________________ Work Station - 64bit
Gigabyte GA X48-DQ6 Core2duo E8400
8GB GSkill DDR2-1066
SATA Areca 1210 Raid
BFG OC2 8800 GTS 640mb
--------------------------------
Notebook
Samsung Q45 7100 4gb |
|
Back to top |
|
|
Fleta n00b
Joined: 12 Dec 2004 Posts: 68
|
Posted: Thu Dec 16, 2004 2:01 pm Post subject: |
|
|
Yes you need to exit the chroot environment first.
The tar command only packs the things in /mnt/gentoo. The directories in the 'exclude-list' file refer to the directories in /mnt/gentoo (namely the directories of your new build and thus you need to 'cd /mnt/gentoo' first, and write 'usr/portage/distfiles' instead of '/usr/portage/distfiles').
Yes you may use any temp dir you like to build your new system. |
|
Back to top |
|
|
carpman Advocate
Joined: 20 Jun 2002 Posts: 2202 Location: London - UK
|
Posted: Thu Dec 16, 2004 2:11 pm Post subject: |
|
|
cheers _________________ Work Station - 64bit
Gigabyte GA X48-DQ6 Core2duo E8400
8GB GSkill DDR2-1066
SATA Areca 1210 Raid
BFG OC2 8800 GTS 640mb
--------------------------------
Notebook
Samsung Q45 7100 4gb |
|
Back to top |
|
|
Hauser l33t
Joined: 27 Dec 2003 Posts: 650 Location: 4-dimensional hyperplane
|
Posted: Thu Dec 16, 2004 2:39 pm Post subject: |
|
|
An small trick for you, carpman. After you unpack a stage tarball and chroot, you may mount your host partition somewhere, say /mnt/host, then do:
Code: | # ln -s /mnt/host/usr/portage /usr/portage |
_________________ AMD Athlon XP 2600+; 512M RAM;
nVidia FX5700LE; Hitachi 120Gb
2.6.9-nitro4, reiser4, linux26-headers+nptl
Do I like to compile everything?
Positive definite! |
|
Back to top |
|
|
carpman Advocate
Joined: 20 Jun 2002 Posts: 2202 Location: London - UK
|
Posted: Sat Dec 18, 2004 5:02 pm Post subject: |
|
|
Hauser wrote: | An small trick for you, carpman. After you unpack a stage tarball and chroot, you may mount your host partition somewhere, say /mnt/host, then do:
Code: | # ln -s /mnt/host/usr/portage /usr/portage |
|
did not get this working?
Also have aprobelm tarring install, if do:
Code: |
tar -cj --exclude-from /root/exclude-list -pivOf /storage/newinstall.tar.bz2 *
|
i get
Code: |
var/spool/postfix/private/
var/state/
var/state/.keep
tar: Error exit delayed from previous errors
|
No tarball is created?
Also can i add proc dir to exclude list?
It has a 1gb file called kcore (no kde installed) which slows down tar build.
cheers _________________ Work Station - 64bit
Gigabyte GA X48-DQ6 Core2duo E8400
8GB GSkill DDR2-1066
SATA Areca 1210 Raid
BFG OC2 8800 GTS 640mb
--------------------------------
Notebook
Samsung Q45 7100 4gb |
|
Back to top |
|
|
Hauser l33t
Joined: 27 Dec 2003 Posts: 650 Location: 4-dimensional hyperplane
|
Posted: Sat Dec 18, 2004 5:11 pm Post subject: |
|
|
carpman wrote: | Hauser wrote: | An small trick for you, carpman. After you unpack a stage tarball and chroot, you may mount your host partition somewhere, say /mnt/host, then do:
Code: | # ln -s /mnt/host/usr/portage /usr/portage |
|
did not get this working?
|
What did you get? I assume you didn't have the portage directory before you tried this, ie before you do 'emerge sync'.
BTW the proc in your build directory should be empty. _________________ AMD Athlon XP 2600+; 512M RAM;
nVidia FX5700LE; Hitachi 120Gb
2.6.9-nitro4, reiser4, linux26-headers+nptl
Do I like to compile everything?
Positive definite! |
|
Back to top |
|
|
carpman Advocate
Joined: 20 Jun 2002 Posts: 2202 Location: London - UK
|
Posted: Sat Dec 18, 2004 5:32 pm Post subject: |
|
|
Hauser wrote: | carpman wrote: | Hauser wrote: | An small trick for you, carpman. After you unpack a stage tarball and chroot, you may mount your host partition somewhere, say /mnt/host, then do:
Code: | # ln -s /mnt/host/usr/portage /usr/portage |
|
did not get this working?
|
What did you get? I assume you didn't have the portage directory before you tried this, ie before you do 'emerge sync'.
BTW the proc in your build directory should be empty. |
Hello, can't remember but will make note next time i try, have p2 notebook this type install will work for.
When i say proc, i mean the proc dir after i have done install and emerged few apps in newinstall chroot, can i safely del content of proc? would have to chroot back in newinstall dir or can i just delete contents?
cheers _________________ Work Station - 64bit
Gigabyte GA X48-DQ6 Core2duo E8400
8GB GSkill DDR2-1066
SATA Areca 1210 Raid
BFG OC2 8800 GTS 640mb
--------------------------------
Notebook
Samsung Q45 7100 4gb |
|
Back to top |
|
|
Hauser l33t
Joined: 27 Dec 2003 Posts: 650 Location: 4-dimensional hyperplane
|
Posted: Sat Dec 18, 2004 6:00 pm Post subject: |
|
|
I guess you mount proc before you chroot, there's no need to do that. I have a system on another partition on my machine, I can chroot into it and emerge and do many other things, all along the proc is empty.
As to the link thing, it ought to work if you think about the idea (it works perfectly ok on my machine). Basically we are trying to utilize the portage directory in the host system, so when you do 'emerge sync', it syncs to the host system throught the link. _________________ AMD Athlon XP 2600+; 512M RAM;
nVidia FX5700LE; Hitachi 120Gb
2.6.9-nitro4, reiser4, linux26-headers+nptl
Do I like to compile everything?
Positive definite! |
|
Back to top |
|
|
carpman Advocate
Joined: 20 Jun 2002 Posts: 2202 Location: London - UK
|
Posted: Sat Dec 18, 2004 6:28 pm Post subject: |
|
|
even on my normal system /proc is not empty?
Anyway can get tar ball built but still get the same error when it finishes.
Going to tranfering it to new machine but not sure if tarball is completer with no problems _________________ Work Station - 64bit
Gigabyte GA X48-DQ6 Core2duo E8400
8GB GSkill DDR2-1066
SATA Areca 1210 Raid
BFG OC2 8800 GTS 640mb
--------------------------------
Notebook
Samsung Q45 7100 4gb
Last edited by carpman on Sat Dec 18, 2004 6:31 pm; edited 1 time in total |
|
Back to top |
|
|
Hauser l33t
Joined: 27 Dec 2003 Posts: 650 Location: 4-dimensional hyperplane
|
Posted: Sat Dec 18, 2004 6:29 pm Post subject: |
|
|
carpman wrote: | even on my normal system /proc is not empty?
|
The /proc on your host system can't be empty, otherwise your system wouldn't have been running properly. _________________ AMD Athlon XP 2600+; 512M RAM;
nVidia FX5700LE; Hitachi 120Gb
2.6.9-nitro4, reiser4, linux26-headers+nptl
Do I like to compile everything?
Positive definite! |
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20067
|
Posted: Sat Dec 18, 2004 6:39 pm Post subject: |
|
|
Moved from Installing Gentoo. _________________ Quis separabit? Quo animo? |
|
Back to top |
|
|
carpman Advocate
Joined: 20 Jun 2002 Posts: 2202 Location: London - UK
|
Posted: Sat Dec 18, 2004 6:46 pm Post subject: |
|
|
this what i thought, but when shutting machine it gets cleared out, correct?
If so this does not happen when doing a chroot install in dir on existing install, well it has not on my system!!
Still got this problem when unpacking tarball
Code: |
var/state/.keep
tar: Error exit delayed from previous errors
|
can i safely ignore this? _________________ Work Station - 64bit
Gigabyte GA X48-DQ6 Core2duo E8400
8GB GSkill DDR2-1066
SATA Areca 1210 Raid
BFG OC2 8800 GTS 640mb
--------------------------------
Notebook
Samsung Q45 7100 4gb |
|
Back to top |
|
|
Hauser l33t
Joined: 27 Dec 2003 Posts: 650 Location: 4-dimensional hyperplane
|
Posted: Sat Dec 18, 2004 6:51 pm Post subject: |
|
|
I'm not sure about the tar error. Anyway, is the new build working? _________________ AMD Athlon XP 2600+; 512M RAM;
nVidia FX5700LE; Hitachi 120Gb
2.6.9-nitro4, reiser4, linux26-headers+nptl
Do I like to compile everything?
Positive definite! |
|
Back to top |
|
|
carpman Advocate
Joined: 20 Jun 2002 Posts: 2202 Location: London - UK
|
Posted: Sat Dec 18, 2004 7:32 pm Post subject: |
|
|
Hauser wrote: | I'm not sure about the tar error. Anyway, is the new build working? |
well i have it untarred and have chrooted via livecd on new machine but needed to rebuild kernel, the resulted in error at end of build, not sure what is it so may try building kernel on main machine and transfer that over. _________________ Work Station - 64bit
Gigabyte GA X48-DQ6 Core2duo E8400
8GB GSkill DDR2-1066
SATA Areca 1210 Raid
BFG OC2 8800 GTS 640mb
--------------------------------
Notebook
Samsung Q45 7100 4gb |
|
Back to top |
|
|
carpman Advocate
Joined: 20 Jun 2002 Posts: 2202 Location: London - UK
|
Posted: Sat Dec 18, 2004 10:37 pm Post subject: |
|
|
it works, well sort of after rebooting and finding my lvm module did not load and couple of other config files had somehow lost the editing i had done. Good job i had not put /boot and / on lvm.
Well it all appears to work, i am going to try it again with p2 notebook i have, apart from compiling taking a while on it, i don't want it out of action for long.
It already has gentoo on it but i want to re-install with latest cutting edge install, ntpl, udev plus re-arrange partition and put dome on lvm.
I will make notes and document it and if no else has done it i may have my first howto
thank for help _________________ Work Station - 64bit
Gigabyte GA X48-DQ6 Core2duo E8400
8GB GSkill DDR2-1066
SATA Areca 1210 Raid
BFG OC2 8800 GTS 640mb
--------------------------------
Notebook
Samsung Q45 7100 4gb |
|
Back to top |
|
|
carpman Advocate
Joined: 20 Jun 2002 Posts: 2202 Location: London - UK
|
Posted: Sun Dec 19, 2004 12:04 am Post subject: |
|
|
spoke too soon emerge is failing with name resolution error even though i have checked configs, also few apps i emerged are not working, webmin for example.
I copied the ebuild from main pc and emerge it but it still did not with error about perl lib so am going to copy perl across and see if that helps but i suspect that the tarbal missed some files so need to find correct options for tarring up newinstall dir/files.
any have any ideas as to tar options that work?
cheers _________________ Work Station - 64bit
Gigabyte GA X48-DQ6 Core2duo E8400
8GB GSkill DDR2-1066
SATA Areca 1210 Raid
BFG OC2 8800 GTS 640mb
--------------------------------
Notebook
Samsung Q45 7100 4gb |
|
Back to top |
|
|
Hauser l33t
Joined: 27 Dec 2003 Posts: 650 Location: 4-dimensional hyperplane
|
Posted: Sun Dec 19, 2004 7:16 am Post subject: |
|
|
OK, here's what I did: I created 2 directories in /mnt
Code: | # cd /mnt
# mkdir linux iso
# mount -o loop /path/to/install-x86-universal-2004.3-r1.iso iso |
Then I put the following 2 scripts (which are basically adapted from the scripts from my how-to ) in /mnt and made them executable.
step2: Code: | cd /mnt/linux #(Go to the mountpoint where the root partition has been mounted)
tar xjvpf /mnt/iso/stages/stage3-x86-2004.3.tar.bz2 #(Extract a stage3 tarball...)
tar -xvjf /mnt/iso/snapshots/portage-20041022.tar.bz2 -C /mnt/linux/usr #(unpack a portage tree)
mkdir /mnt/linux/usr/portage/distfiles #(Create a directory for distfiles)
cp /mnt/iso/distfiles/* /mnt/linux/usr/portage/distfiles/ #(copy over distfiles)
#nano -w /mnt/linux/etc/make.conf #(Optional: edit make.conf)
cp -L /etc/resolv.conf /mnt/linux/etc/resolv.conf #(Copy over nameserver information)
mount -t proc none /mnt/linux/proc #(Mount the proc filesystem)
cp /mnt/step3 /mnt/linux #(Copy over the step3 script)
echo "
Now you can run step3!"
chroot /mnt/linux /bin/bash #(Chroot into the new environment) |
step3: Code: | env-update && source /etc/profile #(Load the necessary variables)
ln -sf /usr/share/zoneinfo/Hongkong /etc/localtime #(Set timezone information)
nano -w /etc/fstab #(edit fstab)
echo tux > /etc/hostname #(Set the system hostname)
echo home.net > /etc/dnsdomainname #(Set the system domainname)
echo nis.home.net > /etc/nisdomainname #(Set the system nisdomainname)
echo "192.168.1.1 tux.home.net tux" >> /etc/hosts #(Set the hostsfile)
echo "Have fun with Gentoo!
" >> /etc/issue #(Set the greeting message)
rc-update add domainname default #(Domain name init script)
rc-update add numlock default #(Switch on numlock)
nano -w /etc/conf.d/net #(Setup networking; dhcp-users should set iface_eth0="dhcp")
rc-update add net.eth0 default #(Start networking automatically at boot)
nano -w /etc/rc.conf #(Further system configurations)
echo "
Now you need to set your root password!"
passwd
echo "tts/0" >> /etc/securetty #(Let root to be able to log on through the serial console)
emerge metalog #(install a system logger)
rc-update add metalog default #(add it to the default runlevel)
#emerge xfsprogs #(if you've chosen to use xfs)
emerge reiserfsprogs #(if you've chosen to use reiserfs)
emerge dhcpcd #(if you need to use dhcp)
emerge genkernel #(prepare to compile a kernel)
emerge gentoo-dev-sources #(install a kernel source)
genkernel --menuconfig all #(save your config when exit)
emerge hotplug #(install hotplug)
rc-update add hotplug default #(Add it to the default runlevel)
emerge grub |
Then I executed them:
Less than 1 hour later, I've got a basic system. so I exited the chroot environment and packed the build.
Code: | # exit
# cd /mnt/linux
# tar -cj --exclude-from /root/exclude-list -pivOf /mnt/new-build.tar.bz2 * |
There're just 2 lines in my 'exclude-list' file:
Code: | usr/portage
var/tmp/portage |
Then I mounted my test partition and unpacked the tarball on it (Of course I could've done all this directly on that partition, but I wanted to test the tar command ):
Code: | # mkreiserfs -f /dev/hda12
# mount /dev/hda12 /unix/test
# cd /unix/test
# tar xjvpf /mnt/new-build.tar.bz2 |
This is what I saw at the end of the tar message:
Code: | ......
......
var/spool/cron/lastrun/
var/spool/cron/lastrun/.keep
var/spool/.keep
var/state/
var/state/.keep
# |
No error message.
After writing up an entry for this system in grub.conf, I rebooted. When I logged in as root and tried to emerge something, I got this 'make.profile' link problem; this is due to the fact that I had excluded the /usr/portage directory when I was tarring up the new system; if it were on another machine, I would have to do 'emerge sync' or rather, not to exclude the /usr/portage directory in the first place. Since I was not on another machine, I did the following:
Code: | # mkdir /usr/portage /unix
# mount /dev/hda9 /unix (hda9 is my main system)
# mount --bind /unix/usr/portage /usr/portage
# emerge xfsprogs |
One minute later, xfsprogs had been successfully emerged! _________________ AMD Athlon XP 2600+; 512M RAM;
nVidia FX5700LE; Hitachi 120Gb
2.6.9-nitro4, reiser4, linux26-headers+nptl
Do I like to compile everything?
Positive definite!
Last edited by Hauser on Sun Dec 19, 2004 5:45 pm; edited 1 time in total |
|
Back to top |
|
|
carpman Advocate
Joined: 20 Jun 2002 Posts: 2202 Location: London - UK
|
Posted: Sun Dec 19, 2004 11:28 am Post subject: |
|
|
that is basically what i did, though i did use the developers method post to get cutting edge install.
Why bother with mounting cd when you can just use stage3 tarball.
Whn in chroot i can emerge fine and connect to net but it after i have tarred new install and untarred it on new machine that i get problems, all boots ok but emerge no longer works and cannot ping firewall/router though can other boxs on network.
in my exclude file i had
proc
usr/portage/distfiles
Going to try re tarring new installing testing that locally then try again on new machine. _________________ Work Station - 64bit
Gigabyte GA X48-DQ6 Core2duo E8400
8GB GSkill DDR2-1066
SATA Areca 1210 Raid
BFG OC2 8800 GTS 640mb
--------------------------------
Notebook
Samsung Q45 7100 4gb |
|
Back to top |
|
|
carpman Advocate
Joined: 20 Jun 2002 Posts: 2202 Location: London - UK
|
Posted: Sun Dec 19, 2004 1:33 pm Post subject: |
|
|
still getting this error at end of doing tarbal
Code: |
var/state/.keep
tar: Error exit delayed from previous errors
|
and this when untarring on target machine via livecd
Code: |
var/state/.keep
tar: Error exit delayed from previous errors
|
But i don't get it when untarring on main macine, only new machine. _________________ Work Station - 64bit
Gigabyte GA X48-DQ6 Core2duo E8400
8GB GSkill DDR2-1066
SATA Areca 1210 Raid
BFG OC2 8800 GTS 640mb
--------------------------------
Notebook
Samsung Q45 7100 4gb
Last edited by carpman on Sun Dec 19, 2004 2:43 pm; edited 1 time in total |
|
Back to top |
|
|
|