Mount Slaved Drive

Sometimes your OS needs to be reinstalled by your datacenter. This means that you need to mount the slaved drive in order to copy the data to the new OS drive. Here is a typical example:

Login to the server and run the following to see whats mounted:

[root@68-168-105-44 ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sdb3       913G  2.8G  864G   1% /
tmpfs           7.8G     0  7.8G   0% /dev/shm
/dev/sdb1       485M   80M  380M  18% /boot

As we can see above, there is the primary new OS drive mounted on /dev/sdb. To see all the drives, run the following:

[root@68-168-105-44 ~]# fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          62      497983+  83  Linux
/dev/sda2              64         584     4184932+  82  Linux swap / Solaris
/dev/sda3             585      121598   972044955   82  Linux swap / Solaris

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0009b45b

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sdb2              64         587     4194304   82  Linux swap / Solaris
Partition 2 does not end on cylinder boundary.
/dev/sdb3             587      121602   972054528   83  Linux

Since out drive from the first command showed the /dev/sdb disk as the primary OS disk, we can tell that the /dev/sda disk is the slaved disk. No we can mount it.

First, you’ll need to create a mount point. We’ll use /mnt/slave. This is where we’ll mount /mnt/slave. Enter the following commands:


# mkdir /mnt/slave
# mount /dev/sda3 /mnt/slave
# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sdb3       913G  2.7G  864G   1% /
tmpfs           7.8G     0  7.8G   0% /dev/shm
/dev/sdb1       485M   80M  380M  18% /boot
/dev/sda3       913G  113G  754G  13% /mnt/slave

Edit /etc/fstab so the new drive will automatically mount to /disk1 on reboot

# /dev/sda3       /mnt/slave  ext3  defaults     0       0

Leave a Comment