How to Recover /dev and /boot directory in RedHat Linux 5.3
Hi
I am using Redhat Linux5.3. Accidentlly I fired rm -rfv / command from putty and deleted /dev and /boot directorty. The file system is ext3. The deleted directory was mounted on /dev/sdb1. Can any one Please help on this how to restore these directories. Thanks in Advance In addition to that when I am trying to connect through putty it gives me error "Server refused to allocate pty" . I have only one putty connection open which is connected before the delete was done. After deletion of /dev and /boot directory I am not able to connect through putty. Please help me on this. |
Since you have no /dev there are no (pseudo) devices for any process to connect to. Hence starting any process, let alone login process, will fail, epically. of If you have access to any Out of Band connection methods like IPMI, DRAC, ILO or other form of console server (or through your virtualization layer if applicable) try those, attach a Live or installer CD and re-populate /dev. If you have no such way then you're SOL. In that case (contact Data Centre personnel to either set aside this "victim" machine as a copy and) reload from backup. If you have no backups then you're SOL twice but at least now you've learned why you should make them regularly and test restores work.
|
Can you please tell me the steps for re-populating /dev directory?
|
In most distro rebooting would repopulate the /dev. But /boot holds the linux kernels and initramfs images. For that you have to copy from a backup.
|
Below are the list of files which have been deleted from /boot directory. Can you Please tell me which all files should require to reboot the system?
removed `//boot/grub/stage2' removed `//boot/grub/ufs2_stage1_5' removed `//boot/grub/menu.lst' removed `//boot/grub/reiserfs_stage1_5' removed `//boot/grub/fat_stage1_5' removed `//boot/grub/grub.conf' removed `//boot/grub/minix_stage1_5' removed `//boot/grub/iso9660_stage1_5' removed `//boot/grub/vstafs_stage1_5' removed `//boot/grub/stage1' removed `//boot/grub/xfs_stage1_5' removed `//boot/grub/jfs_stage1_5' removed `//boot/grub/splash.xpm.gz' removed `//boot/grub/device.map' removed `//boot/grub/e2fs_stage1_5' removed `//boot/grub/ffs_stage1_5' removed directory: `//boot/grub' removed `//boot/symvers-2.6.18-164.el5PAE.gz' removed `//boot/config-2.6.18-164.el5PAE' removed `//boot/initrd-2.6.18-164.el5PAE.img' removed `//boot/.vmlinuz-2.6.18-164.el5PAE.hmac' removed `//boot/System.map-2.6.18-164.el5PAE' removed `//boot/vmlinuz-2.6.18-164.el5PAE' removed directory: `//boot/lost+found' |
The files required are:
/boot/initrd-2.6.18-164.el5PAE.img This is initrd/initramfs image /boot/vmlinuz-2.6.18-164.el5PAE This is kernel image Plus you would need a boot loader to boot linux; means all under /boot/grub directory. |
Can I use initrd-2.6.18-128.el5PAE.img in the place of initrd-2.6.18-164.el5PAE.img (Diffrent version). I have back up of all files but the version is slight change I have 2.6.18-128. Is this work?
|
Quote:
|
Can I get this two files from internet since i dont have backup of the same version.
|
No. The initrd was built to support your hardware. I'm a bit rusty on CentOS 5, but if it has the /sbin/new-kernel-pkg script you could use that to build a new initrd. You would probably have to play some games to prevent that script from trying to update the GRUB config file -- probably best to save a copy of that file and restore it afterward. Take a look at that script, but the invocation should be something like
Code:
new-kernel-pkg --mkinitrd --install 2.6.18-164 |
Hi
I copied the boot folder from another server which has same hardware. Now I have reboot the machine but its not restarting. At the time of starting it showing following error code. GNU GRUB version 0.97(625k lower / 2047616k upper memory) [Minimal BASH-like line editing is supporetd. For the first word, TAB lists possible command completions. Anywhere else TAB lists the possible completions of a device/filename.] grub>_ Please help me on this. |
Can anyone please help me on this?
|
The above grub message means it doesn't have the required modules and grub.conf it needs. So a minimal mode is started.
See you have to reinstall grub2 to the boot folder. I don't use rhel, but do you have a livecd/ rescue cd of RHEL 5.3. If so boot it up and reinstall grub. You can manually install with command 'grub-install'. Please read about the command thoroughly. You can copy the kernel and initrd/initramfs image from another system to boot. But if the systems are different then some modules or perhaps necessary scripts won't allow to boot. So you may have to manually edit initrd/initramfs file appropriately. Some posts in LQ discussed about mounting all the filesystem appropriately and then chroot to it and install kernel and other packages through a rescue/live cd. Let others with more know how about rhel help. |
Thanks for reply. Can anyone tell me how to install GRUB mannually in RHEL5.3 ? what will be the exact command? My /boot folder was mounted on /dev/sda1 directory.
|
Quote:
https://access.redhat.com/documentat...nstalling.html ...which tells you how to install grub manually. Also, you are using old, unsupported RHEL 5.3...are you PAYING FOR RHEL??? If not, you need to stop where you are, and load CentOS instead. It's almost identical to RHEL, but FREE, and upgrade your server while you're at it. The current version is 7.x. |
All times are GMT -5. The time now is 12:33 AM. |