Gentoo Archives: gentoo-user

From: dhk <dhkuhl@×××××××××.net>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: Installing Gentoo via Gentoo ?
Date: Sun, 18 Apr 2010 16:30:45
Message-Id: 4BCB33AC.8090808@optonline.net
In Reply to: Re: [gentoo-user] Re: Installing Gentoo via Gentoo ? by meino.cramer@gmx.de
1 On 04/18/2010 10:37 AM, meino.cramer@×××.de wrote:
2 > dhk <dhkuhl@×××××××××.net> [10-04-18 16:20]:
3 >> On 04/18/2010 09:58 AM, Grant Edwards wrote:
4 >>> On 2010-04-18, Lie Ryan <lie.1296@×××××.com> wrote:
5 >>>
6 >>>> Yes, you should be able to, installing Gentoo is basically just copying
7 >>>> a bunch of files to a partition in a harddisk, nothing magical.
8 >>>
9 >>> Precisely.
10 >>>
11 >>>> However, you will have to be able to compile a compatible kernel from
12 >>>> your PC. Compatible usually means either your PC have the same
13 >>>> architecture as your laptop (which means everything should be already
14 >>>> setup) or you have to cross-compile the kernel.
15 >>>
16 >>> Cross compiling the kernel is fairly trivial, but you need a
17 >>> cross-toolchain. Building one with crosstool-NG isn't too hard, but
18 >>> its' not trivial either.
19 >>>
20 >>>> I've never done kernel cross-compiling, but it's definitely possible,
21 >>>> you just need to modify modify some of the Makefile manually (search on
22 >>>> google for a howto).
23 >>>
24 >>> You don't actually need to modify the Makefile if you don't want to.
25 >>> You can do it from the command line:
26 >>>
27 >>> make ARCH=targetarch CROSS_COMPILE=/path/to/cross/compiler
28 >>>
29 >>
30 >> I'm about to do the same thing. My current disk is almost full and my
31 >> /usr partition isn't big enough, most of the time I can get it down to
32 >> 95% but often goes to 100%. In the next week or two I will move my
33 >> system to another drive with lvm or at least a different partition
34 >> configuration. I'll either do a fresh install or a stage4 install. You
35 >> may want to look into that: a stage4 install. The documentation is at
36 >> http://en.gentoo-wiki.com/wiki/Custom_Stage4 and it looks pretty good
37 >> and simple. This may be the way you want to go.
38 >>
39 >> dhk
40 >>
41 >
42 > Hi dhk,
43 >
44 > ...same reasons here: A two small harddisk, a system, which suffers
45 > from to less experience as at was initially installed and a person,
46 > who wants a fresh one in no time, since time cannot be bought in re-
47 > peatedly bigger amounts as with harddisks :)
48 >
49 > Thank you very much in advance for the hint, dhk!
50 > One question: Is it possible to install a new system while starting
51 > with an initially empty "world" file, which will be populated then
52 > while the configuration/installation process?
53 >
54 > keep hacking!
55 > mcc
56 >
57 >
58
59 I'm not an expert, but I think it is possible.
60
61 Beware I haven't done this yet, but this is the procedure I'm going to
62 try in the the next couple of weeks.
63
64 Do the following in a terminal window from your working system.
65 1) Plug in the new drive.
66 2) Boot your machine as usual to the old Gentoo.
67 3) Run fdisk on the new drive to make partitions you want on your new
68 system (fdisk /dev/sdb).
69 4) Make your file systems with mke2fs and mkswap, then run swapon
70 /dev/sdb?.
71 5) Make all the mount points for all your partitions, but instead of
72 doing it on your new drive do it on your old drive in the /mnt directory
73 (mkdir -p /mnt/sdb/boot /mnt/sdb/tmp /mnt/sdb/usr /mnt/sdb/var . . .)
74 and make one extra mount point for your old system bin (mkdir -p
75 /mnt/sdb/oldsysbin).
76 6) Mount the directories on /dev/sdb from /dev/sda (mount -t ext3
77 /dev/sdb7 /mnt/sdb/usr).
78 7) Mount your old system bin for the tar command. My tar is in /bin and
79 /bin is on (df -k /bin) /dev/sda3. Run "mount -t ext3 /dev/sda3
80 /mnt/oldsys/" to mount the bin directory.
81 8) Make the stage4. At the end of the documentation in the link above
82 there are scripts that seem to work. Make sure you change the
83 stage4Location in mkstage4.sh to some place with a lot of room. In this
84 example I'd change it to "stage4Location=/mnt/sdb/usr/" remembering the
85 trailing slash. Making it could take a few hours.
86 9) Now the tricky part. So not to confuse the root partitions (the old
87 and new) I would do a chroot. Run: chroot /mnt/sdb /bin/bash and export
88 PS1="(chroot) $PS1" .
89 10) Install the stage4. Change to the /usr directory and if all is
90 correct you should see your stage4 there. Do a df -k also to make sure
91 everything looks right. Now install the stage4, run: /oldsys/bin/tar
92 xvjpf stage4-*.tar.bz2
93
94 When this is done exit chroot and umount everything in /mnt/sdb. Shut
95 down the machine. If all went well you should now be able to unplug
96 either drive and boot to the other. I would boot to the old drive first
97 to make sure that still works as if nothing happened. Then shutdown,
98 unplug the old drive and plug in the new drive. See if you can boot to
99 the new drive. This should be a mirror image of the old drive with the
100 new partition sizes.
101
102 Once again, I haven't tried this yet. Maybe solicit some other
103 opinions. I don't think it will affect the original system and it
104 should allow you to work in another terminal while your building the new
105 drive.
106
107 Does this make sense. Let me know if it works.
108
109 Good luck,
110
111 dhk

Replies

Subject Author
Re: [gentoo-user] Re: Installing Gentoo via Gentoo ? dhk <dhkuhl@×××××××××.net>