Mounting an External Drive (Linux)

If the failed server still has intact drives, they can be attached to a new server and data transferred directly — without any network access to the old server.

Important — follow this order: Install the operating system on the new server completely before letting us know the old drives can be connected. If the drives are attached before the OS installation, the installer may detect the wrong disks and irreversibly overwrite the old data.

Overview

PhaseWhat happens
1. Detect the driveFind the new device name of the attached drive
2. Assemble RAID (if applicable)Reactivate software RAID arrays from the old server
3. Mount the partitionMount the old drive's partitions into the new system
4. Transfer dataCopy files, configurations, and databases to the new server

Step 1: Detect the drive

Find the device name of the newly attached drive.
Terminal
lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINT,LABEL

The new drive will appear as an additional device — e.g. /dev/sdb, /dev/sdc, or for NVMe as /dev/nvme1n1. For further identification check the partition table:

Terminal
fdisk -l /dev/sdb

Step 2a: No RAID — mount partitions directly

For servers without software RAID: mount partitions directly.
Terminal
mkdir -p /mnt/oldsystem mount /dev/sdb3 /mnt/oldsystem

If a separate /boot partition exists, mount it too:

Terminal
mount /dev/sdb1 /mnt/oldsystem/boot

Adjust sdb1 and sdb3 to match the actual partition names from the lsblk output.

Step 2b: Software RAID — assemble arrays

For servers with software RAID: reactivate RAID arrays before mounting.
Terminal
apt install mdadm mdadm --assemble --scan cat /proc/mdstat

If the automatic scan fails, assemble the RAID manually:

Terminal
mdadm --assemble /dev/md0 /dev/sdb2 /dev/sdc2

If only one drive of a RAID-1 set is available, force-assemble in degraded mode:

Terminal
mdadm --assemble --force /dev/md0 /dev/sdb2

Then mount the RAID partition:

Terminal
mkdir -p /mnt/oldsystem mount /dev/md0 /mnt/oldsystem

Step 3: Activate LVM volumes (if applicable)

If the old server used LVM, activate the volumes before mounting.
Terminal
pvs vgs lvs vgchange -ay lvscan
Terminal
mount /dev/vg_oldserver/lv_root /mnt/oldsystem

Step 4: Check the filesystem (recommended)

Run fsck before migrating — especially important after an unclean shutdown.

fsck must only be run on unmounted partitions. Unmount first if you already mounted in step 2.

Terminal
umount /mnt/oldsystem fsck -y /dev/sdb3 mount /dev/sdb3 /mnt/oldsystem

Step 5: Transfer data to the new server

Copy files, configs, and databases from the mounted old drive.

Web files

Terminal
rsync -av /mnt/oldsystem/var/www/ /var/www/

Configuration files

Terminal
cp /mnt/oldsystem/etc/nginx/nginx.conf /etc/nginx/nginx.conf cp -r /mnt/oldsystem/etc/nginx/sites-available/ /etc/nginx/sites-available/ cp /mnt/oldsystem/etc/mysql/my.cnf /etc/mysql/my.cnf

Home directories

Terminal
rsync -av /mnt/oldsystem/home/ /home/

Database files

Terminal
rsync -av /mnt/oldsystem/var/lib/mysql/ /var/lib/mysql/ chown -R mysql:mysql /var/lib/mysql

Only copy MySQL data files if both servers run the same MySQL/MariaDB version. For different versions, use mysqldump instead.

Step 6: Carry over users and SSH keys

Transfer system users, passwords, and SSH keys from the old server.
Terminal
cp /mnt/oldsystem/etc/passwd /etc/passwd.alt cp /mnt/oldsystem/etc/shadow /etc/shadow.alt rsync -av /mnt/oldsystem/root/.ssh/ /root/.ssh/ chmod 700 /root/.ssh chmod 600 /root/.ssh/authorized_keys

Step 7: Transfer cron jobs

Copy scheduled tasks from the old system.
Terminal
cat /mnt/oldsystem/var/spool/cron/crontabs/root cp /mnt/oldsystem/etc/cron.d/* /etc/cron.d/

Step 8: Unmount and clean up

Cleanly unmount the drive after migration.
Terminal
umount /mnt/oldsystem

For RAID setups additionally:

Terminal
mdadm --stop /dev/md0

Need help with the drive swap?

The physical installation of drives in our data centre must be carried out by our technical staff. Open a support ticket in the PowerPanel.