Peter Humphrey <[EMAIL PROTECTED]> posted [EMAIL PROTECTED], excerpted below, on Mon, 29 May 2006 09:31:52 +0100:
> On Saturday 27 May 2006 14:38, Duncan wrote: > >> Second suggestion and something I'm again doing here, consider creating >> a second copy of your root partition > > What tool or command do you use to make your copies? I remember seeing an > invocation of tar piped to tar to ensure that all dates, permissions etc > are preserved, even on pipes and other esoteric things, but my memory > being what it is of course I can't remember it. I use mc (midnight commander) quite heavily, both at the console and in X, both for file management and editing. My EDITOR variable is set to mcedit, I have a seriously customized system-wide "user" menu (mc key F2), I have konqueror and kwrite set to use many of the same keyboard shortcuts (like F2 for save in mcedit/kwrite, F8/delete, F5/copy, F6/move in mc/konqueror, etc) mc defaults to retaining ownership and permissions, and just does "the right thing" by default on all that exotic stuff (pipes, sockets, symlinks, device files, etc). I use partitions/volumes quite heavily here, and the one issue I did run into originally was efficiently doing a copy of my root partition (only) to rootbak. There are various ways to do it including booting to single user mode and unmounting everything but the root file system. However, it's far simpler, I found, to simply setup an entry in fstab for a mount --bind rootfs, thus getting a view of the filesystem without all the submounts, and with the /dev dir on disk available to be copied as well, instead of the udev overmount I'd normally get copying that dir. Here's the entry I use: #Dev/Part MntPnt Type MntOpt D F # for mount --bind, --rbind, and --move #/old/dir /new/dir none bind 0 0 /. /rootbind none bind,noauto 0 0 Note that due to the way the Gentoo initscripts work, you can't simply use / as the /old/dir entry as that will mess up checkroot. I had a time figuring out what /would/ work, until I remembered that a single dot points to "me", the same as .. points to the parent dir, so be sure to use /. as the old dir entry, not simply /. It'll save you some trouble! Of course, you can change the /rootbind to /mnt/rootbind or some such if you prefer. Don't forget to create the dir so the system has someplace to do the mount! As you can see, I use the "noauto" option in addition to "bind", so it's not mounted unless I tell it to mount. The fstab entry does save having to look up the correct mount --bind command line syntax, however, and a simple "mount /r<tab>" to get autocompletion based on the fstab entry is far easier than typing the whole long command in, if I didn't have an fstab entry for it, as well. Of course, one /could/ use dd or similar to do a direct bit-for-bit image copy of the filesystem image itself. As that would be sequential and have less overhead, it would be rather faster. Doing the mount --bind dance above wouldn't be necessary, either. However, the file-by-file copy is conceptually easier since it's something we all do every day, and it also has the effect of cleaning up filesystem fragmentation and other such cruft. Thus, I normally do a mkfs to wipe the old backup clean, then mount /rootbind and /bak, load mc with a view on each, select everything in /rootbind, and hit F5 to initiate the copy. Again, mc manages all the permissions stuff so it just works, so I don't have to worry about that at all. > You may remember that I've been using Partition Magic for this task > (version 8 can boot from its installation CD), but I keep discovering > more ways in which its Windows nature and consequent arrogance make it > more difficult than it should be. For instance, I discovered last night > on my laptop that, when I copied my root partition to an empty space on > the same disk, it changed all my grub.conf entries to point to the copy. > Then, when I upgraded to modular X, deleted the copy and copied over the > new root partition, guess what? Not knowing of the subterfuge, I > destroyed all that work (finding 101 lines to add to package.keywords > the most tiring) and had to go for a pint to calm my temper. (Still, > it's an ill wind that blows no-one any good.) > > I've known for a while that PM changes /etc/fstab, and always gets it > wrong so that I can't boot until I've corrected it, but this is the > first time it's caused real data loss and anger. I used to swear by Partition Magic. I had actually tried Quarterdeck's Partition It at one time instead of upgrading PM, and had problems. When I gave up and switched back to PM, I found out why -- PI had screwed up the partition entries and had incorrect data for some stuff! I Considered myself lucky not to have lost anything, and /only/ used PM from then on -- until I made the jump to Linux-only, anyway. At that point, I wrote them, asking when they were going to support stuff like reiserfs and ext3. They said they'd support whichever one became the official upgrade from ext2 (which they did support at the time and which I had used while I was playing around with Linux a bit). Well, I knew both were supported in the 2.4 kernel, along with JFS, XFS, etc, and decided PM wasn't so hot when it came to Linux stuff as it was on MSWormOS. I asked about support for a Linux executable as well. They said none was planned but that the DOS based floppy version would work (that was before bootable CDs became common place). Well, yes, but that wasn't the same thing. So... I decided to try out the Linux alternatives. I'm glad I did. Mandrake (which I was using at the time) had a (GPL licensed) GTK based partitioning client with an interface that any PM user would have been comfortable with. It was called DiskDrake. I still don't know why it hasn't become far more popular, because it was (and I assume still is, tho the name will have changed) as simple as PM to use, and lowers the barrier to entry for MSWormOS types /dramatically/. I assume the thing is still available on the first Mandriva install CD, tho I have no idea what it would be called, now. When I switched to Gentoo, I settled on cfdisk, which I had experimented with on Mandrake, but never used extensively. It's curses based, and should seem familiar to those who have used the PM text based interface that they at least used to have on that floppy I mentioned. Anyone who has used MS' FDISK utility should find it familiar as well. It's quite usable and I've had zero problems with it, but it's not the fancy graphical interface of PM or Mandrake's DiskDrake. Now, of course, I wouldn't use PM in any case, as it's slaveryware. As well, for Linux, it was more limited than diskdrake was, even back with Mandrake 8.x, altho diskdrake was of course more limited with NTFS partitions and the like. From what you've said, it seems like it still has some limitations on the Linux side, tho I'd hope by now it at least supports the basic Linux filesystem types, including reiserfs/ext3/jfs/xfs. It'd be a shame if it didn't. By now, I'd be asking when they were adding reiser4 support, if it wasn't yet included. I've not used it yet, but I'm expecting I eventually will, and would expect an app like PM that I actually had to pay money for to have support for it by the time it became part of the mainstream kernel, in any case. -- Duncan - List replies preferred. No HTML msgs. "Every nonfree program has a lord, a master -- and if you use the program, he is your master." Richard Stallman -- [email protected] mailing list
