 |
Trilight Zone Privacy & Anonymity is our specialty !
|
|
|
| Author |
Message |
successlieswithme Private
Joined: 27 Sep 2005
Posts: 29
|
Posted: Fri Sep 30, 2005 7:53 am Post subject: Linux Bare-metal Recovery |
|
|
Linux Bare-metal Recovery
Like many other things in the Linux world, the ease with which you can do a bare-metal recovery will depend on your configuration. If you are running Linux on an Intel-based system, have a parallel port Zipİ drive, and you can fit a compressed copy of your operating system on that Zipİ drive, you're in luck! That's the configuration I used to design and test this recovery procedure.
Chances are, of course, that your configuration is slightly different than this. However, as long as you are still running Linux on an Intel-based system, this procedure will work for you without modification. If you're running Linux on an Alpha or Sparc system, though, you may even be able to modify this procedure to fit your needs. (The difficulty will come when you attempt to boot your Sparc from an Intel-based floppy!) How it works While researching information for this chapter, most Linux administrators gave the typical bare-metal recovery answer: install a minimal OS and recover on top of it. This answer presents the same problems for Linux systems that it does to other versions of UNIX. It takes too long, you could run into open file conflicts, and it is difficult to document and recover operating system customizations.
Like the other bare-metal recovery procedures in this book, this procedure does not require a reinstallation of the operating system in order to recover it. It is based on a homegrown procedure, which breaks down into six major steps, and will work with any Intel-based Linux distribution.
That's right. This procedure will work with any Intel-based Linux distribution. Back up important metadata The first important piece of information that must be saved is the metadata. Metadata is the information about how the system is physically configured -- specifically, how the root disk is partitioned. This information is not typically included in a normal backup.
To save this information, you simply run the command fdisk -l and redirect?url= the output to a file that will be included in the backup of the operating system. You also might want to keep a copy of the /etc/fstab in an alternate location. If you create these files prior to running your operating system backup, and place them in an easy to find location, you will be able to easily retrieve this data if you need it. Back up the operating system with a native utility If you are going to restore the operating system without re-installing it, you will need to use a utility that is easily available. In this case, you need to use a backup and recovery utility that is available on a "rescue floppy." (Rescue floppies are special floppies designed to help boot and rebuild a Linux box when it becomes damaged.) Both tar and cpio were available on the rescue floppy that I chose, but they were actually links to pax. (Pax will emulate both tar and cpio.) I prefer tar's syntax, so that is what I used to create the backup. Since gzip was also available, I compressed the backup so that it would easily fit on the media.
Speaking of media, you must decide where you are going to back up your operating system. You need to back it up to something that you can access from a rescue floppy. It doesn't do any good to make a backup to a tape drive that you can't access during a recovery! If you have a tape drive and a SCSI card that is supported by one of these rescue floppies, you're set. In my case, I had a parallel port Zipİ drive, and its driver was available on the rescue floppy. Since a compressed pax backup was only 68 MB, this was perfect for me.
If you can't figure out how to use your tape drive or other backup device from a rescue floppy, you may consider backing up to an NFS or SMB (CIFS) partition. Many of these floppies support mounting an NFS or SMB file system. This means that you would boot from the rescue floppy, mount the NFS or SMB file system to the system to be recovered, and then use gzip and pax to recovery the operating system.
In summary, there are three things that matter when deciding on a method of backing up the operating system:
- Make sure that the backup utility you use is available on your rescue floppy
- Make sure that the backup utility you use is able to recovery special files and named pipes, since such files will be found within the operating system (pax will do this for you)
- Make sure that the backup media you use is supported by your rescue floppy
[/list] |
|
| Back to top |
|
 |
