Luckily, I happened to have a 2GB USB stick in my backpack that had SystemRescueCD v. Unfortunately, the server that failed to boot was running RHEL 5.8. I therefore thought it would be a good idea to create liveUSB's of RHEL so I could boot into Redhat rescue mode when servers fail to boot or have disk errors, but creating live USB media from RHEL iso images isn't straightforward.įor RHEL 7.X, Redhat recommends using dd to write the iso file onto a USB memory stick, but this method doesn't seem to work when used with DVD iso files for RHEL5. This is a hassle because some servers don't have optical drives and it's inconvenient to carry around a bunch of CD/DVD's. At work I mostly deal with servers using Redhat Enterprise Linux versions anywhere from 4.X(!!) to 7.X, so I used to carry around a CD case containing RHEL v.4~7 DVD's. Vgscan :Volume group ~]# vgscanReading all physical volumes.Recently I found myself without any RHEL DVD's or liveUSB's when encountering a server that failed with disk errors on reboot. Pvscan :Physical scanning of particular ~]# pvscanPV /dev/sda8 VG bhaskarlaptop lvm2 ![]() ![]() We need to find out physical disk,volume group and logical partition. We need few tools to manipulate that kind of partition which will provide the lvm package within the os or in come inbuilt with other rescue cd. #fsck -yfv /dev/YourRootPartition(sda,hda,….)Now lets have some fun with LVM. It will create the device file.Once it’s done you are safe to run fsck on that particular partition holding your root(/) filesystem. See it will look like this…as 4the and 5th column holds the major number and minor number.Now create the device file: So it’s clear? right.lets move on we need to find out the major number and minor number of the device to run ~]# ls -al /dev/sdaīrw-rw- 1 root disk 8, 0 Aug 16 07:15 /dev/sda Either way, the kernel itself knows almost nothing about minor numbers beyond the fact that they refer to devices implemented by your driver. Depending on how your driver is written, you can either get a direct pointer to your device from the kernel, or you can use the minor number yourself as an index into a local array of devices. The minor number is used by the kernel to determine exactly which device is being referred to. ![]() Modern Linux kernels allow multiple drivers to share major numbers, but most devices that you will see are still organized on the one-major-one-driver principle. For example, /dev/null and /dev/zero are both managed by driver 1, whereas virtual consoles and serial terminals are managed by driver 4 similarly, both vcs1 and vcsa1 devices are managed by driver 7. What is Major Number and Minor number?Traditionally, the major number identifies the driver associated with the device. So to run correctly the fsck to on a filesystem we need to create device file for that.For that we need to run mknod.But to use mknod we need to know the Major number and Minor number of the device.Lets get those number…wait before that I need to tell you few thing about what Major number and Minor number of a device and how it signifies. #linux rescue nomountNow once you fire that one you are on the prompt so you can begin work on that.įirst we need to do is fire a mknod command.īecause we had passed the option nomount in the last section so it will not parse any file system or it will not initialize any filesystem or create any device to operate on.If you try to run fsck now it will fail. The first cd/dvd will do the job for us or get a systemrescuecd to do that.Once you boot with one of those cd/dvd and put the below text at the command prompt it presents: So we need a installation cd/dvd for our rescue.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |