[SOLVED] Need help recovering /boot on a RHEL 5 server
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have RHEL 5 server that I add a new SAN LUN to. I'm also using EMC's powerpath to manage multipathing. The new disk showed up after re-scanning the SCSI bus then running the 'powermt config' command. I was trying to configure the new storage for an LVM but on device /dev/emcpowerai but I inadvertantly ran fdisk against /dev/emcpowera1, the partition that houses /boot. So now if I fdisk -l to list the partitions on the disk for /emc/emcpowera I get:
Quote:
[root@ods2prdr5p ~]# fdisk -l /dev/emcpowera
Disk /dev/emcpowera: 268.4 GB, 268435456000 bytes
255 heads, 63 sectors/track, 32635 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/emcpowera1 * 1 13 104391 83 Linux
/dev/emcpowera2 14 32635 262036215 8e Linux LVM
And if I run fdisk -l against /dev/emcpowera1 I get this:
Quote:
Disk /dev/emcpowera1: 106 MB, 106896384 bytes
255 heads, 63 sectors/track, 12 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/emcpowera1p1 1 12 96358+ 8e Linux LVM
So it looks like I've created a "sub" partition on /dev/emcpowera1.
Obviously, I'm scared to death that I've screwed up my boot partition. I have not yet rebooted and I'm hoping someone can help me back out of the mess I've gotten into. Any suggestions?
First, see if you have overwritten the superblock:
Code:
dumpe2fs /dev/emcpowera1 | grep superblock
If it says you have a primary at block 1, then you did not. In that case you can umount and run the appropriate type of fsck for your filesystem: ext2, ext3 or ext4. If you have some other FS, then ignore me, since I'm less familiar with those.
Once fsck passes, you can remount and make sure your boot files are still there.
Thank you, looks like things may not be as bad as I feared:
Quote:
[root@ods2prdr5p ~]# dumpe2fs /dev/emcpowera1 | grep superblock
dumpe2fs 1.39 (29-May-2006)
Primary superblock at 1, Group descriptors at 2-2
Backup superblock at 8193, Group descriptors at 8194-8194
Backup superblock at 24577, Group descriptors at 24578-24578
Backup superblock at 40961, Group descriptors at 40962-40962
Backup superblock at 57345, Group descriptors at 57346-57346
Backup superblock at 73729, Group descriptors at 73730-73730
The primary superblock is at 1. I also have a test system that I used to perform the same steps on, recreating my predicament. I created another partition on the boot partition. But before rebooting I went back into fdisk and deleted the partition. I then rebooted the box and it came up fine. But the box I'm concerned about is a production system, so I'm waiting for input from Redhat as well as this forum. But I'm thinking I may be okay just deleting the partition.
You should be OK. Creating a partition table affected only the first 512-byte block in the partition. The primary ext2/3/4 superblock is the 2nd 1K block, so you never touched it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.