Post #116,491
9/3/03 4:24:36 PM
9/3/03 4:32:14 PM
|
Personally...
I'd rsync the machine over using a knoppix on the new machine. then setup an rsync server on the old machine using knoppix...
IOW, mount "/" (root) on /sysimage, and then mount the filesystems properly in relation to /sysimage being the "root-directory". Do this on both systems (requires you to prep the new one).
That way... NOOOO problems with files in use.
Gosh and lookey that once rsync'd, you could "chroot . bin/bash" from the system image and fix anything you need to to get the proper modules and everything.
Then once everything is F1XX0RD up, exit from chroot, then:
grub-install --root-directory=/sysimage /dev/hdX (X being boot drive)
Fix up the menu.lst... all is good.
hmmm... that's funky... I just might have to try that.
Woot.
-- [link|mailto:greg@gregfolkert.net|greg], [link|http://www.iwethey.org/ed_curry|REMEMBER ED CURRY!] @ iwethey
[insert new rocking debian boxen here]
Edited by folkert
Sept. 3, 2003, 04:32:14 PM EDT
|
Post #116,493
9/3/03 4:43:28 PM
|
Too much fiddling required
... mount the filesystems properly in relation to ... ... fix anything you need to ... ... Fix up the menu.lst ... Too much fixxoring for me. Probably easy for you, but IANY.
===
Implicitly condoning stupidity since 2001.
|
Post #116,502
9/3/03 7:39:21 PM
|
I*A*K, and IDWGS
...I am Karsten, and I'd do what Greg says. \r\n\r\n Partition the new system as desired. Boot Knoppix. I'd use tar rather than rsync to move old system to new (you save the overhead of creating the transfer file list -- you already know it's everything). Prolly also helps to have the source system booted single user to minimize state change. Edit /etc/fstab, install [link|http://www.gnu.org/software/grub/|a bootloader], configure it appropriately, and be on my way. \r\n\r\n In all, far less time than an install. Also, per some folks (e.g.: Marc Merlin -- SVLUG president and VP, sysadmin at VA $SUFFIX, and current sysgod at Google), this is how they've got by on one and only one Debian install, despite the scores of systems they've run Debian on.
--\r\n Karsten M. Self [link|mailto:kmself@ix.netcom.com|kmself@ix.netcom.com]\r\n [link|http://kmself.home.netcom.com/|http://kmself.home.netcom.com/]\r\n What part of "gestalt" don't you understand?\r\n [link|http://twiki.iwethey.org/twiki/bin/view/Main/|TWikIWETHEY] -- an experiment in collective intelligence. Stupidity. Whatever.\r\n \r\n Keep software free. Oppose the CBDTPA. Kill S.2048 dead.\r\n[link|http://www.eff.org/alerts/20020322_eff_cbdtpa_alert.html|http://www.eff.org/alerts/20020322_eff_cbdtpa_alert.html]\r\n
|
Post #116,521
9/4/03 12:14:59 AM
|
NM
Doing it from Knoppix is inelegant.
I'd make a minimal boot floppy, do fdisk and mkfs, cp -a everything over without worries about files in use because the only ones would be replaceable log files. Then LILO with alternate target etc. Wait, I just did all that to move to a new disk - so I know it works. Even moved Winders XCVIII over that way.
-drl
|
Post #116,523
9/4/03 12:36:30 AM
|
Advantages of Knoppix...
First off, I've got a few score disks lying around here. \r\n\r\n Second: it's got pretty much all the tools you could want. As well as web browsers and related goodness to allow Net access and Real Work to happen while you're transferring 60 GB of pr0n^WValued Data. Not to mention fileystem support and other goodies. \r\n\r\n Third, much as I like it, Tom's Root Boot is a bit thing. It works in an emergency (and I definitely use, abuse, and love it for what it is). But 1.7 MB is just to thin. \r\n\r\n Fourth: as a decent fallback, the LNX-BBC is handy, useful, and almost always sufficien to the task for jobs like this. Granted it has fewer toys, but it is pretty full-featured in the niche of system recovery tools. \r\n\r\n Elegance aside, you're quibbling over $0.40 worth of clear plastic. That seems just plain argumentitive. Some of us have work to do, and use the tools available. \r\n\r\n I mean, if you could fit a D-9 Cat in your back pocket, and dig planting holes with it, easily, without disturbing the rest of the garden, would you refuse just on principle? Your choice, not mine.
--\r\n Karsten M. Self [link|mailto:kmself@ix.netcom.com|kmself@ix.netcom.com]\r\n [link|http://kmself.home.netcom.com/|http://kmself.home.netcom.com/]\r\n What part of "gestalt" don't you understand?\r\n [link|http://twiki.iwethey.org/twiki/bin/view/Main/|TWikIWETHEY] -- an experiment in collective intelligence. Stupidity. Whatever.\r\n \r\n Keep software free. Oppose the CBDTPA. Kill S.2048 dead.\r\n[link|http://www.eff.org/alerts/20020322_eff_cbdtpa_alert.html|http://www.eff.org/alerts/20020322_eff_cbdtpa_alert.html]\r\n
|
Post #116,554
9/4/03 9:59:38 AM
|
IANGNAIY
I Am Not Greg Nor Am I You Edit /etc/fstab ... ... configure it appropriately ... 1) Edit it how? 2) Define "appropriately". Remember, IANASysadmin. I don't know this stuff as well as you two. If I knew the "appropriate" way to twiddle things, or even which things to twiddle, I wouldn't have needed to ask the question. Unless there is already a script somewhere that answers all the questions that will come up[1] I'm going to go with the way I am confident will work. And that's the get/set-selections drill, and copying /home. [1] I'm not asking anyone to do the work for me. Just saying that if there's not already a step-by-step guide that will get me through it, I'm going to go with the method I'm confident I won't screw up.
===
Implicitly condoning stupidity since 2001.
|
Post #116,670
9/4/03 9:12:01 PM
|
Partitioning
Drew wrote: >> Edit /etc/fstab ... >> ... configure it appropriately ... > 1) Edit it how? > 2) Define "appropriately". That's kind of a Religious Question<tm>. Epic jihads have been lauched over the matter of system partitioning. Here's my wacky, somewhat over-complex entry into the sweepstakes, from my main server: \nuncle-enzo:~# cat /etc/fstab\n# /etc/fstab: static file system information.\n#\n# filesys mountpoint type options dump pass \n/dev/sda5 / ext3 defaults,errors=remount-ro 1 1\n/dev/sda7 none swap sw 0 0\n/dev/sdb6 none swap sw 0 0\nproc /proc proc defaults 0 0\n/dev/fd0 /mnt/floppy auto defaults,user,noauto 0 0\n/dev/sda1 /boot ext2 ro,noauto,noexec,nosuid,nodev 1 2\n/dev/sda6 /mnt/recovery ext2 rw,noauto 0 2\n/dev/sdb7 /var ext3 rw,nodev,nosuid,noatime 1 2\n/dev/sda8 /var/log ext3 rw,nodev,nosuid,noatime 0 2\n/dev/sdb8 /usr ext2 ro,nodev 1 2\n/dev/sda9 /usr/local ext3 rw 1 2\n/dev/sdb1 /home ext3 rw,nodev,nosuid 1 2\n/dev/sdb5 /tmp ext3 rw,nosuid,nodev,noatime 0 2\nuncle-enzo:~# df -H\nFilesystem Size Used Avail Use% Mounted on\n/dev/sda5 985M 166M 769M 18% /\n/dev/sdb7 2.0G 1.2G 745M 61% /var\n/dev/sda8 985M 139M 797M 15% /var/log\n/dev/sdb8 3.0G 848M 2.0G 31% /usr\n/dev/sda9 5.0G 2.2G 2.6G 46% /usr/local\n/dev/sdb1 985M 781M 154M 84% /home\n/dev/sdb5 291M 9.2M 267M 4% /tmp\n/dev/sda1 97M 10M 82M 11% /boot\nuncle-enzo:~# \n Since the machine has two physical disks (sda and sdb), I've put some swap space on each of them, and split pieces of the system filesystem between them, hoping to split head-seeking activity between them, to maximise mass-storage performance. Parts of the tree at risk for explosive file growth (/home, /var, /tmp) are carefully kept off the root filesystem to protect the latter. The separate /boot partition is a bit of an archaism, and I probably won't do that with future system builds. The "noatime" flag is a performance aid on parts of the tree where I figure the atime date stamp isn't really needed or useful. The other "no*" flags are perhaps feeble measures at greater system security. (Don't try "noexec" on /tmp; packages often try to run preinst or postinst scripts in there!) Note that /boot and /usr are the only non-journaled filesystems: Being mounted read-only, there's no point in journaling overhead. The read-only flag ("ro") on the /usr filesystem helps prevent accidental system catastrophe at the sysadmin's hands or equivalent, but you'll want some mechanisms to remount it read/write for package installation/removal, such as the shell scripts I call from /etc/apt/apt.conf: \nDPkg {\n // Auto re-mounting of a readonly /usr\n Pre-Install-Pkgs {"/home/rick/aptdpkgro.sh";};\n Pre-Invoke {"mount -o remount,rw /usr";};\n Post-Invoke {"/home/rick/aptdpkgclean.sh; mount -o remount,ro /usr";};\n}\nuncle-enzo:/etc/apt# cd /home/rick \nuncle-enzo:/home/rick# cat aptdpkgro.sh \n#!/bin/sh\n\npathmatch="^/usr"\n\nwhile read debname; do\n pkg=$(dpkg --info $debname | sed -n 's/^ Package: *//p' | head -1)\n (dpkg -L "$pkg" 2>/dev/null || true) | grep "$pathmatch" |\n while read file; do\n [ -f "$file" -a ! -L "$file" ] || continue\n dir=`dirname "$file"`;\n base=`basename "$file"`;\n inode=`find "$file" -printf "%i\\n"`\n (cd "$dir" && ln "$base" ".${base}.dpkg-ro-used.$inode")\n echo "$dir/.${base}.dpkg-ro-used.$inode"\n done >>/var/lib/my_ro_hack.todel\ndone\n\nuncle-enzo:/home/rick# cat aptdpkgclean.sh \n#!/bin/sh\n\npathmatch="^/usr"\n\ncat /var/lib/my_ro_hack.todel | while read file; do\n [ -f "$file" ] || continue\n N1=`find "$file" -printf "%i\\n"`\n\n b=`basename $file`; d=`dirname $file`\n XF="${b#.}"; XF="$d/${XF%.dpkg-ro-used.*}"\n N2=`find "$XF" -printf "%i\\n"`\n\n if [ "$N1" != "$N2" ] && ! fuser -s "$file"; then\n rm -f "$file"\n else\n echo "$file"\n fi\ndone >/var/lib/my_ro_hack.todel.new\nmv /var/lib/my_ro_hack.todel.new /var/lib/my_ro_hack.todel\n\nuncle-enzo:/home/rick#\n Anyhow, the first thing you have to decide is which parts of your system tree will need their own partitions, and how big each will be. Then, decide which will be journaled using your journaling religion of choice (ext3, XFS, ReiserFS, JFS). Boot the Knoppix disk. Open a terminal and do "sudo bash" to get a root shell. Type "mount" to see what Knoppix might have automounted at boot time; umount anything it mounted from the target hard drive. Fire up /sbin/fdisk or /sbin/cfdisk (your choice) to create desired partitions. Keep notes on paper of what you're doing and which partition is which. When you're done, save and exit, then use mkfs.ext3, mkreiserfs, mkfs.xfs, mkfs.ext2, or whatever is approriate to high-level format the various partitions. Don't forget to mkswap for the swap partition(s). When you're done with that, mount the target root filesystem onto /mnt (or wherever you prefer), then mount the various other target filesystems to their respective mountpoints underneath /mnt. Now, you're ready to copy files from some other machine across the network. (Examples of how to do so using various tools such as tar, rsync, etc. are given in [link|http://linuxmafia.com/~rick/linux-info/kb/200|http://linuxmafia.co...linux-info/kb/200] .) Last, don't forget to construct an appropriate /etc/fstab (which at that moment will be /mnt/etc/fstab) using a text editor, to reflect the new filesystems you've created. The table of filesystems I posted above is probably way, way overcomplex for most people's needs, but I've posted it because it illustrates some partitioning concepts. The one from my laptop is a bit more modest: \nrick@guido:~$ cat /etc/fstab \n# /etc/fstab: static file system information.\n#\n# file system mount point type options dump pass \n/dev/hda3 / ext3 defaults,errors=remount-ro 0 1\n/dev/hda2 none swap sw 0 0\nproc /proc proc defaults 0 0\n/dev/fd0 /floppy auto defaults,user,noauto 0 0\n/dev/cdrom /cdrom iso9660 defaults,ro,user,noauto 0 0\nnone /proc/bus/usb usbdevfs defaults 0 0\n/dev/sda /mnt/fob vfat rw,uid=1000,gid=1000,user,noauto,noatime 0 0\n/dev/hda1 /boot ext2 rw,noauto 0 2\nrick@guido:~$ \n When in doubt, go with something simple (maybe something really simple, more than the laptop example above). When you need something more complex, you'll know it, and can reconfigure your system at that time. Rick Moen rick@linuxmafia.com
If you lived here, you'd be $HOME already.
|
Post #116,687
9/4/03 10:21:35 PM
|
Thanks. Very nice. Someone please twikify this...
|
Post #116,881
9/6/03 1:10:13 PM
|
Done. Please send gentle brickbats this way.
I appended Rick's post to Karsten's [link|http://twiki.iwethey.org/twiki/bin/view/Main/NixPartitioning|NixPartitioning] page. Please let me know if I violated protocols or generally made a mess of things by directing your gentle [link|http://dictionary.reference.com/search?q=brickbat|brickbats] to me.
Thanks.
Cheers, Scott.
|
Post #116,906
9/6/03 5:11:51 PM
|
Cool
Looks really nice. If I'd known that my meandering rant was going to keep such good company, I would have done a better job. ;->
I'll probably get around to fixing it up a bit, in fact -- such as supplying the omitted explanation of what the /mnt/recovery partition is all about. It's a 450 MB filesystem, normally unmounted, that I tend to create on all my servers and put there a duplicate of the basic system with all essential pieces required to do the machine's work. If the system's ever trashed -- e.g., the one time that I had a power failure just as all the libraries in /usr/lib were getting relinked -- then I have something already in place to jury-rig the system with until I can rebuild it.
Rick Moen rick@linuxmafia.com
If you lived here, you'd be $HOME already.
|
Post #116,918
9/6/03 7:01:03 PM
|
Re: Cool
Love ya Rick, but you make things too complex.
-drl
|
Post #116,928
9/6/03 8:19:24 PM
|
Why to have a maintenance partition
Ross wrote:
Love ya Rick, but you make things too complex.
In this case, it's all about downtime.
When the debacle with /usr/lib happened, I had a big problem: The machine is a 2U rackmount box with no CD-ROM drive, and all I had to recover with was floppy disks. E.g., take your pick: Tom's Root/Boot, Slackware installation floppies, Debian installation floppies. So, I think I booted one of the former, to try to figure out what had happened (which took a while in itself).
When I finally did figure out that /usr/lib's contents had gotten massively mislinked, rebuilding the libs from the floppy-based maintenance system alone proved impossible, because there were just too many incompatibilities between the software packaged by Tom Oehser on the floppy and the HD-based facilities I was trying to repair. I couldn't even get dpkg and apt-get to work.
In the end, I was obliged to do things the hard way: I copied the package database (/var/lib/dpkg/status) over to another machine (along with /etc/* and other essentials) blew away the entire machine contents except for /home, /usr/local, and parts of /var, did a fresh Debian-base install, reset apt selections from the preserved package database, did apt-get fetches to get the installed packages back, copied the system configuration back, and was back in business.
But that took too damned long and too much trouble. Having a maintenance partition, ready to use and configured close enough to the in-service one, would have made the whole affair tremendously easier, so that's when I decided to have one around on critical machines from that point forward.
Rick Moen rick@linuxmafia.com
If you lived here, you'd be $HOME already.
|
Post #116,936
9/6/03 9:32:39 PM
|
What he said
I've similary got a "system2" install, though it's on a 132MB partition, and only uses 108 MB of that (excludes kernel). It consists of a very small subset of Debian, only 109 packages. Typically it's unmounted. .\r\n\r\n Thus, my recovery options for a system are typically: \r\n\r\n \r\n- Single-user
\r\n- init=/bin/bash
\r\n- alternate kernel
\r\n- /system2
\r\n- Knoppix
\r\n- LNX-BBC
\r\n- Tom's Root Boot
\r\n \r\n\r\n Lots of fallback options. \r\n\r\n Might be interesting to compare what packages folks are including in rescue systems. .
--\r\n Karsten M. Self [link|mailto:kmself@ix.netcom.com|kmself@ix.netcom.com]\r\n [link|http://kmself.home.netcom.com/|http://kmself.home.netcom.com/]\r\n What part of "gestalt" don't you understand?\r\n [link|http://twiki.iwethey.org/twiki/bin/view/Main/|TWikIWETHEY] -- an experiment in collective intelligence. Stupidity. Whatever.\r\n \r\n Keep software free. Oppose the CBDTPA. Kill S.2048 dead.\r\n[link|http://www.eff.org/alerts/20020322_eff_cbdtpa_alert.html|http://www.eff.org/alerts/20020322_eff_cbdtpa_alert.html]\r\n
|
Post #116,915
9/6/03 6:53:25 PM
|
Did some edits, see page.
--\r\n Karsten M. Self [link|mailto:kmself@ix.netcom.com|kmself@ix.netcom.com]\r\n [link|http://kmself.home.netcom.com/|http://kmself.home.netcom.com/]\r\n What part of "gestalt" don't you understand?\r\n [link|http://twiki.iwethey.org/twiki/bin/view/Main/|TWikIWETHEY] -- an experiment in collective intelligence. Stupidity. Whatever.\r\n \r\n Keep software free. Oppose the CBDTPA. Kill S.2048 dead.\r\n[link|http://www.eff.org/alerts/20020322_eff_cbdtpa_alert.html|http://www.eff.org/alerts/20020322_eff_cbdtpa_alert.html]\r\n
|
Post #116,674
9/4/03 9:44:22 PM
|
Re: IANGBAIM
\r\n1) Edit it how?\r\n \r\n\r\n With an editor. \r\n\r\n \r\n2) Define "appropriately".\r\n \r\n\r\n In the case of /etc/fstab: you'll need an entry for each mounted partition. This would include the device file, mountpoint, filesystem type, mount options, and dump/pass values. \r\n\r\n As a practical matter, I'll assume you largely keep your partitioning intact (I'd recommend: /, /boot, /tmp, /usr, /var, /home, and possibly /usr/local or others). Just make sure the device files correspond the the partition numbers on the new system. \r\n\r\n I'd hope that's relatively clear. Rick dives into the details.
--\r\n Karsten M. Self [link|mailto:kmself@ix.netcom.com|kmself@ix.netcom.com]\r\n [link|http://kmself.home.netcom.com/|http://kmself.home.netcom.com/]\r\n What part of "gestalt" don't you understand?\r\n [link|http://twiki.iwethey.org/twiki/bin/view/Main/|TWikIWETHEY] -- an experiment in collective intelligence. Stupidity. Whatever.\r\n \r\n Keep software free. Oppose the CBDTPA. Kill S.2048 dead.\r\n[link|http://www.eff.org/alerts/20020322_eff_cbdtpa_alert.html|http://www.eff.org/alerts/20020322_eff_cbdtpa_alert.html]\r\n
|
Post #116,519
9/3/03 11:44:25 PM
|
I knew this would involve knoppix some how....
Just curious, do you have to use special options to get the .file stuff to tar up?
All those hidden files. Guess I could just try it.
Glen Austin
|
Post #116,551
9/4/03 9:48:23 AM
|
Actually...
I'd still use rsync.
And yes, if you specify the directory... it should/will grab all the .files (dot files).
So I hope that answers your question...
I am going to have to play building a "knoppix" CD for the other 10 Platforms...
Now, does anyone know where I can find an s/390, a MIPS, a MIPS-EL, a SPARC, an ALPHA (oh... wait I have one of those), a PowerPC, an Itanic (1 & 2), a PA-RISC, an m68k and an ARM (or leg even...)
Dammint, I just want to be all fresh and shit...
-- [link|mailto:greg@gregfolkert.net|greg], [link|http://www.iwethey.org/ed_curry|REMEMBER ED CURRY!] @ iwethey
Infernally cursed breath freshener supplied by default.
|
Post #116,566
9/4/03 11:13:42 AM
|
Snork. You MEANT to write that (no edit)! Doubledamint!
|