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
| Phase | What happens |
|---|
| 1. Detect the drive | Find the new device name of the attached drive |
| 2. Assemble RAID (if applicable) | Reactivate software RAID arrays from the old server |
| 3. Mount the partition | Mount the old drive's partitions into the new system |
| 4. Transfer data | Copy files, configurations, and databases to the new server |
Step 1: Detect the drive
Find the device name of the newly attached drive.
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:
Step 2a: No RAID — mount partitions directly
For servers without software RAID: mount partitions directly.
mkdir -p /mnt/oldsystem
mount /dev/sdb3 /mnt/oldsystem
If a separate /boot partition exists, mount it too:
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.
apt install mdadm
mdadm --assemble --scan
cat /proc/mdstat
If the automatic scan fails, assemble the RAID manually:
mdadm --assemble /dev/md0 /dev/sdb2 /dev/sdc2
If only one drive of a RAID-1 set is available, force-assemble in degraded mode:
mdadm --assemble --force /dev/md0 /dev/sdb2
Then mount the RAID partition:
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.
pvs
vgs
lvs
vgchange -ay
lvscan
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.
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
rsync -av /mnt/oldsystem/var/www/ /var/www/
Configuration files
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
rsync -av /mnt/oldsystem/home/ /home/
Database files
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.
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.
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.
For RAID setups additionally: