Gentoo Archives: gentoo-user

From: "Alan E. Davis" <lngndvs@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Moving root filesystem to a new partition
Date: Fri, 27 Nov 2009 02:02:07
Message-Id: 7bef1f890911261659x4610ec44w8d57a5f58bd816b@mail.gmail.com
In Reply to: Re: [gentoo-user] Moving root filesystem to a new partition by Dale
1 I bind mounted / then copied /dev to the new partition. This was advice
2 given earlier, the first time it happened to me: I finally found an earlier
3 replay to a similar request from me. All is now well.
4
5 Thank you for the advice.
6
7 Alan
8
9 On Tue, Nov 24, 2009 at 12:31 PM, Dale <rdalek1967@×××××.com> wrote:
10
11 > Francisco Ares wrote:
12 >
13 >
14 >>
15 >> On Mon, Nov 23, 2009 at 8:51 PM, Dale <rdalek1967@×××××.com <mailto:
16 >> rdalek1967@×××××.com>> wrote:
17 >>
18 >> Alan E. Davis wrote:
19 >>
20 >> Can someone tell me what steps are necessary to move the /
21 >> filesystem to a new partition? I recall someone helping me
22 >> with this before, but cannot find the email. The oldest of
23 >> three drives on my system had my / partition, /dev/sdc1. One
24 >> day recently, that partition became inaccessable. After
25 >> quickly installing Ubuntu on a different drive, that root
26 >> partition eventually showed up again.
27 >> So I've been able to boot Gentoo again off the separate /boot
28 >> partition on /dev/sda1. I need to move that / partition. I
29 >> have several other partitions mounted off this one, mainly as
30 >> /usr and maybe /usr/local/, and some storage partitions
31 >> mounted to my home directory.
32 >> I copied the root (/) partition with the new partition at
33 >> /dev/sdb5 mounted as /newroot, using
34 >> # cp -ax / /newroot
35 >>
36 >> I checked that /proc, /dev, and /sys are there, and empty. I
37 >> recall there are some other steps necessary. I changed
38 >> /etc/fstab, and the grub2 grub.cfg from ubuntu, the entry for
39 >> this kernel. The boot stalls at a certain point. May I
40 >> ask what steps are necessary to do this?
41 >>
42 >> Thank you,
43 >>
44 >> Alan Davis
45 >>
46 >>
47 >> I have done this in the past. I usually boot the CD, make mount
48 >> points for old and new, then mount the old and new that I want to
49 >> copy. Then I do a cp -av /path/to/old /path/to/new/ and let it
50 >> copy. This can take quite a bit of time tho. It seems those
51 >> little bitty files take the longest. Maybe omitting the -v option
52 >> would help on that?
53 >>
54 >> Once you get it copied over, edit your fstab file as needed on the
55 >> new side and install the bootloader as well. After that, it
56 >> usually just works.
57 >>
58 >> Dale
59 >>
60 >> :-) :-)
61 >> P. S. Sorry for not including some fancy tarball stuff. ;-)
62 >>
63 >>
64 >>
65 >> Well, as far as I know one would like to edit the bootloader configuration
66 >> as well, so as to reflect the new root directory.
67 >>
68 >> Or has anyone written this before and I didn't notice? ;-)
69 >>
70 >> Francisco
71 >>
72 >> --
73 >> "If you have an apple and I have an apple and we exchange apples then you
74 >> and I will still each have one apple. But if you have an idea and I have one
75 >> idea and we exchange these ideas, then each of us will have two ideas." -
76 >> George Bernard Shaw
77 >>
78 >
79 > If it needs to be then sure. I usually move things file wise with cp then
80 > move things physically in the case as well. My OS is always on hda. The
81 > grub config is on hda1 and grub bootloader is on the MBR of hda as well.
82 > So, I don't have to edit grub on mine. I do boot once by using the edit
83 > feature of grub, just to make sure before I move things physically.
84 >
85 > You do have to plan these things tho. Wouldn't hurt to write down on paper
86 > where everything is and don't erase anything until you are sure your ducks
87 > are in a row. Maybe even write notes on the drive with a post it note.
88 > Dale
89 >
90 > :-) :-)
91 >
92 >