Here is an example using entries for the cpqarray driver:
Note: Make as many or as few device nodes as you need. Don't waste time creating nodes for devices you don't even have. Here is a table containing device node values for the first controller of the ide, sda, cpqarray, cciss, and md drivers.
If you need to access a 2nd drive on the same controller, here are the device node values for the second drive of the ide, sda, cpqarray, and cciss drivers:
If you need to access to a 2nd array controller, here are the device node values for the second array controllers:
The first and second floppy drives are noted by the following:
Here is an example using fdisk to list partitions on an array controller:
Here is an example mounting a root partition. In this example partition 6 is our root partition.
Note: If "ls" does not list the fstab file, then the partition mounted is probably not the root partition. Unmount that partition and then try another partition until the root partition is found. If "e2label" is present, it may be helpful in determining which partition is which. Here is an example of using e2label on partition number 5:
e2label should then respond with what mount point c0d0p5 uses. It is possible that e2label may not be available. It is also possible that the partitions may not have been labeled with e2label.
Use the mount command to list partitions you have mounted.
Use the umount command to unmount partitions.
Below this line is more detailed information. The above section should allow you to recover your system; however, if you need more information, then you may read on for more details. I believe that the above section concisely describes how to recover your system using only the installation media. The Quick Version of the Recovery HOWTO:This is mainly for Red Hat Linux but this concept does work on other versions (I've personally seen it work on Slackware and Corel Linux). I believe that it works for Caldera and SuSE as well. If you don't have recovery media then this section is for you.
mkdir /mydev #Examples of IDE device nodes mknod /mydev/hda b 3 0 mknod /mydev/hda1 b 3 1 mknod /mydev/hda6 b 3 6 #Examples of SCSI device nodes mknod /mydev/sda b 8 0 mknod /mydev/sda1 b 8 1 mknod /mydev/sda6 b 8 6 #Examples of Cpqarray device nodes mknod /mydev/c0d0 b 72 0 mknod /mydev/c0d0p1 b 72 1 mknod /mydev/c0d0p6 b 72 6 mkdir /mymnt mount /mydev/sda6 /mymnt mount /mydev/sda1 /mymnt/boot /mymnt/usr/sbin/chroot /mymnt su - cd / umount /mymnt/boot umount /mymnt CTRL+ALT+DEL The Long Version of the Recovery HOWTOCurrently, the only section tested in this document is the one about recovering using the Red Hat 6.0 CD method. The other methods have been pulled from memory and may have some items that don't line up with the real world. In essence it is the same thing as booting from the Red Hat 6.0 CD, it is just a lot easier to do it from the floppy (even easier if you can bring your Linux system all the way up with your boot floppy). All in all, the concept is still the same. This document discusses three methods for recovering your system if LILO is no longer pointing to your boot and root directories. 1) LILO no longer works on the hard drive, but my system boots with my boot diskette 2) I have a boot diskette for my system 3) I don't have a boot diskette for my system. If you are able to boot your Linux system from floppy then proceed to the section marked "Recovering LILO from within Linux." If you have a boot disk but are unable to bring Linux up, then see the section marked "How to recover LILO by using your Boot and Root disk for your System." If you don't have a boot diskette, then see the section marked "How to recover LILO without a Boot and Root disk for your System." Recovering LILO from within LinuxIf you are forced to use your boot diskette to boot Linux on your system every time because LILO on your hard drive doesn't work, then you can change this by repairing LILO. You just need to boot your system, edit your /etc/lilo.conf and /etc/fstab, then run /sbin/lilo to put out a fresh LILO into the /boot partition. Make sure that your /boot partition is the only partition made active and is a primary partition. How to recover LILO by using your Boot and Root disk for your SystemThis section is under construction. I am doing this step here from memory. I don't currently have a valid boot disk for my system, but since I have been through the process once or twice, I will go ahead and give you what info I have. I will give more precise details later once I double check these steps. Boot with your Linux Boot Disk that you created during your install, or after you installed (not the Red Hat Installation Boot Disk). Type "rescue" at the "LILO:" prompt. It will finally ask you for the rescue diskette (created from the images directory from the Installation CD). In one of the directories (probably /dev or /tmp) you will find device nodes which point to your hard drive and partitions. Make a mount point (empty directory, preferably under /mnt), then mount your root ("/") partition into the your mount point. Next mount your /boot partition into your mounted root ("/") partition. You should now be able to do a chroot into your mount point which holds your root ("/") partition, then do a "cd /" to get you to the root directory of your root partition (sometimes running chroot, gives strange results if you don't follow that command with a "cd /"). Make corrections to /etc/lilo.conf and /etc/fstab, save your changes, then run /sbin/lilo to put out a fresh copy of LILO. You should now be able to type "exit" followed by a "cd /" to get out of the chroot shell. Now unmount your /boot partition, then unmount your root partition. Now reboot, pull all floppies and CD's. You should now be able to boot with LILO on the hard drive. The process should go a little like this: #get a mount point mkdir -p /mnt/drive #mount your root partition mount /dev/sda6 /mnt/drive #mount your /boot partition mount /dev/sda2 /mnt/drive/boot #chroot to /mnt/drive chroot /mnt/drive #su to root to bring in environment variables and paths su -You can print your partitions in fdisk to see what numbers you should be using in /etc/lilo.conf and /etc/fstab edit your /etc/lilo.conf and /etc/fstab, make sure you have the correct partition numbers listed there save your files (/etc/lilo.conf and /etc/fstab) #put out a fresh copy of LILO /sbin/lilo #exit from su - exit #exit from your chroot shell exit #unmount your boot and root partitions cd / umount /mnt/drive/boot umount /mnt/drive #reboot (CTRL+ALT+DEL) CTRL+ALT+DELpull all cd's and floppies Your Linux system should come back up on the hard drive if you properly configured /etc/lilo.conf and /etc/fstab and then ran /sbin/lilo. If your system didn't come up, then go back and make sure that /etc/lilo.conf and /etc/fstab are correctly set up. Be sure to run /sbin/lilo once you make your changes. How to recover LILO without a Boot and Root disk for your SystemIf you have working copies of your boot diskette for your system, then by all means use that method instead of the Red Hat 6.0 installation CD. See the section labeled "How to recover LILO by using your Boot and Root disk for your System" for instructions on how to do that. During this example, we will be using boot and root partitions on a SCSI hard drive, denoted by /dev/sda. If you have some other type of hard drive controller, then use the appropriate name and parameters for that device. You will find a table below, listing devices, and parameters. Before we get started, we will start off with a few definitions. Device Nodes:A device node is a name that references a specific device. The name is meaningless, it is just a collection of parameters. It is best to use the correct name when possible as it helps you to remember what device you are working with. Device names usually are one of the following: /dev/sda, /dev/ida/c0d0, /dev/hda. A complete device node consists of a Major and Minor number and a type specification (block or character).Major & Minor Numbers:Devices nodes have major and minor numbers. A major number would be the class of the device, the minor number would be the specific device. You have to get the correct major and minor number to speak with the correct device. For example Major 8 and Minor 0 would reference the first SCSI disk drive (actually references the whole disk or the MBR). If you run fdisk on this device, then you will be partitioning /dev/sda. Major 72 and Minor 0 would reference the first disk on the first Compaq array controller (again, it actually references the whole disk or the MBR).Block or Character Devices:Since we are dealing with hard drives and those partitions, we will be dealing with block devices. Basically block or character is the way you communicate to a specific device. I will not explain the difference between block and character, I will only inform you that for dealing with hard drives, we will be using block devices.Table of devices:Here is an example of how to create a complete listing of nodes for /dev/sda. Note that it starts with the MBR, then the 1st partition, then all the way to the 15th partition. Device letters for SCSI disks go all the way from "a" to "p". You are allowed 15 partitions per drive.mknod /mnt/sda b 8 0 mknod /mnt/sda1 b 8 1 mknod /mnt/sda2 b 8 2 mknod /mnt/sda3 b 8 3 mknod /mnt/sda4 b 8 4 mknod /mnt/sda5 b 8 5 mknod /mnt/sda6 b 8 6 mknod /mnt/sda7 b 8 7 mknod /mnt/sda8 b 8 8 mknod /mnt/sda9 b 8 9 mknod /mnt/sda10 b 8 10 mknod /mnt/sda11 b 8 11 mknod /mnt/sda12 b 8 12 mknod /mnt/sda13 b 8 13 mknod /mnt/sda14 b 8 14 mknod /mnt/sda15 b 8 15If you need to access /dev/sdb, those parameters look like: mknod /mnt/sdb b 8 16 mknod /mnt/sdb1 b 8 17 mknod /mnt/sdb15 b 8 31 mknod /mnt/sdc b 8 32 mknod /mnt/sdc1 b 8 33 mknod /mnt/sdc15 b 8 47 mknod /mnt/sdd b 8 48 mknod /mnt/sdd1 b 8 49 mknod /mnt/sdd15 b 8 63 This follows all the way to /dev/sdp15 (i.e. /dev/sda uses letters from "a" to "p") mknod /mnt/sdp b 8 240 mknod /mnt/sdp1 b 8 241 . . . mknod /mnt sdp15 b 8 255The Compaq Smart Array (/dev/ida/c0d0) has a script that will create them located at "/usr/src/linux/Documentation/mk2dev.ida". You can also create them by hand as follows: mknod /mnt/c0d0 b 72 0 mknod /mnt/c0d0p1 b 72 1 mknod /mnt/c0d0p2 b 72 2 mknod /mnt/c0d0p3 b 72 3 mknod /mnt/c0d0p4 b 72 4 mknod /mnt/c0d0p5 b 72 5 mknod /mnt/c0d0p6 b 72 6 mknod /mnt/c0d0p7 b 72 7 mknod /mnt/c0d0p8 b 72 8 mknod /mnt/c0d0p9 b 72 9 mknod /mnt/c0d0p10 b 72 10 mknod /mnt/c0d0p11 b 72 11 mknod /mnt/c0d0p12 b 72 12 mknod /mnt/c0d0p13 b 72 13 mknod /mnt/c0d0p14 b 72 14 mknod /mnt/c0d0p15 b 72 15 mknod /mnt/c0d15 b 72 240 mknod /mnt/c0d15p1 b 72 241 . . . mknod /mnt/c0d15p15 b 72 255 mknod /mnt/c1d0 b 73 0 mknod /mnt/c1d0p1 b 73 1 . . . mknod /mnt/c1d0p15 b 73 15 mknod /mnt/c2d0 b 74 0 . . . mknod /mnt/c2d15p15 b 74 255For some strange reason, you get 16 partitions out of /dev/hda (ide devices) instead of 15 out of /dev/sda (SCSI devices) and /dev/ida/c0d0 (Compaq Array Controller Devices). The last ide device stops at "h" (/dev/hdh16). mknod /mnt/hda b 3 0 mknod /mnt/hda1 b 3 1 mknod /mnt/hda16 b 3 16 mknod /mnt/hdb b 3 64 mknod /mnt/hdb16 b 3 80 mknod /mnt/hdc b 22 0 mknod /mnt/hdc16 b 22 16 mknod /mnt/hdd b 22 64 mknod /mnt/hdd16 b 22 80 mknod /mnt/hde b 33 0 mknod /mnt/hde16 b 33 16 mknod /mnt/hdf b 33 64 mknod /mnt/hdf16 b 33 80 mknod /mnt/hdg b 34 0 mknod /mnt/hdg16 b 34 16 mknod /mnt/hdh b 34 64 mknod /mnt/hdh16 b 34 80 Now lets get started with the Repair:Boot to the Red Hat 6.0 CD and let it detect your SCSI controllers:
Lets create the /mnt directory since it doesn't exist (if /mnt/exists for you then create some other directory, such as /mnt1, and use it throughout the following example): mkdir /mntLet's create a pointer to your SCSI hard drive (Remember, if you your /boot and root partitions on another device that is not a SCSI hard drive (/dev/sda), then get the appropriate device, and parameters from the above "Device Table"). The following will create pointers to your SCSI hard drive: mknod /mnt/sda b 8 0You can use fdisk /mnt/sda to see how many partitions you have and which ones are where (use "p" to list your partitions). Don't make any changes in fdisk, just find your root and /boot partitions. In this example, mine are /boot = #2 and root = #6. Use the following commands to add the partitions you need (it doesn't hurt to add device nodes for all 15 partitions, it's just a lot of work by hand to do all 15) mknod /mnt/sda1 b 8 1 mknod /mnt/sda2 b 8 2 mknod /mnt/sda3 b 8 3 mknod /mnt/sda4 b 8 4 mknod /mnt/sda5 b 8 5 mknod /mnt/sda6 b 8 6 mknod /mnt/sda7 b 8 7 mknod /mnt/sda8 b 8 8 mknod /mnt/sda9 b 8 9 mknod /mnt/sda10 b 8 10 mknod /mnt/sda11 b 8 11 mknod /mnt/sda12 b 8 12 mknod /mnt/sda13 b 8 13 mknod /mnt/sda14 b 8 14 mknod /mnt/sda15 b 8 15Do a long listing of these nodes to make sure their values are correct. You will see the major and minor numbers listed separated by a comma. If any are incorrect then remove the file (rm /mnt/sda...) and create a new node with the proper value ls -l /mntMake a directory to mount your root partition mkdir /mnt/driveMake sure it has 0755 permissions (use "chmod 0755 /mnt/drive" to fix if needed) ls -l /mnt -rwxr-xr-x . . . . . . drive #Mount your root partition onto /mnt/drive mount /mnt/sda6 /mnt/drive #Make sure /mnt/drive/boot exists ls -l /mnt/drive #Make sure /mnt/drive/boot has 0755 permissions ls -l /mnt/drive -rwxr-xr-x . . . . . . boot #Mount your /boot partition into /mnt/drive/boot mount /mnt/sda2 /mnt/drive/bootSince you have access to your full system (root and /boot partitions), you can then change those to be your root directory. /tmp/rhimage/misc/src/trees/rescue/bin/chroot /mnt/drive #bring in environment variables and pathnames su - #Then you can enter /etc cd /etc #see if /etc/fstab needs any changes less /etc/fstabBe sure to make a backup copy of /etc/fstab before you edit it. If you mess it up, it will be difficult to recreate it without the original. Here is an example of making a copy of the /etc/fstab file and giving it a date stamp of today (as of this writing) as well. #Making a backup of /etc/fstab cp /etc/fstab /etc/fstab.old991008 #If you need to edit your fstab file, then do so. pico /etc/fstab #See if /etc/lilo.conf needs any changes less /etc/lilo.confBe sure to make a backup copy of /etc/lilo.conf before you edit it. If /etc/lilo.conf gets messed up it too is somewhat hard to recreate but not impossible. Here is an example of backing up /etc/lilo.conf (I like to put the date as a part of the file name to know when I created the backup). cp /etc/lilo.conf /etc/lilo.conf.old991008 #Edit your lilo.conf if you need to. pico /etc/lilo.confAfter making your changes save and exit the files you changed. Run "lilo" to put out a fresh copy of LILO to the boot record (This step may be necessary if LILO is damaged or you have moved partitions without changing their partition number). #Run /sbin/lilo /sbin/lilo #exit from su - exit #exit from your chroot shell exit #unmount your /boot and root file systems. cd / umount /mnt/drive/boot umount /mnt/drive #reboot (CTRL+ALT+DEL) CTRL+ALT+DELpull all cd's and floppies Your Linux system should come back up on the hard drive if you properly configured /etc/lilo.conf and /etc/fstab and then ran /sbin/lilo. If your system didn't come up, then go back and make sure that /etc/lilo.conf and /etc/fstab are correctly set up. Be sure to run /sbin/lilo once you make your changes. prev next index NEW! Search this Site!: |