|
| 1 | +--- |
| 2 | +title: Manually mounting the filesystem of your Dedibox in rescue mode |
| 3 | +description: This page explains how to manually mount the filesystem of your Dedbox in rescue mode to acces your data. |
| 4 | +dates: |
| 5 | + validation: 2025-11-05 |
| 6 | + posted: 2025-11-05 |
| 7 | +tags: dedibox scaleway |
| 8 | +--- |
| 9 | + |
| 10 | +This guide explains how to manually mount your server’s filesystem when running in [rescue mode](/dedibox/how-to/use-rescue-mode/). |
| 11 | +This procedure is commonly used to diagnose and repair issues on the root disk (e.g., filesystem corruption, kernel upgrade failure, lost credentials, etc.). |
| 12 | + |
| 13 | +<Message type="important"> |
| 14 | + Filesystem repair tools such as `fsck` or `xfs_repair` can cause data loss if used incorrectly. Always create a backup when possible. |
| 15 | +</Message> |
| 16 | + |
| 17 | +1. Boot the server into rescue mode. |
| 18 | + Refer to [How to use rescue mode](/dedibox/how-to/use-rescue-mode/) for detailed instructions. |
| 19 | + |
| 20 | +2. Log in via SSH. Use the temporary credentials shown on the server’s status page in the Scaleway console. |
| 21 | + ```bash |
| 22 | + ssh root@<DEDIBOX_IP> |
| 23 | + ``` |
| 24 | + |
| 25 | +3. Identify your disk and partitions: |
| 26 | + ```bash |
| 27 | + lsblk -f # shows size, type, and filesystem label |
| 28 | + ``` |
| 29 | + Example output (your layout will differ): |
| 30 | + |
| 31 | + ``` |
| 32 | + NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS |
| 33 | + sda 8:0 0 447G 0 disk |
| 34 | + ├─sda1 8:1 0 512M 0 part /boot |
| 35 | + │ vfat FAT32 |
| 36 | + └─sda2 8:2 0 446.5G 0 part / |
| 37 | + ext4 1.0 |
| 38 | + ``` |
| 39 | + |
| 40 | + <Message type="tip"> |
| 41 | + Use `blkid` or `fdisk -l` if you need UUIDs or more details. |
| 42 | + Disk names may vary with names like `/dev/nvme0n1`, `/dev/vda`, etc. Replace `/dev/sdaX` in later steps with the correct device. |
| 43 | + </Message> |
| 44 | + |
| 45 | +4. Check the filesystem integrity (recommended). |
| 46 | + |
| 47 | + <Message type="important"> |
| 48 | + Always run repair tools on unmounted filesystems. |
| 49 | + </Message> |
| 50 | + |
| 51 | + ### ext4 |
| 52 | + ```bash |
| 53 | + fsck -f /dev/sda2 |
| 54 | + ``` |
| 55 | + |
| 56 | + ### XFS |
| 57 | + ```bash |
| 58 | + xfs_repair /dev/sda2 |
| 59 | + ``` |
| 60 | + |
| 61 | + ### Btrfs |
| 62 | + ```bash |
| 63 | + btrfs check --repair /dev/sda2 |
| 64 | + ``` |
| 65 | + |
| 66 | +5. Create a mount point: |
| 67 | + ```bash |
| 68 | + mkdir -p /mnt/root |
| 69 | + ``` |
| 70 | + |
| 71 | +6. Mount the root filesystem. |
| 72 | + Replace `/dev/sda2` with your actual root partition: |
| 73 | + ```bash |
| 74 | + mount /dev/sda2 /mnt/root |
| 75 | + ``` |
| 76 | + Verify the mount: |
| 77 | + ```bash |
| 78 | + ls /mnt/root |
| 79 | + `` |
| 80 | + If you have a separate `/boot` (often `sda1`): |
| 81 | + ```bash |
| 82 | + mount /dev/sda1 /mnt/root/boot |
| 83 | + ``` |
| 84 | + For UEFI systems with an EFI System Partition (ESP): |
| 85 | + ```bash |
| 86 | + mount /dev/sda1 /mnt/root/boot/efi |
| 87 | + ``` |
| 88 | + |
| 89 | +7. (Optional) Mount additional partitions. |
| 90 | + Common examples: |
| 91 | + ```bash |
| 92 | + mount /dev/sda3 /mnt/root/home |
| 93 | + mount /dev/sda4 /mnt/root/var |
| 94 | + ``` |
| 95 | + |
| 96 | +8. Bind system directories (required for chroot). |
| 97 | + ```bash |
| 98 | + mount -t proc none /mnt/root/proc |
| 99 | + mount -t sysfs none /mnt/root/sys |
| 100 | + mount --bind /dev /mnt/root/dev |
| 101 | + mount --bind /run /mnt/root/run |
| 102 | + ``` |
| 103 | + |
| 104 | +9 Enter the chroot environment to perform your desired rescue actions: |
| 105 | + ```bash |
| 106 | + chroot /mnt/root |
| 107 | + ``` |
| 108 | + |
| 109 | +10. Unmount and clean up once you are done. |
| 110 | + Exit chroot first (if used): |
| 111 | + ```bash |
| 112 | + exit |
| 113 | + ``` |
| 114 | + |
| 115 | + Then unmount everything recursively: |
| 116 | + ```bash |
| 117 | + umount -R /mnt/root |
| 118 | + ``` |
| 119 | + |
| 120 | + Remove the temporary directory: |
| 121 | + ```bash |
| 122 | + rmdir /mnt/root |
| 123 | + ``` |
| 124 | + |
| 125 | +--- |
| 126 | + |
| 127 | +## Troubleshooting |
| 128 | + |
| 129 | +### Mount fails with “wrong fs type” |
| 130 | +Run the following command to identify the filesystem type of the partition: |
| 131 | +```bash |
| 132 | +blkid /dev/sdaX |
| 133 | +``` |
| 134 | +Then specify the filesystem type explicitly: |
| 135 | +```bash |
| 136 | +mount -t ext4 /dev/sdaX /mnt/root |
| 137 | +``` |
| 138 | + |
| 139 | +### Encrypted partitions (LUKS) |
| 140 | +If your partition is encrypted, you have to open it before mounting it: |
| 141 | +```bash |
| 142 | +cryptsetup luksOpen /dev/sdaX encrypted_root |
| 143 | +mount /dev/mapper/encrypted_root /mnt/root |
| 144 | +``` |
| 145 | + |
| 146 | +### LVM volume not found |
| 147 | +If you are using LVM and cannot find your LVM volume, run the following commands to identify the volume: |
| 148 | +```bash |
| 149 | +vgscan |
| 150 | +vgchange -ay |
| 151 | +lvdisplay |
| 152 | +``` |
| 153 | +Mount the logical volume: |
| 154 | +```bash |
| 155 | +mount /dev/<VG_NAME>/<LV_NAME> /mnt/root |
| 156 | +``` |
| 157 | + |
| 158 | +### RAID volume not detected |
| 159 | +Run the following command to scan for RAID devices: |
| 160 | +```bash |
| 161 | +mdadm --assemble --scan |
| 162 | +cat /proc/mdstat |
| 163 | +``` |
| 164 | +Mount the assembled device: |
| 165 | +```bash |
| 166 | +mount /dev/md0 /mnt/root |
| 167 | +``` |
0 commit comments