Recovery Mode in detail
From Amen Wiki
Contents |
[edit] Important Notice
As the systems administrator for your server, you need to understand that any modifications to the operating system or settings could, if not carefully thought out, render your server inaccessible or unusable. In a worst case scenario you may need to reinstall the server from scratch resulting in the loss of all data stored on the server.
[edit] Linux Dedicated Server
There are numerous tasks you can carry out while the server is in recovery mode, you will however only be able to access via SSH
[edit] Mounting the file system of your server's hard disk
When you first connect to your hostname or IP with SSH you will be accessing the file system of the Recovery Server itself rather that of your Dedicated Server's hard disk.
For most tasks that you might wish to perform you will first need to Mount your Dedicated Server's file system.
To do so first of all, you will need to discover the location of your file system, you could for example run the following command:
cfdisk
here is an example output:
cfdisk 2.12r
Disk Drive: /dev/hda
Size: 82348277760 bytes, 82.3 GB
Heads: 255 Sectors per Track: 63 Cylinders: 10011
Name Flags Part Type FS Type [Label] Size (MB)
------------------------------------------------------------------------------
hda1 Boot, NC Primary Linux ext2 100,01*
hda2 Primary Linux swap / Solaris 1024,00*
hda3 Primary Linux ext3 77409,00*
Pri/Log Free Space 3810,28*
[Bootable] [ Delete ] [ Help ] [Maximize] [ Print ]
[ Quit ] [ Type ] [ Units ] [ Write ]
Toggle bootable flag of the current partition
In the above example, for that server you can see the Disk Drive is found within /dev/ and that it's disk partitions happen to all begin with 'hda' followed by a number as seen in the (Name) column, and that the largest volume happens to be called hda3, the largest volume when you run the cfdisk command on your SSH session will be the one that holds your Dedicated Server's data.
Following the example cfdisk output - to mount that volume you could type:
mount –t ext3 /dev/hda3 /mnt/
Then the Files from Dedicated Server's file system are then accessible in the folder /mnt/ of the Recovery Server so you can move into that directory using the command:
cd /mnt/
From here you can see the root level of your Dedicated Server's hard disk, running the command below should assure you of this by listing the contents of /mnt/:
ls -la
Now that you can view your Dedicated Server's hard disk's files you should be able to navigate around your folder structure.
Reasons you may need to do this may commonly include:
- Making a back up of config files and any other vitally important data you might not already have a local copy of.
- To review or edit config files.
- View server logs.
And should there be anything vital to make a back up of, you can use Linux shell commands to do this.
Once you have done everything you needed to do - you can unmount the hard disk using for example:
umount /mnt/
[edit] Running a disk file system check
You may find having looked at log files etc that your disk drive needs a disk check run on it, a possible reason for this that there may be errors on the disk's file system which are stopping it from loading the operating system up correctly.
fsck is a disk checking utility that can find and repair file disk errors but it strongly advisable to consult official documentation and other online sources about fsck before attempting to run it, you should never run fsck whilst the volume you wish to run it on is mounted always unmount it first, we refer you also to the notice at the top of this page.
