How to mount all available disks in rescue
Open your server in "Allnodes Control Panel".
Click on "Rescue" tab.
Select "Grml Linux" option, choose "SSH Keys", set root password, and press "START RESCUE" buton.
Wait until server is booted in rescue (Can take up to 30 min for EPYC).
Login into your server by ssh.
Run the script below:
cat <<\EOF | bash
# Root filesystem mountpoint
ROOT_PATH=/mnt
# Assemble RAID devices if any
mdadm --assemble --scan
# Scan and enable all LVM volumes
pvscan
vgscan
vgchange -ay
# Mount the root filesystem
mount /dev/vg0/root "${ROOT_PATH}"
if [[ $? -ne 0 ]]; then
echo "Unable to mount the root filesystem, exiting." >&2
exit 1
fi
# Check if /etc/fstab exists on the host system
if [[ ! -f "${ROOT_PATH}/etc/fstab" ]]; then
echo "Unable to locate /etc/fstab on the root filesystem, exiting." >&2
exit 1
fi
# Mount all non-root filesystems present in /etc/fstab, excluding swap
while read dev mnt type opt dump pass; do
[[ $dev =~ ^# ]] && continue
[[ -z "${dev// /}" ]] && continue
[[ $mnt == "/" ]] && continue
[[ $type == "swap" ]] && continue
echo "Mounting ${dev} on ${ROOT_PATH}${mnt}"
mkdir -p "${ROOT_PATH}/${mnt}"
mount -o "${opt}" "${dev}" "${ROOT_PATH}${mnt}"
done <<< $(cat "${ROOT_PATH}/etc/fstab")
EOFServer is ready for actions in rescue.
Have Questions?
Send us an email at [email protected]