successlieswithme Private
Joined: 27 Sep 2005
Posts: 29
|
Posted: Fri Sep 30, 2005 7:55 am Post subject: |
|
|
Boot the system from alternate media In order to easily recover your operating system, you will need a "mini root," or limited root shell where you can run fdisk, mkfs, gzip, and pax/tar/cpio, etc. You will also need support for whatever backup media you have chosen. Luckily for both of us, all of this functionality is provided via "rescue floppies." These floppies contain a minimal version of Linux and all of the recovery utilities listed above. They also have several drivers for popular backup media, including parallel port Zipİ drives, SCSI tape drives, NFS and SMB. A list of such rescue floppies may be found at http://metalab.unc.edu/pub/Linux/system/recovery/.
The rescue floppy that I chose to use was tomsrtbt, and can be found at http://www.toms.net/rb. Just look at all the drivers and utilities that you get on one floppy:
The 2.0.36 kernel, 3c589_cs, BusLogic, CVF, DEC_ELCP, EEXPRESS, EEXPRESS_PRO, EL2, EL3, EXT2, FAT, FAT32, FD, IDE, IDECD, IDEFLOPPY, IDEPCMCIA, IDETAPE, ISO9660, JOLIET, LOOP, MATH_EMULATION, MINIX, MSDOS, NE2000, NFS, PROC, RAM, SD, SERIAL, SLIP, SMC, SR, TR, ULTRA, VFAT, VORTEX, WD80x3, ah152x_cs, aha152x, aha1542, aic7xxx, ash, awk, badblocks, bdflush, bZipİ2, cardbus, cardmgr, cat, ce, ce.help, chattr, chgrp, chmod, chown, chroot, clear, cmp, cp, cpio, cut, date, dd, ddate, debugfs, df, dirname, dmesg, dmsdos, ds, du, dumpe2fs, dutil, e2fsck, eata, echo, egrep, elvis, emacs, extend, false, fdflush, fdformat, fdisk, fdomain, filesize, find, fmt, fsck.ext2, fsck.msdos, fstab, grep, gzip, halt, head, hexedit, hostname, i82365, ifconfig, ifport, ile, init, inittab, insmod, kill, killall5, ksyms, length, less, libc.so.5.4.13, lilo, lilo.conf, ln, loadkeys, login, losetup, ls, lsattr, mawk, memtest, mingetty, miterm, mkdir, mkdosfs, mke2fs, mkfifo, mkfs.minix, mklost+found, mknod, mkswap, mnsed, more, mount, mt, mv, nc, ncr53c8xx, nmclan_cs, ntfs, pax, pcmcia, pcmcia_core, pcnet_cs, ping, plip, ppa, printf, ps, pwd, qlogic_cs, qlogicfas, reboot, reset, rm, rmdir, rmmod, route, rsh, rshd, script, scsi_info, seagate, sed, serial_cs, setserial, sh, slattach, sleep, slip, snarf, sort, split, stty, swapoff, swapon, sync, tail, tar, tcic, tee, telnet, test, touch, tune2fs, umount, update, vi, vi.help, and wc!
If the driver that you need is not available in the default floppy, Tom has compiled a huge set of drivers that you can use to build your own custom floppy, and has included instructions on how to do so. He even tells me that it is possible to build a "rescue CD" that could contain all of these drivers for use anywhere! (But I don't think it has been done.) Needless to say, I was quite impressed with tomsrtbt, and have included it on the tools CD. (Tom Oehser deserves quite a bit of credit for developing such a good tool, and being very responsive to my emails. He was very helpful during the development and testing of this procedure, and I don't think I could have done it without him.) Tom simply asked that I include this disclaimer:
*******************************************************************************
* If you base something on it, use any of the scripts, distribute binaries or
*******************************************************************************
Once you boot from your rescue floppy, you can perform the rest of this procedure from a fully-functional root shell. What about Alpha and Sparc? The rescue floppy and lilo parts of this procedure are Intel-specific, and won't be of much help with the Alpha and Sparc versions of Linux. There is a rescue floppy for UltraLinux (the new name of the Sparc Linux port) at ftp://vger.rutgers.edu/pub/linux/Sparc/rescue. It appears to contain all of the necessary utilities. It has silo but not chroot, however it looks like the chroot trick might not be necessary for silo.
I couldn't find a rescue disk for AlphaLinux. The milo documentation implies that it is quite different from lilo and silo; in fact it may be standard to flash milo into a boot prom of some sort. This would mean that you would have to restore it by reflashing this information. If anyone can help clear up this confusion, please write! Repartition and newfs the root disk Since you saved a copy of how the root disk was partitioned, you will be able to partition the new root drive the same way. The way to do this is with fdisk. Unfortunately, many people are becoming less familiar with fdisk and more familiar with the "Disk Druid." Since Disk Druid is not available on the rescue floppies, so you will need to learn how fdisk works. An example of how to use fdisk is included later in this chapter.
After you have repartitioned the root drive, you'll need to use mkfs to recreate the root file system(s). Finally you are ready to restore the data. Restore the operating system to the new disk The first thing that needs to happen is to get access to the backed up data. In my case, the ppa driver was already loaded, and I just needed to mount the Zipİ drive as a file system. You may have to do one of the following:
[list]
[*]Mount a Zip or Jaz drive as a file system
[*]Load drivers for you SCSI card and tape drive
[*]Load network and NFS drivers, configure your network interface and mount an NFS file system
[*]Load network and SMB drivers, configure your network interface and mount an SMB file system
[*]Use pax to spread the backup of your operating system across 200 floppies or so .
In my case, the backup was made with pax (emulating tar) and gzip, to a Zipİ drive. The drivers and tools needed to do this were all available on tomsrtbt. Later in this chapter, you will see an example of how this worked. Restore the boot block information The boot block is a special part of the disk that is used to load the operating by its "bootstraps." It contains just enough executable code to locate and load the kernel. In Linux Intel situations, this boot block is referred to as the master boot record (MBR), and you can restore it using the lilo command.
This one was slightly trickier than I thought it would be. Although it is as simple as running lilo, you probably cannot use the lilo command provided on tomsrtbt. In my case it was not the same version as the one on my root disk. Since the restored operating system disk was mounted on /root, all you have to do run chroot /root /sbin/lilo. (Your version of lilo may not be in /sbin. You will have to use the full path for your particular version of lilo.) This command performs a chroot to /root, then reads /etc/lilo.conf to determine what to put in the master boot block. It then rebuilds the boot block for you.
Once this is done, you are ready to remove the floppy and boot the restored system! An example The example below uses pax (emulating tar), gzip, fdisk, lilo, and tomsrtbt to back up and recover a complete Linux system on a Toshiba Satellite Pro laptop.
As mentioned above, we backed up the metadata by running the command:
# fdisk -l >/etc/fdisk-l.txt
We then backed up the operating system using pax (emulating tar) to a Zipİ drive mounted on /backup:
# cd / ; tar cf - . |gzip -c >/backup/root.tar.gz
Now it's time to blow it up! The dd command below blows away both the lilo boot block and the disk's partition information. Although the root filesystem is still there, we couldn't find it if we wanted to!
# dd if=/dev/zero of=/dev/hda bs=512 count=1
# reboot
Insert system disk in drive
Press any key when ready. Boot the system The first step in recovering this system is to place the tomsrtbt floppy into the floppy drive and press any key. Here's what it displays while it is booting:
Welcome to tomsrtbt-1.7.134
http://www.toms.net/rb
#####
#######
##O#O##
#VVVVV#
## VVV ##
# ##
# ## ~
# ### . .
QQ# ##Q /V
QQQQQQ# #QQQQQQ //
QQQQQQQ# #QQQQQQ /( )
QQQQQ#######QQQQ ^`~'^
Other distributions tomsrtbt
One thing's for sure. Tom's got at least one of the qualities of a good programmer: hubris! (I saw this display for the first time at about 2:00 AM, and just about hit the floor laughing!)
(15 seconds...)
boot:
Loading zImage..............
to see video modes available, <SPACE> to continue or wait 30 secs
Uncompressing Linux..............
Memory: sized by int13 088h
Console: 16 point font, 400 scans
Console: colour VGA+ 80x25, 1 virtual console (max 63)
pcibios_init : BIOS32 Service Directory structure at 0x000f8e20
pcibios_init : BIOS32 Service Directory entry at 0xfe95b
pcibios_init : PCI BIOS revision 2.10 entry at 0xfdcd8
Probing PCI hardware.
Calibrating delay loop.. ok - 52.84 BogoMIPS
Memory: 47024k/49280k available (812k kernel code, 384k reserved, 1060k data)
Swansea University Computer Society NET3.035 for Linux 2.0
NET3: Unix domain sockets 0.13 for Linux NET3.035.
Swansea University Computer Society TCP/IP for NET3.034
IP Protocols: ICMP, UDP, TCP
Checking 386/387 coupling... Ok, fpu using exception 16 error reporting.
Checking 'hlt' instruction... Ok.
Intel Pentium with F0 0F bug - workaround enabled.
alias mapping IDT readonly ... ... done
Linux version 2.0.36 (root@6M) (gcc version 2.7.2.3) #29 Fri May 7 12:54:43 EDT 1999
Starting kswapd v 1.4.2.2
Serial driver version 4.13 with no serial options enabled
tty00 at 0x03f8 (irq = 4) is a 16550A
tty02 at 0x03e8 (irq = 4) is a 16550A
Ramdisk driver initialized : 16 ramdisks of 4096K size
loop: registered device at major 7
hda: TOSHIBA MK1301MAV, 1296MB w/128kB Cache, CHS=658/64/63
hdc: TOSHIBA CD-ROM XM-1502BN, ATAPI CDROM drive
ide2: ports already in use, skipping probe
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
ide1 at 0x170-0x177,0x376 on irq 15
Floppy drive(s): fd0 is 1.44M
FDC 0 is an 8272A
scsi : 0 hosts.
scsi : detected total.
SLIP: version 0.8.4-NET3.019-NEWTTY (dynamic channels, max=256).
Partition check:
hda: hda1 hda2 < hda5 hda6 >
VFS: Disk change detected on device 02:3c
RAMDISK: Compressed image found at block 507
VFS: Mounted root (minix filesystem).
INIT: version 2.60 booting
INIT: Switching to runlevel: 5
INIT: Sending processes the TERM signal
MINIX-fs: mounting unchecked file system, running fsck is recommended
/usr loading...
.............. ..............1761+0 records in
41+1 records out
4477 Blocks
scsi : 0 hosts.
scsi : 0 hosts.
scsi : 0 hosts.
scsi : 0 hosts.
EATA0: address 0x1f0 in use, skipping probe.
EATA0: address 0x170 in use, skipping probe.
scsi : 0 hosts.
scsi : 0 hosts.
scsi : 0 hosts.
ppa: Version 1.42
ppa: Probing port 03bc
ppa: Probing port 0378
ppa: SPP port present
ppa: PS/2 bidirectional port present
ppa: Found device at ID 6, Attempting to use EPP 32 bit
ppa: Found device at ID 6, Attempting to use PS/2
ppa: Communication established with ID 6 using PS/2
ppa: Probing port 0278
scsi0 : Iomega parport ZIP drive
scsi : 1 host.
Vendor: IOMEGA Model: ZIP 100 Rev: J.03
Type: Direct-Access ANSI SCSI revision: 02
Detected scsi removable disk sda at scsi0, channel 0, id 6, lun 0
SCSI device sda: hdwr sector= 512 bytes. Sectors= 196608 [96 MB] [0.1 GB]
sda: Write Protect is off
sda: sda4
scsi : 1 host.
scsi : 1 host.
Select keyboard, ENTER for default (15 seconds). |
|
| Back to top |
|
 |
