Moving/merging a filesystem back into /

Kevin Korb kmk at sanitarium.net
Mon Dec 2 13:17:06 MST 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

First, make sure you have good backups in case anything goes wrong.

Second, make sure your root (which appears to be a regular partition
rather than an lvm2 slice) is large enough to handle your current /usr
filesystem.

Third, consider whether you should be moving root into lvm2 rather
than moving /usr out of it as this would increase flexibility in the
future rather than reducing it.

........

> 
> -a, or -axAHX, or -apogXx, or -PvasHAX
> 
> or should I go with a combined -apogsvxAHPX ?

- -aH is enough for most things.  If your current /usr is mounted with
the acl option then you should use -A.  If you have USE=caps or
caps-ng then you will need -X.  -v, -i, and -P are modifications to
the output of rsync and purely up to you.  Most of the rest of that is
included in -a.  -S might save you a little space but never use it on
/boot (I know you said /usr but I felt like saying that anyway).

..........


> 1. Boot off of the latest gentoo LiveDVD

I would use SystemRescueCD.  It is Gentoo based but much better setup
for this kind of work.  It is also nice to have around.

> 2. Mount /
> 
> mount /dev/sda3 /mnt/gentoo/

You might have to specify more options here.  Check what they are
before you shut down.

> There should already be a /usr directory where it was being
> mounted before, right? If not, then I guess I create it with
> root:root 755 permissions.
> 
> 3. Mount old /usr to be moved/merged
> 
> vgscan vgchange -a y mount /dev/vg/usr /mnt/gentoo/oldusr

I think SystemRescueCD will do part of that for you but if not those
are the right steps (not including the mkdir)

> 4. Copy /oldusr to /usr
> 
> rsync -a? /mnt/gentoo/oldusr/ /mnt/gentoo/usr/ Are the trailing
> slashes required/important/necessary?

Yes.

> Which arguments should I use?

See above

> 5. Edit /etc/fstab and comment/remove the /usr line
> 
> nano -wc /mnt/gentoo/etc/fstab
> 
> #/dev/vg/usr       /usr        reiserfs        noatime         0 0

Change this to mount in /olduser.  You have no reason to delete it at
this point so you can keep it around just in case.  At least until you
need to reclaim the vg space.


> 6. Unmount mounted filesystems
> 
> umount /mnt/gentoo/oldusr umount /mnt/gentoo
> 
> 7. Reboot into new system
> 
> Done?

While you are at it I would recommend converting from reiserfs to
ext4.  Reiserfs has never really been all that reliable and ext4
caught up to it and passed it on performance for most things.

> --
> 
> Best regards,
> 
> */Charles/*
> 
> 

- -- 
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~
	Kevin Korb			Phone:    (407) 252-6853
	Systems Administrator		Internet:
	FutureQuest, Inc.		Kevin at FutureQuest.net  (work)
	Orlando, Florida		kmk at sanitarium.net (personal)
	Web page:			http://www.sanitarium.net/
	PGP public key available on web site.
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlKc6sIACgkQVKC1jlbQAQc4lwCfcL3jcLatcaac0t3ZDYbVLq8x
8lMAoJhtu6ssKl//oJH0FbfAwbSm1FbK
=D/SR
-----END PGP SIGNATURE-----


More information about the rsync mailing list