Saturday, May 25, 2013

Recovering the BOOT filesystem only

Scenario: Your production server has a corrupted boot partition and hangs during boot up. However the root partition is intact and cannot be overwritten. How do I perform a restore with AIR-BAG of the boot partition only?
Keywords: boot partition, boot recovery only
Operating Systems: Linux

1. Restore data only | HTML
2. Re-format partition and restore data | HTML

3. Re-create, re-format partition and restore data | HTML


Restore data of boot partition only
| Procedure 

1. 	Lets boot off the AIR-BAG Recovery CD into the Recovery Menu.

Select Option 5 (Utility Menu)
	Select Option 4 (Restore Backups Now)
		Select number that corresponds to the boot filesystem.

	EXAMPLE 
	Partition		Filesystem

	1 /dev/sda2		/
	2 /dev/sda1		/boot
	3 /dev/sda5		/home
	A Restore ALL

	P Previous Menu

		In this case above, I would select option #2 (/boot) to restore.
		This will be the only filesystem restored.

		RESTORE WILL BEGIN.

		Once restore is complete with a SUCCESS message, you may reboot the server and be back up and running.
 


Re-format and restore data of boot partition only | Procedure
 

2.	Lets boot off the AIR-BAG Recovery CD into the Recovery Menu.

Select Option 5 (Utility Menu)
	Select Option 3 (Format LINUX Partitions)
	The boot filesystem is almost always the filesystem ending in a '1'
		Select number that corresponds to the boot filesystem.

		After selecting the boot filesystem AIR-BAG will let you know what is going to happen:

			Formatting Partition:  /dev/sda1
			         File system:  ext4
			             Command:  mfks.ext4 /dev/sda1

			Press ENTER to continue or C to cancel

			You should see this message if the format was completed successfully.
			Formatting Partition...		Success

		Select Option 'P' (Previous Menu)
			Select Option 4 (Restore Backups Now)
			Select number that corresponds to the boot filesystem.

	EXAMPLE 
	Partition		Filesystem

	1 /dev/sda2		/
	2 /dev/sda1		/boot
	3 /dev/sda5		/home
	A Restore ALL

	P Previous Menu

		In this case above, I would select option #2 (/boot) to restore.
		This will be the only filesystem restored.

		RESTORE WILL BEGIN.

		Once restore is complete with a SUCCESS message, you may reboot the server and be back up and running.
	

 

Re-create, re-format and restore data of boot partition only | Procedure 

3. 	Lets boot off the AIR-BAG Recovery CD into the Recovery Menu.

Select Option 5 (Utility Menu)
	Select Option 2 (Create LINUX Partitions (fdisk))

	Select the drive to prepare:

		1 /dev/sda
		P Previous Menu

		Select option 1

		You will now be directed to the fdisk utility.

		Command (m for help): (To see screen shot of output of help screen click here)
		Type 'd'
		Type '1' [ One not 'L' ]
		Type 'n' 
		Type 'p' primary partition (1-4)
			
			First cylinder (1-xxxx, default 1):  Take default by pressing ENTER
			Last cylinder, +cylinders or +size{K,M,G} (1-128, default 128): Take default by pressing ENTER

		Type 'w'
		Type 'p'
			
	Select Option 3 (Format LINUX Partitions)
	The boot filesystem is almost always the filesystem ending in a '1'
		Select number that corresponds to the boot filesystem.

		After selecting the boot filesystem AIR-BAG will let you know what is going to happen:

			Formatting Partition:  /dev/sda1
			         File system:  ext4
			             Command:  mfks.ext4 /dev/sda1

			Press ENTER to continue or C to cancel

			You should see this message if the format was completed successfully.
			Formatting Partition...		Success

		Select Option 'P' (Previous Menu)
			Select Option 4 (Restore Backups Now)
			Select number that corresponds to the boot filesystem.

	EXAMPLE 
	Partition		Filesystem

	1 /dev/sda2		/
	2 /dev/sda1		/boot
	3 /dev/sda5		/home
	A Restore ALL

	P Previous Menu

		In this case above, I would select option #2 (/boot) to restore.
		This will be the only filesystem restored.

		RESTORE WILL BEGIN.

		Once restore is complete with a SUCCESS message, you may reboot the server and be back up and running.

 

fdisk help table

Option Result
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)