Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revisionBoth sides next revision
linux_faq:fix_grub_initramfs_boot [2020/09/26 14:55] – [Live-CD] adminlinux_faq:fix_grub_initramfs_boot [2022/01/14 20:38] – [Real Fix] admin
Line 97: Line 97:
   * переустановить **grub**: <code>grub-install /dev/sda --root-directory=/mnt</code>   * переустановить **grub**: <code>grub-install /dev/sda --root-directory=/mnt</code>
 Всё. В итоге система поднялась. Всё. В итоге система поднялась.
 +
 +
 +====== Real Fix ======
 +смотрим диски
 +<code>
 +root@rescue ~ # lsscsi 
 +[N:0:1:1]    disk    Micron_7300_MTFDHBE3T8TDF__1               /dev/nvme0n1
 +[N:1:1:1]    disk    Micron_7300_MTFDHBE3T8TDF__1               /dev/nvme1n1
 +[N:2:1:1]    disk    Micron_7300_MTFDHBE3T8TDF__1               /dev/nvme2n1
 +[N:3:1:1]    disk    Micron_7300_MTFDHBE3T8TDF__1               /dev/nvme3n1
 +[N:4:1:1]    disk    Micron_7300_MTFDHBE3T8TDF__1               /dev/nvme4n1
 +[N:5:1:1]    disk    Micron_7300_MTFDHBE3T8TDF__1               /dev/nvme5n1
 +[N:6:1:1]    disk    Micron_7300_MTFDHBE3T8TDF__1               /dev/nvme6n1
 +[N:7:1:1]    disk    Micron_7300_MTFDHBE3T8TDF__1               /dev/nvme7n1
 +</code>
 +Я знаю, что EFI находится на (hd1,gpt2), а / и /boot - на LVM-томе **/dev/pve/root** \\
 +Монтируем root и биндим все что надо:
 +<code>root@rescue ~ # blkid /dev/pve/root
 +/dev/pve/root: UUID="507da6be-c993-414a-91c1-fee245500c4d" BLOCK_SIZE="4096" TYPE="ext4"
 +root@rescue ~ # lsblk /dev/pve/root
 +NAME     MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
 +pve-root 253:0    0  96G  0 lvm  
 +root@rescue ~ # resize2fs /dev/pve/root 95G
 +resize2fs 1.46.2 (28-Feb-2021)
 +Please run 'e2fsck -f /dev/pve/root' first.
 +
 +root@rescue ~ # e2fsck -f /dev/pve/root
 +e2fsck 1.46.2 (28-Feb-2021)
 +Pass 1: Checking inodes, blocks, and sizes
 +Pass 2: Checking directory structure
 +Pass 3: Checking directory connectivity
 +Pass 4: Checking reference counts
 +Pass 5: Checking group summary information
 +/dev/pve/root: 60013/6291456 files (0.2% non-contiguous), 1830899/25165824 blocks
 +root@rescue ~ # resize2fs /dev/pve/root 95G
 +resize2fs 1.46.2 (28-Feb-2021)
 +Resizing the filesystem on /dev/pve/root to 24903680 (4k) blocks.
 +The filesystem on /dev/pve/root is now 24903680 (4k) blocks long.
 +
 +root@rescue ~ # lvreduce -L -1G /dev/pve/root
 +  WARNING: Reducing active logical volume to 95.00 GiB.
 +  THIS MAY DESTROY YOUR DATA (filesystem etc.)
 +Do you really want to reduce pve/root? [y/n]: y
 +  Size of logical volume pve/root changed from 96.00 GiB (24576 extents) to 95.00 GiB (24320 extents).
 +  Logical volume pve/root successfully resized.
 +root@rescue ~ # e2fsck -f /dev/pve/root
 +e2fsck 1.46.2 (28-Feb-2021)
 +Pass 1: Checking inodes, blocks, and sizes
 +Pass 2: Checking directory structure
 +Pass 3: Checking directory connectivity
 +Pass 4: Checking reference counts
 +Pass 5: Checking group summary information
 +/dev/pve/root: 60013/6225920 files (0.2% non-contiguous), 1826787/24903680 blocks
 +root@rescue ~ # mount /dev/mapper/pve-root /mnt
 +root@rescue ~ #  mount -t proc proc /mnt/proc
 +root@rescue ~ #  mount -t sysfs sys /mnt/sys
 +root@rescue ~ #  mount -o bind /dev /mnt/dev
 +root@rescue ~ #  mount -t devpts pts /mnt/dev/pts/
 +root@rescue ~ #  chroot /mnt
 +root@rescue:/# mount /dev/nvme0n1p2 /boot/efi/
 +root@rescue:/#  update-grub
 +Generating grub configuration file ...
 +Found linux image: /boot/vmlinuz-5.13.19-1-pve
 +Found initrd image: /boot/initrd.img-5.13.19-1-pve
 +Found memtest86+ image: /boot/memtest86+.bin
 +Found memtest86+ multiboot image: /boot/memtest86+_multiboot.bin
 +done
 +root@rescue:/# grub-install /dev/nvme0n1
 +Installing for i386-pc platform.
 +Installation finished. No error reported.
 +root@rescue:/# exit
 +exit
 +root@rescue ~ # umount /mnt/proc
 +root@rescue ~ # umount /mnt/sys
 +root@rescue ~ # umount /mnt/dev/pts 
 +root@rescue ~ # umount /mnt/dev
 +root@rescue ~ # umount /mnt/boot/efi 
 +root@rescue ~ # umount /mnt
 +</code>
 +
 +
  • linux_faq/fix_grub_initramfs_boot.txt
  • Last modified: 2022/01/14 20:39
  • by admin