1and1 Help Centre Categories

print article

Mount a Partition in the Rescue System

For 1&1 Dedicated Server Linux and 1&1 Dynamic Cloud Server. 1&1 Virtual Servers use the Virtual Server Linux Rescue System.

Learn how to mount your hard drive partitions when using the Linux Rescue System, so you can make changes to configuration files on your hard drive, or back up your data.

When your server boots normally, your partitions are mounted automatically during start-up so you have access to those files. When booting a server using the Rescue System, the partitions are not mounted automatically. This article explains how to mount partitions.

Step 1
Reboot your server using the Recovery Tool.
Step 3
If network access to your server has been disabled, connect using Serial Console Access for 1&1 Dedicated Server Linux or VNC Console for 1&1 Dynamic Cloud Servers.
Step 4
Log in to the Rescue System as the root user. Use the randomly generated password that was provided to you in the 1&1 Control Panel when setting your system to boot into the Linux Rescue System.
Step 5
Type fdisk -l to list the current partition tables. In this example, the system is set up using software RAID 1 using two drives - sda and sdb. As you can see below, each of the two drives have the same partitions and then are linked together through Multiple Device Drivers and shown as md1, md5 and md6.
rescue~# fdisk -l
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1        1217     9775521   fd  Linux raid autodetect
/dev/sda2            1218        1461     1959930   82  Linux swap / Solaris
/dev/sda4            1462       19457   144552870    5  Extended
/dev/sda5            1462        2678     9775521   fd  Linux raid autodetect
/dev/sda6            2679       19457   134777286   fd  Linux raid autodetect

Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1217     9775521   fd  Linux raid autodetect
/dev/sdb2            1218        1461     1959930   82  Linux swap / Solaris
/dev/sdb4            1462       19457   144552870    5  Extended
/dev/sdb5            1462        2678     9775521   fd  Linux raid autodetect
/dev/sdb6            2679       19457   134777286   fd  Linux raid autodetect

Disk /dev/md6: 138.0 GB, 138011869184 bytes
2 heads, 4 sectors/track, 33694304 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md6 doesn't contain a valid partition table

Disk /dev/md5: 10.0 GB, 10010034176 bytes
2 heads, 4 sectors/track, 2443856 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md5 doesn't contain a valid partition table

Disk /dev/md1: 10.0 GB, 10010034176 bytes
2 heads, 4 sectors/track, 2443856 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md1 doesn't contain a valid partition table
rescue:~#

If instead you have a server with hardware RAID or no RAID , you will see output similar to the one below which will only show partitions for one drive (sda or possibly hda).
rescue~# fdisk -l
Disk /dev/sda: 750.1 GB, 750155988992 bytes
255 heads, 63 sectors/track, 91201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1        1217     9775521   83  Linux
/dev/sda2            1218        1461     1959930   82  Linux swap / Solaris
/dev/sda4            1462       91201   720836550    5  Extended
/dev/sda5            1462        2678     9775521   83  Linux
/dev/sda6            2679       91201   711060966   83  Linux
rescue:~#
Step 6
Type the mount command and press ENTER to view the already mounted devices. You should not see any /dev/md[], /dev/sd[] or /dev/hd[] devices listed as they are not automatically mounted by the Rescue System.
rescue:~# mount
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
usbfs on /proc/bus/usb type usbfs (rw)
tmpfs on /dev/shm type tmpfs (rw)
devpts on /dev/pts type devpts (rw,qid=5,mode=620)
rescue:~#
Step 7
Mount the hard drive's root partition to the /mnt folder of the Rescue System.

For software RAID, type mount /dev/md1 /mnt to mount the root md partition to the /mnt folder.
rescue:~# mount /dev/md1 /mnt

For hardware RAID, type mount /dev/sda1 /mnt to mount the root sda1 partition to the /mnt folder.
rescue:~# mount /dev/sda1 /mnt
Step 8
Type the mount command again to verify that it has mounted correctly.
rescue:~# mount
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
usbfs on /proc/bus/usb type usbfs (rw)
tmpfs on /dev/shm type tmpfs (rw)
devpts on /dev/pts type devpts (rw,qid=5,mode=620)
/dev/md1 on /mnt type ext3 (rw)
rescue:~#
Step 9
Type cat /mnt/etc/fstab to output the file to the screen. This is the /etc/fstab file on your hard drive that specifies which folder each partition should be mounted to.
Each /dev/md[] device will show the correct mount folder directly after. The /dev/md1 partition should be mounted to the / folder (root folder).
Please note:
Since the Rescue System is used, we cannot mount /dev/md1 to the / folder as the Rescue System is using the / folder. Therefore, /dev/md1 is mounted to the /mnt folder on the Rescue System and the /mnt/ folder will be the root folder for the contents of your hard drive.
rescue:~# cat /mnt/etc/fstab
/dev/md1        /               ext3    defaults                1 1
/dev/sda2       none            swap    sw
/dev/sdb2       none            swap    sw
/dev/md5        /usr            xfs     defaults                0 2
/dev/md6        /var            xfs     defaults                0 2
/dev/md7        /home           xfs     defaults,usrquota       0 2
devpts          /dev/pts        devpts  gid=5,mode=620          0 0
none            /proc           proc    defaults                0 0
none            /tmp            tmpfs   defaults                0 0
rescue:~#

For hardware RAID, the output will be similar to the information displayed below.
rescue:~# cat /mnt/etc/fstab
/dev/sda1       /               ext3    defaults,usrquota        1 1
/dev/sda2       none            swap    sw
/dev/sda5       /usr            xfs     defaults                 0 2
/dev/sda6       /var            xfs     defaults,usrquota        0 2
devpts          /dev/pts        devpts  gid=5,mode=620           0 0
none            /proc           proc    defaults                 0 0
none            /tmp            tmpfs   size=1g                  0 0
rescue:~#
Step 10
Mount the other devices to the correct folders ensuring that each is preceded with /mnt as this is where we mounted the root partition of the hard drive.
rescue:~# mount /dev/md5 /mnt/usr
rescue:~# mount /dev/md6 /mnt/var
rescue:~# mount /dev/md7 /mnt/home
rescue:~#

For hardware RAID, use the information below as a reference.
rescue:~# mount /dev/sda5 /mnt/usr
rescue:~# mount /dev/sda6 /mnt/var
rescue:~#
Step 11
You can change directories to the /mnt folder and view the entire contents of your hard drive(s).
rescue:~# cd /mnt
rescue:~# ls
bin   home            lib64       opt   sbin     tmp      vmlinuz.old
boot  initrd.img      lost+found  proc  selinux  usr
dev   initrd.img.old  media       root  srv      var
etc   lib             mnt         run   sys      vmlinuz