successlieswithme Private
Joined: 27 Sep 2005
Posts: 29
|
Posted: Fri Sep 30, 2005 7:55 am Post subject: |
|
|
Boot the system from alternate media In order to easily recover your operating system, you will need a "mini root," or limited root shell where you can run fdisk, mkfs, gzip, and pax/tar/cpio, etc. You will also need support for whatever backup media you have chosen. Luckily for both of us, all of this functionality is provided via "rescue floppies." These floppies contain a minimal version of Linux and all of the recovery utilities listed above. They also have several drivers for popular backup media, including parallel port Zipİ drives, SCSI tape drives, NFS and SMB. A list of such rescue floppies may be found at http://metalab.unc.edu/pub/Linux/system/recovery/.
The rescue floppy that I chose to use was tomsrtbt, and can be found at http://www.toms.net/rb. Just look at all the drivers and utilities that you get on one floppy:
The 2.0.36 kernel, 3c589_cs, BusLogic, CVF, DEC_ELCP, EEXPRESS, EEXPRESS_PRO, EL2, EL3, EXT2, FAT, FAT32, FD, IDE, IDECD, IDEFLOPPY, IDEPCMCIA, IDETAPE, ISO9660, JOLIET, LOOP, MATH_EMULATION, MINIX, MSDOS, NE2000, NFS, PROC, RAM, SD, SERIAL, SLIP, SMC, SR, TR, ULTRA, VFAT, VORTEX, WD80x3, ah152x_cs, aha152x, aha1542, aic7xxx, ash, awk, badblocks, bdflush, bZipİ2, cardbus, cardmgr, cat, ce, ce.help, chattr, chgrp, chmod, chown, chroot, clear, cmp, cp, cpio, cut, date, dd, ddate, debugfs, df, dirname, dmesg, dmsdos, ds, du, dumpe2fs, dutil, e2fsck, eata, echo, egrep, elvis, emacs, extend, false, fdflush, fdformat, fdisk, fdomain, filesize, find, fmt, fsck.ext2, fsck.msdos, fstab, grep, gzip, halt, head, hexedit, hostname, i82365, ifconfig, ifport, ile, init, inittab, insmod, kill, killall5, ksyms, length, less, libc.so.5.4.13, lilo, lilo.conf, ln, loadkeys, login, losetup, ls, lsattr, mawk, memtest, mingetty, miterm, mkdir, mkdosfs, mke2fs, mkfifo, mkfs.minix, mklost+found, mknod, mkswap, mnsed, more, mount, mt, mv, nc, ncr53c8xx, nmclan_cs, ntfs, pax, pcmcia, pcmcia_core, pcnet_cs, ping, plip, ppa, printf, ps, pwd, qlogic_cs, qlogicfas, reboot, reset, rm, rmdir, rmmod, route, rsh, rshd, script, scsi_info, seagate, sed, serial_cs, setserial, sh, slattach, sleep, slip, snarf, sort, split, stty, swapoff, swapon, sync, tail, tar, tcic, tee, telnet, test, touch, tune2fs, umount, update, vi, vi.help, and wc!
If the driver that you need is not available in the default floppy, Tom has compiled a huge set of drivers that you can use to build your own custom floppy, and has included instructions on how to do so. He even tells me that it is possible to build a "rescue CD" that could contain all of these drivers for use anywhere! (But I don't think it has been done.) Needless to say, I was quite impressed with tomsrtbt, and have included it on the tools CD. (Tom Oehser deserves quite a bit of credit for developing such a good tool, and being very responsive to my emails. He was very helpful during the development and testing of this procedure, and I don't think I could have done it without him.) Tom simply asked that I include this disclaimer:
*******************************************************************************
* If you base something on it, use any of the scripts, distribute binaries or
*******************************************************************************
Once you boot from your rescue floppy, you can perform the rest of this procedure from a fully-functional root shell. What about Alpha and Sparc? The rescue floppy and lilo parts of this procedure are Intel-specific, and won't be of much help with the Alpha and Sparc versions of Linux. There is a rescue floppy for UltraLinux (the new name of the Sparc Linux port) at ftp://vger.rutgers.edu/pub/linux/Sparc/rescue. It appears to contain all of the necessary utilities. It has silo but not chroot, however it looks like the chroot trick might not be necessary for silo.
I couldn't find a rescue disk for AlphaLinux. The milo documentation implies that it is quite different from lilo and silo; in fact it may be standard to flash milo into a boot prom of some sort. This would mean that you would have to restore it by reflashing this information. If anyone can help clear up this confusion, please write! Repartition and newfs the root disk Since you saved a copy of how the root disk was partitioned, you will be able to partition the new root drive the same way. The way to do this is with fdisk. Unfortunately, many people are becoming less familiar with fdisk and more familiar with the "Disk Druid." Since Disk Druid is not available on the rescue floppies, so you will need to learn how fdisk works. An example of how to use fdisk is included later in this chapter.
After you have repartitioned the root drive, you'll need to use mkfs to recreate the root file system(s). Finally you are ready to restore the data. Restore the operating system to the new disk The first thing that needs to happen is to get access to the backed up data. In my case, the ppa driver was already loaded, and I just needed to mount the Zipİ drive as a file system. You may have to do one of the following:
- Mount a Zip or Jaz drive as a file system
- Load drivers for you SCSI card and tape drive
- Load network and NFS drivers, configure your network interface and mount an NFS file system
- Load network and SMB drivers, configure your network interface and mount an SMB file system
- Use pax to spread the backup of your operating system across 200 floppies or so .
In my case, the backup was made with pax (emulating tar) and gzip, to a Zipİ drive. The drivers and tools needed to do this were all available on tomsrtbt. Later in this chapter, you will see an example of how this worked. Restore the boot block information The boot block is a special part of the disk that is used to load the operating by its "bootstraps." It contains just enough executable code to locate and load the kernel. In Linux Intel situations, this boot block is referred to as the master boot record (MBR), and you can restore it using the lilo command.
This one was slightly trickier than I thought it would be. Although it is as simple as running lilo, you probably cannot use the lilo command provided on tomsrtbt. In my case it was not the same version as the one on my root disk. Since the restored operating system disk was mounted on /root, all you have to do run chroot /root /sbin/lilo. (Your version of lilo may not be in /sbin. You will have to use the full path for your particular version of lilo.) This command performs a chroot to /root, then reads /etc/lilo.conf to determine what to put in the master boot block. It then rebuilds the boot block for you.
Once this is done, you are ready to remove the floppy and boot the restored system! An example The example below uses pax (emulating tar), gzip, fdisk, lilo, and tomsrtbt to back up and recover a complete Linux system on a Toshiba Satellite Pro laptop.
As mentioned above, we backed up the metadata by running the command:
# fdisk -l >/etc/fdisk-l.txt
We then backed up the operating system using pax (emulating tar) to a Zipİ drive mounted on /backup:
# cd / ; tar cf - . |gzip -c >/backup/root.tar.gz
Now it's time to blow it up! The dd command below blows away both the lilo boot block and the disk's partition information. Although the root filesystem is still there, we couldn't find it if we wanted to!
# dd if=/dev/zero of=/dev/hda bs=512 count=1
# reboot
Insert system disk in drive
Press any key when ready. Boot the system The first step in recovering this system is to place the tomsrtbt floppy into the floppy drive and press any key. Here's what it displays while it is booting:
Welcome to tomsrtbt-1.7.134
http://www.toms.net/rb
#####
#######
##O#O##
#VVVVV#
## VVV ##
# ##
# ## ~
# ### . .
QQ# ##Q /V
QQQQQQ# #QQQQQQ //
QQQQQQQ# #QQQQQQ /( )
QQQQQ#######QQQQ ^`~'^
Other distributions tomsrtbt
One thing's for sure. Tom's got at least one of the qualities of a good programmer: hubris! (I saw this display for the first time at about 2:00 AM, and just about hit the floor laughing!)
(15 seconds...)
boot:
Loading zImage..............
to see video modes available, <SPACE> to continue or wait 30 secs
Uncompressing Linux..............
Memory: sized by int13 088h
Console: 16 point font, 400 scans
Console: colour VGA+ 80x25, 1 virtual console (max 63)
pcibios_init : BIOS32 Service Directory structure at 0x000f8e20
pcibios_init : BIOS32 Service Directory entry at 0xfe95b
pcibios_init : PCI BIOS revision 2.10 entry at 0xfdcd8
Probing PCI hardware.
Calibrating delay loop.. ok - 52.84 BogoMIPS
Memory: 47024k/49280k available (812k kernel code, 384k reserved, 1060k data)
Swansea University Computer Society NET3.035 for Linux 2.0
NET3: Unix domain sockets 0.13 for Linux NET3.035.
Swansea University Computer Society TCP/IP for NET3.034
IP Protocols: ICMP, UDP, TCP
Checking 386/387 coupling... Ok, fpu using exception 16 error reporting.
Checking 'hlt' instruction... Ok.
Intel Pentium with F0 0F bug - workaround enabled.
alias mapping IDT readonly ... ... done
Linux version 2.0.36 (root@6M) (gcc version 2.7.2.3) #29 Fri May 7 12:54:43 EDT 1999
Starting kswapd v 1.4.2.2
Serial driver version 4.13 with no serial options enabled
tty00 at 0x03f8 (irq = 4) is a 16550A
tty02 at 0x03e8 (irq = 4) is a 16550A
Ramdisk driver initialized : 16 ramdisks of 4096K size
loop: registered device at major 7
hda: TOSHIBA MK1301MAV, 1296MB w/128kB Cache, CHS=658/64/63
hdc: TOSHIBA CD-ROM XM-1502BN, ATAPI CDROM drive
ide2: ports already in use, skipping probe
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
ide1 at 0x170-0x177,0x376 on irq 15
Floppy drive(s): fd0 is 1.44M
FDC 0 is an 8272A
scsi : 0 hosts.
scsi : detected total.
SLIP: version 0.8.4-NET3.019-NEWTTY (dynamic channels, max=256).
Partition check:
hda: hda1 hda2 < hda5 hda6 >
VFS: Disk change detected on device 02:3c
RAMDISK: Compressed image found at block 507
VFS: Mounted root (minix filesystem).
INIT: version 2.60 booting
INIT: Switching to runlevel: 5
INIT: Sending processes the TERM signal
MINIX-fs: mounting unchecked file system, running fsck is recommended
/usr loading...
.............. ..............1761+0 records in
41+1 records out
4477 Blocks
scsi : 0 hosts.
scsi : 0 hosts.
scsi : 0 hosts.
scsi : 0 hosts.
EATA0: address 0x1f0 in use, skipping probe.
EATA0: address 0x170 in use, skipping probe.
scsi : 0 hosts.
scsi : 0 hosts.
scsi : 0 hosts.
ppa: Version 1.42
ppa: Probing port 03bc
ppa: Probing port 0378
ppa: SPP port present
ppa: PS/2 bidirectional port present
ppa: Found device at ID 6, Attempting to use EPP 32 bit
ppa: Found device at ID 6, Attempting to use PS/2
ppa: Communication established with ID 6 using PS/2
ppa: Probing port 0278
scsi0 : Iomega parport ZIP drive
scsi : 1 host.
Vendor: IOMEGA Model: ZIP 100 Rev: J.03
Type: Direct-Access ANSI SCSI revision: 02
Detected scsi removable disk sda at scsi0, channel 0, id 6, lun 0
SCSI device sda: hdwr sector= 512 bytes. Sectors= 196608 [96 MB] [0.1 GB]
sda: Write Protect is off
sda: sda4
scsi : 1 host.
scsi : 1 host.
Select keyboard, ENTER for default (15 seconds). |
|
| Back to top |
|
 |
