1 |
Peter Humphrey <prh@××××××××××.uk> posted |
2 |
200605290931.52350.prh@××××××××××.uk, excerpted below, on Mon, 29 May |
3 |
2006 09:31:52 +0100: |
4 |
|
5 |
> On Saturday 27 May 2006 14:38, Duncan wrote: |
6 |
> |
7 |
>> Second suggestion and something I'm again doing here, consider creating |
8 |
>> a second copy of your root partition |
9 |
> |
10 |
> What tool or command do you use to make your copies? I remember seeing an |
11 |
> invocation of tar piped to tar to ensure that all dates, permissions etc |
12 |
> are preserved, even on pipes and other esoteric things, but my memory |
13 |
> being what it is of course I can't remember it. |
14 |
|
15 |
I use mc (midnight commander) quite heavily, both at the console and in |
16 |
X, both for file management and editing. My EDITOR variable is set to |
17 |
mcedit, I have a seriously customized system-wide "user" menu (mc key F2), |
18 |
I have konqueror and kwrite set to use many of the same keyboard |
19 |
shortcuts (like F2 for save in mcedit/kwrite, F8/delete, F5/copy, F6/move |
20 |
in mc/konqueror, etc) |
21 |
|
22 |
mc defaults to retaining ownership and permissions, and just does "the |
23 |
right thing" by default on all that exotic stuff (pipes, sockets, |
24 |
symlinks, device files, etc). |
25 |
|
26 |
I use partitions/volumes quite heavily here, and the one issue I did run |
27 |
into originally was efficiently doing a copy of my root partition (only) |
28 |
to rootbak. There are various ways to do it including booting to single |
29 |
user mode and unmounting everything but the root file system. However, |
30 |
it's far simpler, I found, to simply setup an entry in fstab for a mount |
31 |
--bind rootfs, thus getting a view of the filesystem without all the |
32 |
submounts, and with the /dev dir on disk available to be copied as well, |
33 |
instead of the udev overmount I'd normally get copying that dir. Here's |
34 |
the entry I use: |
35 |
|
36 |
#Dev/Part MntPnt Type MntOpt D F |
37 |
# for mount --bind, --rbind, and --move |
38 |
#/old/dir /new/dir none bind 0 0 |
39 |
/. /rootbind none bind,noauto 0 0 |
40 |
|
41 |
Note that due to the way the Gentoo initscripts work, you can't simply use |
42 |
/ as the /old/dir entry as that will mess up checkroot. I had a time |
43 |
figuring out what /would/ work, until I remembered that a single dot points |
44 |
to "me", the same as .. points to the parent dir, so be sure to use /. as |
45 |
the old dir entry, not simply /. It'll save you some trouble! Of course, |
46 |
you can change the /rootbind to /mnt/rootbind or some such if you prefer. |
47 |
Don't forget to create the dir so the system has someplace to do the |
48 |
mount! As you can see, I use the "noauto" option in addition to "bind", |
49 |
so it's not mounted unless I tell it to mount. The fstab entry does save |
50 |
having to look up the correct mount --bind command line syntax, however, |
51 |
and a simple "mount /r<tab>" to get autocompletion based on the fstab |
52 |
entry is far easier than typing the whole long command in, if I didn't |
53 |
have an fstab entry for it, as well. |
54 |
|
55 |
Of course, one /could/ use dd or similar to do a direct bit-for-bit image |
56 |
copy of the filesystem image itself. As that would be sequential and have |
57 |
less overhead, it would be rather faster. Doing the mount --bind dance |
58 |
above wouldn't be necessary, either. However, the file-by-file copy is |
59 |
conceptually easier since it's something we all do every day, and it also |
60 |
has the effect of cleaning up filesystem fragmentation and other such |
61 |
cruft. Thus, I normally do a mkfs to wipe the old backup clean, then |
62 |
mount /rootbind and /bak, load mc with a view on each, select everything |
63 |
in /rootbind, and hit F5 to initiate the copy. Again, mc manages all |
64 |
the permissions stuff so it just works, so I don't have to worry about |
65 |
that at all. |
66 |
|
67 |
> You may remember that I've been using Partition Magic for this task |
68 |
> (version 8 can boot from its installation CD), but I keep discovering |
69 |
> more ways in which its Windows nature and consequent arrogance make it |
70 |
> more difficult than it should be. For instance, I discovered last night |
71 |
> on my laptop that, when I copied my root partition to an empty space on |
72 |
> the same disk, it changed all my grub.conf entries to point to the copy. |
73 |
> Then, when I upgraded to modular X, deleted the copy and copied over the |
74 |
> new root partition, guess what? Not knowing of the subterfuge, I |
75 |
> destroyed all that work (finding 101 lines to add to package.keywords |
76 |
> the most tiring) and had to go for a pint to calm my temper. (Still, |
77 |
> it's an ill wind that blows no-one any good.) |
78 |
> |
79 |
> I've known for a while that PM changes /etc/fstab, and always gets it |
80 |
> wrong so that I can't boot until I've corrected it, but this is the |
81 |
> first time it's caused real data loss and anger. |
82 |
|
83 |
I used to swear by Partition Magic. I had actually tried Quarterdeck's |
84 |
Partition It at one time instead of upgrading PM, and had problems. When |
85 |
I gave up and switched back to PM, I found out why -- PI had screwed up |
86 |
the partition entries and had incorrect data for some stuff! I Considered |
87 |
myself lucky not to have lost anything, and /only/ used PM from then on -- |
88 |
until I made the jump to Linux-only, anyway. |
89 |
|
90 |
At that point, I wrote them, asking when they were going to support stuff |
91 |
like reiserfs and ext3. They said they'd support whichever one became the |
92 |
official upgrade from ext2 (which they did support at the time and which I |
93 |
had used while I was playing around with Linux a bit). Well, I knew both |
94 |
were supported in the 2.4 kernel, along with JFS, XFS, etc, and decided PM |
95 |
wasn't so hot when it came to Linux stuff as it was on MSWormOS. |
96 |
|
97 |
I asked about support for a Linux executable as well. They said none was |
98 |
planned but that the DOS based floppy version would work (that was before |
99 |
bootable CDs became common place). Well, yes, but that wasn't the same |
100 |
thing. |
101 |
|
102 |
So... I decided to try out the Linux alternatives. I'm glad I did. |
103 |
|
104 |
Mandrake (which I was using at the time) had a (GPL licensed) GTK based |
105 |
partitioning client with an interface that any PM user would have been |
106 |
comfortable with. It was called DiskDrake. I still don't know why it |
107 |
hasn't become far more popular, because it was (and I assume still is, |
108 |
tho the name will have changed) as simple as PM to use, and lowers the |
109 |
barrier to entry for MSWormOS types /dramatically/. I assume the thing is |
110 |
still available on the first Mandriva install CD, tho I have no idea what |
111 |
it would be called, now. |
112 |
|
113 |
When I switched to Gentoo, I settled on cfdisk, which I had experimented |
114 |
with on Mandrake, but never used extensively. It's curses based, and |
115 |
should seem familiar to those who have used the PM text based interface |
116 |
that they at least used to have on that floppy I mentioned. Anyone who |
117 |
has used MS' FDISK utility should find it familiar as well. It's quite |
118 |
usable and I've had zero problems with it, but it's not the fancy |
119 |
graphical interface of PM or Mandrake's DiskDrake. |
120 |
|
121 |
Now, of course, I wouldn't use PM in any case, as it's slaveryware. As |
122 |
well, for Linux, it was more limited than diskdrake was, even back with |
123 |
Mandrake 8.x, altho diskdrake was of course more limited with NTFS |
124 |
partitions and the like. From what you've said, it seems like it still |
125 |
has some limitations on the Linux side, tho I'd hope by now it at least |
126 |
supports the basic Linux filesystem types, including |
127 |
reiserfs/ext3/jfs/xfs. It'd be a shame if it didn't. By now, I'd be |
128 |
asking when they were adding reiser4 support, if it wasn't yet included. |
129 |
I've not used it yet, but I'm expecting I eventually will, and would |
130 |
expect an app like PM that I actually had to pay money for to have support |
131 |
for it by the time it became part of the mainstream kernel, in any case. |
132 |
|
133 |
-- |
134 |
Duncan - List replies preferred. No HTML msgs. |
135 |
"Every nonfree program has a lord, a master -- |
136 |
and if you use the program, he is your master." Richard Stallman |
137 |
|
138 |
-- |
139 |
gentoo-amd64@g.o mailing list |