Gentoo Archives: gentoo-user

From: Frank Steinmetzger <Warp_7@×××.de>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] plain copy of root disk won't work
Date: Sat, 19 Nov 2016 16:07:56
Message-Id: 20161119160743.GD14798@kern
In Reply to: Re: [gentoo-user] plain copy of root disk won't work by "Константин"
1 On Fri, Nov 18, 2016 at 10:20:13PM +0300, Константин wrote:
2 > On Fri, Nov 18, 2016 at 04:30:28PM +0100, Raffaele BELARDI wrote:
3 > > I want to move the main disk contents (hda, PATA) to another, larger
4 > > disk (sda, SATA).
5 > >
6 > > hda contains 4 ext3 partitions (root, home, data, swap).
7 > > I created 4 ext3 partitions on sda and copied the data over from the
8 > > corresponding hda partitions using 'cp -ax'.
9 >
10 > Didn't you do this from working system on hda? In this case there
11 > really could be troubles with special files etc. Imho live-cd better
12 > for this purpose.
13 >
14 > At any case imho it's better to split this task
15 >
16 > 0. Boot from live-cd.
17
18 If I can’t be bothered with live CDs, I bind-mount the root partition. I use
19 that frequently to do root-backups. That way you can get the files within
20 /dev which are required even before /dev is populated (null and zero, IIRC).
21 This will, of course, not prevent files from being changed during the rsync
22 run, because the system is still live and kicking. So I usually run it
23 several times to see what has changed in the meantime.
24
25 mkdir /mnt/bindroot
26 mount --bind / /mnt/bindroot
27 rsync -ahXAHi --delete /mnt/bindroot/ /path/to/new/partition/
28
29 Since this is a bindmount, no need for -x. Use -A and -X if you use acls and
30 xattrs, respectively. But you definitely want -H. For example git installs
31 all its commands as hardlinks to a single binary.
32
33 --
34 Gruß | Greetings | Qapla’
35 Please do not share anything from, with or about me with any social network.
36
37 Idealism grows with the distance to the problem.

Attachments

File name MIME type
signature.asc application/pgp-signature