Monday, May 20, 2013

Recovering the ROOT filesystem only

Scenario: Your production server has a corrupted root partition and cannot access my database. However the boot partition is intact and cannot be overwritten. How do I perform a restore with AIR-BAG of the root partition only?
Keywords: root partition, root 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 (Unavailable on '/' restores only) | HTML 


Restore data of root 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 root '/' 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 #1 (/) 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 root 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)
		Select number that corresponds to the root filesystem.

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

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

			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 root 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 #1 (/) 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 root partition only | Procedure 

3. 	If you need to re-create the ROOT filesystem, you need to re-create the whole fdisk table which would require a full restore.
 	Only Options 1 & 2 are available for root ('/') only restores.

 

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)