1 |
2013/12/2 William Kenworthy <billk@×××××××××.au> |
2 |
> |
3 |
> You are looking far too deep .... |
4 |
> |
5 |
> |
6 |
> just rsync -avP to /newusr |
7 |
|
8 |
+1 |
9 |
I have done this more or less the same way |
10 |
> |
11 |
> reboot to livecd |
12 |
> |
13 |
> rsync again with --delete to update ... takes a only few seconds this |
14 |
> time - minimal downtime :) |
15 |
> mv /usr /oldusr |
16 |
> mv /newusr /usr |
17 |
> reboot |
18 |
|
19 |
|
20 |
Let's make this thread more interesting, would it be possible to do |
21 |
this without a reboot? ie: going single user mode, kill anything that |
22 |
might still be running from usr, umount /usr, mount it to /mnt, rsync |
23 |
-avP to usr, going again into runlevel 3 or 5. |
24 |
Obviously not possible if running systemd. |
25 |
> |
26 |
> |
27 |
> The --numeric-ids is a good idea but I've made my systems consistent |
28 |
> with the standard gentoo id's so that's no longer a problem. |
29 |
> |
30 |
> Ive done this many times over the years, and to the system I am writing |
31 |
> this on many times (moving to lvm2, restoring from backups after disk |
32 |
> failures, restoring from backups after user failure - rm -rf /usr !) |
33 |
> |
34 |
> If you need to practice, run up a vm and test/destroy :) |
35 |
> |
36 |
> You have got the disk space, so if you have a backup its reversible so |
37 |
> don't be a wimp :) |
38 |
> |
39 |
> BillK |
40 |
> |
41 |
> |
42 |
> |
43 |
> |
44 |
> On 03/12/13 05:36, Mick wrote: |
45 |
> > On Monday 02 Dec 2013 20:40:28 Tanstaafl wrote: |
46 |
> >> On 2013-12-02 2:41 PM, Thanasis <thanasis@××××××××××.org> wrote: |
47 |
> > |
48 |
> >>> That is why I recommend using the option --numeric-ids. |
49 |
> >>> And using it would not hurt anyway. |
50 |
> >> |
51 |
> >> Right... poison pointed this out... |
52 |
> >> |
53 |
> >> This is why I asked for help about the arguments. |
54 |
> >> |
55 |
> >> I honestly don't care about superflous/unnecessary arguments, I just |
56 |
> >> want to make sure I use at least the ones needed for this to work. |
57 |
> >> |
58 |
> >> Thanks... |
59 |
> > |
60 |
> > The comment about --numeric-ids that Thanasis made is valid. I messed up some |
61 |
> > fs of mine last time I used rsync, when I wasn't paying much attention! I |
62 |
> > made a mental note to always use it in the future. On the other hand, if |
63 |
> > you're not that comfortable with it, a quick trial run with a test filesystem |
64 |
> > will offer some assurance that your chosen command and options will work as |
65 |
> > you intended. BTW, you do not *have* to use rsync: |
66 |
> > |
67 |
> > cp -a |
68 |
> > |
69 |
> > will do the same. |
70 |
> > |
71 |
> > su - |
72 |
> > cd /old_usr |
73 |
> > tar --one-file-system -cf . | (cd /new_usr ; tar -xvpf - ) |
74 |
> > |
75 |
> > will also do the same. |
76 |
> > |
77 |
> > Finally, star -copy is my favourite faster alternative to copying directories, |
78 |
> > inc. respecting any acl's and the like if you specify it in the options: |
79 |
> > |
80 |
> > su - |
81 |
> > star -copy <options> -C /old_usr . /new_usr |
82 |
> > |
83 |
> > Then you can also add -diff to see if any file was not copied correctly (use |
84 |
> > star diffopts=!<option> to exclude things like ctime, or you'll drown in the |
85 |
> > noise of the output). |
86 |
> > |
87 |
> > |
88 |
> > Speaking from experience I suggest that you do not blast your old /usr away |
89 |
> > until you have booted with /usr mounted in the new location and have verified |
90 |
> > that ownership and access rights are as you expected. |
91 |
> > |
92 |
> |
93 |
> |
94 |
|
95 |
PD: sorry if my english is not so good |