From f2a2581b8509f01a58058013119c9de0a2ecda53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Louzao?= Date: Sat, 9 Jan 2021 12:33:12 +0100 Subject: [PATCH] Make Diferences between rescue in LVM and BTRF File System Why this change is needed: With the new default system in BTRF as Defautl for new instalation this procedure needs updated. What this change accomplishes: . Reflect the diferences between rescue a system in a LVM/BTRF file System. . Remove Sequence Number Warninig in a debug-dracut-problems.adoc fix ticket: #316 Note: Please don't push .adoc with Warning Messages is quite anoying --- ..._restoring-bootloader-using-live-disk.adoc | 51 +++++++++++++++---- modules/ROOT/pages/debug-dracut-problems.adoc | 44 ++++++++-------- 2 files changed, 63 insertions(+), 32 deletions(-) diff --git a/modules/ROOT/pages/_partials/proc_restoring-bootloader-using-live-disk.adoc b/modules/ROOT/pages/_partials/proc_restoring-bootloader-using-live-disk.adoc index 0192b68..2674d10 100644 --- a/modules/ROOT/pages/_partials/proc_restoring-bootloader-using-live-disk.adoc +++ b/modules/ROOT/pages/_partials/proc_restoring-bootloader-using-live-disk.adoc @@ -1,9 +1,14 @@ [[restoring-bootloader-using-live-disk]] = Restoring the bootloader using the Live disk. -Sometimes, especially after a secondary operating systems has been installed, the master boot record gets damaged which then prevents the original Linux system from booting. +Sometimes, especially after a secondary operating systems has been installed, +the master boot record gets damaged which then prevents the original Linux system +from booting. -If this happens, it is necessary to reinstall *GRUB2* to recreate the original settings. The process not only discovers all installed operating systems, but usually adds them to the *GRUB2* configuration files, so they will all become bootable by *GRUB2*. +If this happens, it is necessary to reinstall *GRUB2* to recreate the original +settings. The process not only discovers all installed operating systems, but +usually adds them to the *GRUB2* configuration files, so they will all become +bootable by *GRUB2*. .Before you start @@ -18,18 +23,22 @@ If this happens, it is necessary to reinstall *GRUB2* to recreate the original s . Open the terminal. . Examine the partition layout and identify the `boot` and the `root` partition. -+ + ---- # fdisk -l ---- -+ -If you are using the default Fedora layout, there will be one `/dev/sda1` partition that holds the `/boot` directory and one `/dev/mapper/fedora-root` that holds the root file system. + +== For Default Instalation in LVM. . Create the mount point for the root partition. + ---- # mkdir -p /mnt/root ----- +---- + +If you are using the default Fedora layout, there will be one `/dev/sda1` +partition that holds the `/boot` directory and one `/dev/mapper/fedora-root` +that holds the root file system. . Mount the root partition on the mount point. + @@ -38,12 +47,33 @@ If you are using the default Fedora layout, there will be one `/dev/sda1` partit ---- . Mount the boot partition in the `boot` directory of the filesystem that you have mounted in the previous step. -+ + ---- # mount /dev/sda1 /mnt/root/boot/ ---- -. Mount system processes and devices into the root filesystem in `/mnt/root`. +== For default Instalation in BTRF + +. Create the mount point for the root partition. + +---- +# mkdir -p /mnt/ +---- + +If you are using the default Fedora layout, there will be one `/dev/sda1` +partition that holds the `/boot` directory and one `/dev/sda2` that holds the root file system. + +---- +# mount /dev/sda2/ /mnt +# mount /dev/sda1 /mnt/root/boot +---- + +IMPORTANT: Home Partition is mounted automatically under `/mnt/home` + +== Continue with the follow Procedure. + +. Mount system processes and devices into the root filesystem in +`/mnt/root`. + ---- # mount -o bind /dev /mnt/root/dev @@ -58,7 +88,8 @@ If you are using the default Fedora layout, there will be one `/dev/sda1` partit # chroot /mnt/root ---- -. Regenerate the *GRUB2* configuration file and reinstall the bootloader into the MBR, as described in xref:adding-other-operating-systems-grub2[Adding other operating systems to the *GRUB2* menu]. +. Regenerate the *GRUB2* configuration file and reinstall the bootloader +into the MBR, as described in xref:adding-other-operating-systems-grub2[Adding other operating systems to the *GRUB2* menu]. . Exit this temporary root filesystem. + @@ -67,7 +98,7 @@ $ exit ---- . Your bootloader should be now restored. Reboot your computer to boot into your normal system. -+ + ---- # systemctl reboot ---- diff --git a/modules/ROOT/pages/debug-dracut-problems.adoc b/modules/ROOT/pages/debug-dracut-problems.adoc index c8e57c0..3cc2b9a 100644 --- a/modules/ROOT/pages/debug-dracut-problems.adoc +++ b/modules/ROOT/pages/debug-dracut-problems.adoc @@ -16,12 +16,12 @@ uncompressed, with MIME type set as text/plain. [[identifying-your-problem-area]] == Identifying your problem area -1. Remove `rhgb` and `quiet` from the kernel command line -2. Add `rd.shell` to the kernel command line. This will present a shell +. Remove `rhgb` and `quiet` from the kernel command line +. Add `rd.shell` to the kernel command line. This will present a shell in case dracut is unable to locate your root device -3. Add `rd.shell rd.debug log_buf_len=1M` to the kernel command line so +. Add `rd.shell rd.debug log_buf_len=1M` to the kernel command line so that dracut shell commands are printed as they are executed -4. Inspect the system logs: +. Inspect the system logs: .... # less /run/initramfs/rdsosreport.txt # journalctl -a @@ -94,20 +94,20 @@ console connection to record boot messages. To enable serial console output for both the kernel and the bootloader, follow the procedure below. -1. Open the file `/etc/grub.conf` for editing. Below the line _timeout=5_, add the following: - +. Open the file `/etc/grub.conf` for editing. Below the line _timeout=5_, add the following: ++ .... serial --unit=0 --speed=9600 terminal --timeout=5 serial console .... -2. Also in `/etc/grub.conf`, add the following boot arguments to the _kernel_ line: - +. Also in `/etc/grub.conf`, add the following boot arguments to the _kernel_ line: ++ .... console=tty0 console=ttyS0,9600 .... -3. When finished, `/etc/grub.conf` should look similar to the example below: +. When finished, `/etc/grub.conf` should look similar to the example below: .... default=0 @@ -130,9 +130,9 @@ http://www.faqs.org/docs/Linux-HOWTO/Remote-Serial-Console-HOWTO.html#CONFIGURE- Dracut offers a shell for interactive debugging in the event dracut fails to locate your root filesystem. To enable the shell: -1. Add the boot parameter `rd.shell` to your bootloader configuration +. Add the boot parameter `rd.shell` to your bootloader configuration file (e.g. `/etc/grub/conf`) -2. Remove the boot arguments `rhgb` and `quiet` +. Remove the boot arguments `rhgb` and `quiet` A sample `/etc/grub.conf` bootloader configuration file is listed below: @@ -179,8 +179,8 @@ The exact method for locating and preparing will vary. However, to continue with a successful boot, the objective is to locate your root volume and create a symlink `/dev/root` which points to the file system. For example, the following example demonstrates accessing and booting a root volume that is an encrypted LVM Logical volume. -1. Inspect your partitions using `parted`: - +. Inspect your partitions using `parted`: ++ .... # parted /dev/sda -s p Model: ATA HTS541060G9AT00 (scsi) @@ -193,16 +193,16 @@ Number Start End Size Type File system Flags 2 10.8GB 55.6GB 44.7GB logical lvm .... -2. You recall that your root volume was a LVM logical volume. Scan and +. You recall that your root volume was a LVM logical volume. Scan and activate any logical volumes: - ++ .... # lvm vgscan # lvm vgchange -ay .... -3. You should see any logical volumes now using the command `blkid`: - +. You should see any logical volumes now using the command `blkid`: ++ .... # blkid /dev/sda1: UUID="3de247f3-5de4-4a44-afc5-1fe179750cf7" TYPE="ext4" @@ -212,12 +212,12 @@ Number Start End Size Type File system Flags /dev/mapper/linux-swap: UUID="47b4d329-975c-4c08-b218-f9c9bf3635f1" TYPE="swap" .... -4. From the output above, you recall that your root volume exists on an +. From the output above, you recall that your root volume exists on an encrypted block device. Following the guidance disk encryption guidance from the http://docs.fedoraproject.org/install-guide/f%7B%7BFedoraVersion%7D%7D/en-US/html/apcs04s04.html[ Installation Guide], you unlock your encrypted root volume. - ++ .... UUID=$(cryptsetup luksUUID /dev/mapper/linux-root) cryptsetup luksOpen /dev/mapper/linux-root luks-$UUID @@ -225,13 +225,13 @@ Enter passphrase for /dev/mapper/linux-root: Key slot 0 unlocked. .... -5. Next, make a symbolic link to the unlocked root volume - +. Next, make a symbolic link to the unlocked root volume ++ .... ln -s /dev/mapper/luks-$UUID /dev/root .... -6. With the root volume available, you may continue booting the system +. With the root volume available, you may continue booting the system by exiting the dracut shell ....