successlieswithme Private
Joined: 27 Sep 2005
Posts: 29
|
Posted: Fri Sep 30, 2005 7:56 am Post subject: |
|
|
What you have is...
3c589_cs BusLogic agetty aha152x aha152x_cs aha1542 aic7xxx ash awk badblocks
bdflush boot.b buildit.s busybox bZip2 cardbus cardmgr cat ce ce.help chain.b
chattr chgrp chmod chown chroot clear clone.s cmp common config cp cpio cut date
dd ddate debugfs df dhcpcd dirname dmesg dmsdos ds du dumpe2fs dutil e2fsck eata
echo echo.c elvis emacs extend false fdflush fdformat fdisk fdomain filesize
find fmt fsck.ext2 fsck.msdos fstab grep group gzip halt head hexdump hexedit
host.conf hostname hosts i82365 ifconfig ifport ile image init inittab insmod
install.s issue kill killall5 ksyms ld ld-linux length less libc libcom_err
libe2p libext2fs libss libtermcap libuuid lilo lilo.conf ln loadkeys login
losetup ls lsattr man map mawk memtest miterm mkdir mkdosfs mke2fs mkfifo
mkfs.minix mklost+found mknod mkswap mnsed more more.help mount mt mtab mv nc
ncr53c8xx network networks nmclan_cs ntfs passwd pax pcmcia pcmcia_core pcnet_cs
ping plip ppa printf profile protocols ps pwd qlogic_cs qlogicfas rc.0 rc.6 rc.M
rc.S rc.custom rc.custom.gz reboot reset resolv.conf rm rmdir rmmod route rsh
rshd script scsi scsi_info seagate sed serial serial_cs services setserial
settings.s sh shared shutdown slattach sleep snarf sort split stty swapoff
swapon sync tail tar tcic tee telnet telnetd termcap test tomshexd tomsrtbt.FAQ
touch true tune2fs umount unpack.s update utmp vi vi.help wc zImage
...Login as root. Remove the floppy. AltF1-AltF4 for consoles.
tty1 tomsrtbt login: root
The default "root" password is "xxxx",
edit /etc/passwd ro change it, or edit
settings.s to change it permanently
Password:
Today is Pungenday, the 19th day of Bureaucracy in the YOLD 3165
# The Discordian Calendar I just couldn't let this be. I had to ask myself, what in the world is "Pungenday?!?!" As usual, the web knows everything. Since I know that my fellow Linux users are going to want to know, here's the answer, from the Principia Discordia :
The Discordian calendar divides the year into five seasons (commonly known as Chaos, Discord, Confusion, Bureaucracy and the Aftermath) of 73 days each. Every four years, an extra day (St. Tib's Day) is inserted between Chaos 59 and Chaos 60.
The Discordian calendar defines a week as having five days, named Sweetmorn, Boomtime, Pungenday, Prickle-Prickle, and Setting Orange (after the Five Elements). Chaos 1 is always Sweetmorn, Chaos 2 Boomtime, The Aftermath 73 Setting Orange, etc. St. Tib's Day is none of the five days of the week.
The Discordian calendar's year 0 (notionally the time of the Original Snub) is known in the Gregorian calendar as 1166 BC; alternatively, the Gregorian year 0 (notionally the birth of the Jewish mystic Yeshua ben Yosef) is known as 1166 YOLD in the Discordian calendar. The year known in the Gregorian calendar as 1995 is known as 3161 in the Discordian calendar.
I had to ask.
Partitioning and formatting the root drive Since we need to repartition the root disk, we need to know what it looked like. In order to do that, we need to mount the Zipİ drive and restore the files that contain this information. (The Zipİ drive shows up as /dev/sda4.)
# mount /dev/sda4 /mnt
# ls -l /mnt
# ls -lt /mnt/*gz
-rw-r--r-- 1 root root 41393598 Aug 24 00:21 /mnt/root.tar.gz
# gzip -dc /mnt/root.tar.gz|tar xvf - ./etc/fstab ./etc/fdisk-l.txt
Tar: blocksize = 20
./etc/fstab
./etc/fdisk-l.txt
# cat /etc/fdisk-l.txt
Disk /dev/hda: 64 heads, 63 sectors, 658 cylinders
Units = cylinders of 4032 512 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 225 453568+ 83 Linux native
/dev/hda2 226 658 872928 5 Extended
/dev/hda5 226 308 167296+ 82 Linux swap
Now that we know what the old disk looked like, we will partition the new disk. To demonstrate that the label is gone, I will display the current partition table, which is empty. Then I will add a primary partition, an extended partition, and a logical partition inside the extended partition.
# dd if=/dev/zero of=/dev/hda1 bs=1024 count=1
# fdisk /dev/hda
Command (m for help): p
Disk /dev/hda: 64 heads, 63 sectors, 658 cylinders
Units = cylinders of 4032 512 bytes
Device Boot Start End Blocks Id System
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-658): 1
Last cylinder or +size or +sizeM or +sizeK ([1]-658): 225
Command (m for help): n
Command action
e extended
p primary partition (1-4)
e
Partition number (1-4): 2
First cylinder (226-658): 226
Last cylinder or +size or +sizeM or +sizeK ([226]-658): 658
Command (m for help): n
Command action
l logical (5 or over)
p primary partition (1-4)
l
First cylinder (226-658): 226
Last cylinder or +size or +sizeM or +sizeK ([226]-658): 608
Command (m for help): p
Disk /dev/hda: 64 heads, 63 sectors, 658 cylinders
Units = cylinders of 4032 512 bytes
Device Boot Start End Blocks Id System
/dev/hda1 1 225 453568+ 83 Linux native
/dev/hda2 226 658 872928 5 Extended
/dev/hda5 226 608 772096+ 82 Linux native
Now that we have correctly sized the partitions, there are two remaining issues. First, we must change the partition type of /dev/hda5 to "Linux Swap" (with the t option), and set the bootable flag on /dev/hda1 (with the a option).
Command (m for help): t
Partition number (1-5): 5
Hex code (type L to list codes): 82
Changed system type of partition 5 to 82 (Linux swap)
Command (m for help): a
Partition number (1-5): 1
Command (m for help): p
Disk /dev/hda: 64 heads, 63 sectors, 658 cylinders
Units = cylinders of 4032 512 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 225 453568+ 83 Linux native
/dev/hda2 226 658 872928 5 Extended
/dev/hda5 226 608 772096+ 82 Linux swap
You can see above that the bootable flag is now set, and partition five is configured as Linux Swap. Now that we have correctly sized and configured the partitions, we need to write the disk label to the disk:
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Now that the disk has been properly partitioned and labeled, we need to create a file system on it with the mke2fs command. When we are done, we can mount the new root filesystem.
# mke2fs /dev/hda1
mke2fs 1.10, 24-Apr-97 for EXT2 FS 0.5b, 95/08/09
Linux ext2 filesystem format
Filesystem label=
113792 inodes, 453568 blocks
22678 blocks (5.00%) reserved for the super user
First data block=1
Block size=1024 (log=0)
Fragment size=1024 (log=0)
56 block groups
8192 blocks per group, 8192 fragments per group
2032 inodes per group
Superblock backups stored on blocks:
8193, 16385, 24577, 32769, 40961, 49153, 57345, 65537, 73729,
81921, 90113, 98305, 106497, 114689, 122881, 131073, 139265, 147457,
155649, 163841, 172033, 180225, 188417, 196609, 204801, 212993, 221185,
229377, 237569, 245761, 253953, 262145, 270337, 278529, 286721, 294913,
303105, 311297, 319489, 327681, 335873, 344065, 352257, 360449, 368641,
376833, 385025, 393217, 401409, 409601, 417793, 425985, 434177, 442369,
450561
Writing inode tables:
Writing superblocks and filesystem accounting information: done
# mkdir /root
# mount /dev/hda1 /root
# mount /dev/hda1 /root
# df -k
Filesystem 1024-blocks Used Available Capacity Mounted on
/dev/ram0 798 776 22 97% /
/dev/ram1 2546 2440 106 96% /usr
/dev/ram3 4049 3 4046 0% /tmp
/dev/sda4 95167 41094 49159 46% /mnt
/dev/hda1 439063 13 416372 0% /root Restoring the operating system and lilo boot block We are now ready to actually restore the operating system. We will cd to /root and use gzip and pax (emulating tar) to restore from the backup file on the Zipİ disk.
# cd /root
# ls -lt /mnt/*gz
-rw-r--r-- 1 root root 41393598 Aug 24 00:21 /mnt/root.tar.gz
# gzip -dc /mnt/root.tar.gz|tar xf -
Tar: blocksize = 20
Now that the root filesystem is restored, we need to restore the lilo boot block. Making this work was tricky. We cannot use the lilo command on tomsrtbt, and we cannot run the lilo command on the root file system directly without it complaining. It needs to run it inside an environment where it thinks /root is actually /. The way to do this is to run the command chroot /root prior to running the lilo command:
# chroot /root /sbin/lilo
Added linux
# reboot
And you're done! Remember, make sure that you test this procedure before you need it. |
|
| Back to top |
|
 |
|
Powered by phpBB © 2001, 2005 phpBB Group
|