1 |
On Mon, Sep 30, 2013 at 12:57:12AM +0100, Neil Bothwick wrote: |
2 |
> On Sun, 29 Sep 2013 18:31:37 -0500, Daniel Campbell wrote: |
3 |
> |
4 |
> > Curious; how is merging two filesystems done? I don't have a separate |
5 |
> > /usr and am completely unaffected by this change, but it's somewhat |
6 |
> > interesting to me. /usr stores some pretty important data on it, and I |
7 |
> > imagine you'd need to mount it somewhere else in order to move the |
8 |
> > files from it to /'s /usr dir. Is a Live environment recommended |
9 |
> > instead? How would you mitigate the leftover partition, assuming it's |
10 |
> > not adjacent to /'s partition? |
11 |
> |
12 |
> For /usr you don't need a live CD, because the contents of /usr shouldn't |
13 |
> change unless you instal/remove something. You can make sure they don't |
14 |
> change during the merge by remounting read-only |
15 |
> |
16 |
> mount /usr -o remount,ro |
17 |
> mkdir /newusr |
18 |
> rsync -a /usr/ /new/usr/ |
19 |
> Comment out /usr line in /etc/fstab |
20 |
> mv /usr /oldusr |
21 |
> mv /newusr /usr |
22 |
> reboot |
23 |
> rmdir /oldusr |
24 |
> |
25 |
> What you do with the old partition is up to you. In this case the |
26 |
> discussion was about /usr on LVM, so you just delete it and allocate the |
27 |
> space elsewhere when needed. |
28 |
> |
29 |
> |
30 |
|
31 |
You can even leave out the step of creating a new directory and moving it later |
32 |
if you bind-mount you rootfs somewhere, e.g. /mnt/gentoo. |
33 |
You may want to add some parameters to the call to rsync, though (e.g. those |
34 |
that preserve permissions, xattrs (especially for SELinux or XT-PaX) and |
35 |
owner/group (should be -pogX), possibly -x aswell (if you have other |
36 |
filesystems under /usr (e.g. a discrete FS for the portage tree). |
37 |
|
38 |
This would boil down to: |
39 |
|
40 |
mount /usr -o remout,ro # just to make sure there are no changes |
41 |
mount -o bind / /mnt/gentoo |
42 |
rsync -apogXx /usr/ /mnt/usr/ # possibly fiddle around with the flags |
43 |
comment out the /usr line in fstab |
44 |
reboot |
45 |
|
46 |
if everything's working: delete the old usr-partition (or do with it whatever |
47 |
you like). |
48 |
|
49 |
WKR |
50 |
Hinnerk |