| 138 | |
| 139 | == Degraded Boot == |
| 140 | |
| 141 | Si se rompe un disco "primario" del array, y el "secundario" no tiene instalado GRUB2, seguir las instrucciones de https://help.ubuntu.com/community/Grub2#ChRoot |
| 142 | |
| 143 | {{{ |
| 144 | ChRoot |
| 145 | |
| 146 | This method of installation uses the chroot command to gain access to the broken system's files. Once the chroot command is issued, the LiveCD treats the broken system's / as its own. Commands run in a chroot environment will affect the broken systems filesystems and not those of the LiveCD. |
| 147 | |
| 148 | 1. Boot to the LiveCD Desktop. The CD should be the same release and architecture (32/64 bit). |
| 149 | 2. |
| 150 | |
| 151 | Open a terminal - Applications, Accessories, Terminal. |
| 152 | 3. |
| 153 | |
| 154 | Only If the normal system partition(s) are on a software RAID (otherwise skip this step): make sure the mdadm tools are installed in the Live CD environment (e.g. by executing sudo apt-get install mdadm). Then assemble the arrays: |
| 155 | |
| 156 | sudo mdadm --assemble --scan |
| 157 | |
| 158 | 4. Determine your normal system partition (the switch is a lowercase "L"): |
| 159 | |
| 160 | sudo fdisk -l |
| 161 | |
| 162 | If you aren't sure, run df -Th. Look for the correct disk size and ext3 or ext4 format. |
| 163 | 5. Mount your normal system partition: |
| 164 | * Substitute the correct partition: sda1, sdb5, etc. |
| 165 | |
| 166 | sudo mount /dev/sdXX /mnt |
| 167 | |
| 168 | * |
| 169 | |
| 170 | Example 1: sudo mount /dev/sda1 /mnt |
| 171 | * |
| 172 | |
| 173 | Example 2: sudo mount /dev/md1 /mnt |
| 174 | 6. |
| 175 | |
| 176 | Only if you have a separate boot partition (where sdYY is the /boot partition designation): |
| 177 | |
| 178 | sudo mount /dev/sdYY /mnt/boot |
| 179 | |
| 180 | * |
| 181 | |
| 182 | Example 1: sudo mount /dev/sdb6 /mnt/boot |
| 183 | * |
| 184 | |
| 185 | Example 2: sudo mount /dev/md0 /mnt/boot |
| 186 | 7. Mount the critical virtual filesystems. Run the following as a single command: |
| 187 | |
| 188 | for i in /dev /dev/pts /proc /sys; do sudo mount -B $i /mnt$i; done |
| 189 | |
| 190 | 8. Chroot into your normal system device: |
| 191 | |
| 192 | sudo chroot /mnt |
| 193 | |
| 194 | 9. |
| 195 | |
| 196 | Only if (some) of the system partitions are on a software RAID (otherwise skip this step): make sure the output of mdadm --examine --scan agrees with the array definitions in /etc/mdadm/mdadm.conf. |
| 197 | 10. |
| 198 | |
| 199 | If the file /boot/grub/grub.cfg does not exist or it is not correct, (re)create it using |
| 200 | |
| 201 | update-grub |
| 202 | |
| 203 | 11. |
| 204 | |
| 205 | Reinstall GRUB 2 (substitute the correct device with sda, sdb, etc. Do not specify a partition number): |
| 206 | |
| 207 | grub-install /dev/sdX |
| 208 | |
| 209 | If the system partitions are on a software RAID install GRUB 2 on all disks in the RAID. Example (software RAID using /dev/sda and /dev/sdb): |
| 210 | |
| 211 | grub-install /dev/sda |
| 212 | grub-install /dev/sdb |
| 213 | |
| 214 | 12. |
| 215 | |
| 216 | Verify the install (use the correct device, for example sda. Do not specify a partition): |
| 217 | |
| 218 | grub-install --recheck /dev/sdX |
| 219 | |
| 220 | For a system on a software RAID, repeat this for all devices in the RAID. |
| 221 | 13. |
| 222 | |
| 223 | Exit chroot: CTRL-D on keyboard |
| 224 | 14. Unmount virtual filesystems. Run the following as a single command: |
| 225 | |
| 226 | for i in /sys /proc /dev/pts /dev; do sudo umount /mnt$i; done |
| 227 | |
| 228 | 15. If you mounted a separate /boot partition: |
| 229 | * |
| 230 | |
| 231 | sudo umount /mnt/boot |
| 232 | |
| 233 | 16. Unmount last device: |
| 234 | |
| 235 | sudo umount /mnt |
| 236 | |
| 237 | 17. Reboot. |
| 238 | |
| 239 | sudo reboot |
| 240 | }}} |