Estou tentando remover a /boot
partição dedicada e mesclá-la na partição raiz /
. Já encontrei https://askubuntu.com/questions/741672/how-do-i-merge-my-boot-partition-to-be-a-part-of-the-partition , mas isso não parece ajuda.
Qual é a situação:
# uname -a
Linux c02 6.1.0-12-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.52-1 (2023-09-07) x86_64 GNU/Linux
# fdisk -l /dev/sda
Disk /dev/sda: 4 TiB, 4398046511104 bytes, 8589934592 sectors
Disk model: QEMU HARDDISK
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 1673AA12-2A54-4718-AF1E-58FE670A87E3
Device Start End Sectors Size Type
/dev/sda1 2048 4095 2048 1M BIOS boot
/dev/sda2 4096 2007039 2002944 978M Linux filesystem
/dev/sda3 2007040 10008575 8001536 3.8G Linux swap
/dev/sda4 10008576 8589932543 8579923968 4T Linux filesystem
O seguinte funciona e deixe-me reiniciar a máquina com sucesso:
# copy content of boot partition to root
cp -a /boot /boot.bak
umount /boot
rm -rf /boot
mv /boot.bak /boot
# update-grub
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-6.1.0-12-amd64
Found initrd image: /boot/initrd.img-6.1.0-12-amd64
Found linux image: /boot/vmlinuz-6.1.0-10-amd64
Found initrd image: /boot/initrd.img-6.1.0-10-amd64
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
done
Mas ao excluir adicionalmente a partição física de inicialização, a reinicialização falha:
# fdisk /dev/sda
Welcome to fdisk (util-linux 2.38.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
This disk is currently in use - repartitioning is probably a bad idea.
It's recommended to umount all file systems, and swapoff all swap
partitions on this disk.
Command (m for help): d
Partition number (1-4, default 4): 2
Partition 2 has been deleted.
Command (m for help): w
The partition table has been altered.
Syncing disks.
O que resulta em um erro do grub:
error: no such partition.
grub rescue>
Ao reinstalar grub
via, apt-get install --reinstall grub-pc
recebo o seguinte erro do grub:
error: attempt to read or write outside of disk `hd0`.
grub rescue>
O que há de errado aqui?