When I reboot, I get a grub prompt, so what am I doing wrong?: root@debian:~# lsblk &&…
- User
When I reboot, I get a grub prompt, so what am I doing wrong?: root@debian:
# lsblk && blkid NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS sr0 11:0 1 3.7G 0 rom# mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/vda1 /dev/vdb1 mdadm: super1.x cannot open /dev/vda1: Device or resource busy mdadm: ddf: Cannot use /dev/vda1: Device or resource busy mdadm: Cannot use /dev/vda1: It is busy mdadm: cannot open /dev/vda1: Device or resource busy root@debian:
vda 254:0 0 20G 0 disk
├─vda1 254:1 0 487M 0 part /boot ├─vda2 254:2 0 1K 0 part
└─vda5 254:5 0 19.5G 0 part
└─vda5_crypt 252:0 0 19.5G 0 crypt ├─debian--vg-root 252:1 0 18.5G 0 lvm / └─debian--vg-swap_1 252:2 0 980M 0 lvm [SWAP] vdb 254:16 0 20G 0 disk
├─vdb1 254:17 0 487M 0 part
├─vdb2 254:18 0 1K 0 part
└─vdb5 254:21 0 19.5G 0 part
└─vdb5_crypt 252:3 0 19.5G 0 crypt ├─debian--vg2-swap_2 252:4 0 980M 0 lvm [SWAP] └─debian--vg2-root 252:5 0 18.5G 0 lvm
/dev/mapper/debian--vg-root: UUID="787e196d-c852-491e-9583-34d1bc621ace" UUID_SUB="5246486c-8c05-4d72-b494-b9bbf2e62825" BLOCK_SIZE="4096" TYPE="btrfs" /dev/vdb5: UUID="584aa6ad-c8c0-43e5-b32d-eda94ea8501b" TYPE="crypto_LUKS" PARTUUID="a36f14d2-05" /dev/vdb1: UUID="55762e61-a486-47b9-92cc-29d597b37312" BLOCK_SIZE="1024" TYPE="ext2" PARTUUID="a36f14d2-01" /dev/mapper/debian--vg2-swap_2: UUID="662d79c0-2db1-4247-bb77-7d05dfb6917c" TYPE="swap" /dev/sr0: BLOCK_SIZE="2048" UUID="2023-10-07-11-48-54-00" LABEL="Debian 12.2.0 amd64 1" TYPE="iso9660" PTUUID="515b3f36" PTTYPE="dos" /dev/mapper/debian--vg-swap_1: UUID="3f8a7e7e-21c1-47d3-a19a-72dfe9f8b164" TYPE="swap" /dev/mapper/vda5_crypt: UUID="UmwnNd-voGV-v1lc-eKPP-nLeP-cwpX-tXaA7V" TYPE="LVM2_member" /dev/mapper/debian--vg2-root: UUID="787e196d-c852-491e-9583-34d1bc621ace" UUID_SUB="2c6c20fe-abf0-4b5c-9896-3239dbbbe8f5" BLOCK_SIZE="4096" TYPE="btrfs" /dev/vda5: UUID="c8e57554-de8b-44c0-862a-32cd1e4f92b1" TYPE="crypto_LUKS" PARTUUID="00819e90-05" /dev/vda1: UUID="c2206369-9b9f-44b3-8319-1d46ed4c559e" BLOCK_SIZE="1024" TYPE="ext2" PARTUUID="00819e90-01" /dev/mapper/vdb5_crypt: UUID="mtToH2-apOl-L8Wq-UrcM-QmF9-cUBk-7POUGH" TYPE="LVM2_member" root@debian:# umount /boot root@debian:# mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/vda1 /dev/vdb1 mdadm: /dev/vda1 appears to contain an ext2fs file system size=498688K mtime=Sun Nov 19 07:55:07 2023 mdadm: Note: this array has metadata at the start and may not be suitable as a boot device. If you plan to store '/boot' on this device please ensure that your boot-loader understands md/v1.x metadata, or use --metadata=0.90 mdadm: /dev/vdb1 appears to contain an ext2fs file system size=498688K mtime=Wed Dec 31 19:00:00 1969 mdadm: size set to 497664K Continue creating array? y mdadm: Defaulting to version 1.2 metadata mdadm: array /dev/md0 started. root@debian:~# mkfs.ext2 /dev/md0 mke2fs 1.47.0 (5-Feb-2023) Discarding device blocks: done Creating filesystem with 497664 1k blocks and 124440 inodes Filesystem UUID: 20abf9b7-04fe-48c3-939a-030ebe363b98 Superblock backups stored on blocks: 8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409 - Assistant
Based on the information provided, it seems that you have successfully created a RAID 1 array with
/dev/vda1and/dev/vdb1. However, the/bootpartition is still mounted from/dev/vda1instead of the newly created RAID array/dev/md0.To correct this, you need to update your
/etc/fstabfile to use the new UUID of the RAID array for the/bootpartition. Here are the steps to fix this issue:-
Open the
/etc/fstabfile for editing:vim /etc/fstab -
Modify the line for the
/bootpartition to use the UUID of/dev/md0instead of/dev/vda1. Replace the existing line:UUID=c2206369-9b9f-44b3-8319-1d46ed4c559e /boot ext2 defaults 0 2with:
UUID=20abf9b7-04fe-48c3-939a-030ebe363b98 /boot ext2 defaults 0 2 -
Save the changes and exit the editor.
-
- User
Are you sure I am using the UUID of /dev/vda1?
- Assistant
Apologies for the confusion. You are correct. The UUID used in your
/etc/fstabfile for the/bootpartition is actually the UUID of/dev/vda1.To modify the
/etc/fstabfile correctly:-
Open the
/etc/fstabfile for editing:vim /etc/fstab -
Modify the line for the
/bootpartition to use the new UUID of/dev/md0. Replace the existing line:UUID=c2206369-9b9f-44b3-8319-1d46ed4c559e /boot ext2 defaults 0 2with:
UUID=<UUID_OF_/dev/md0> /boot ext2 defaults 0 2Replace
<UUID_OF_/dev/md0>with the UUID of/dev/md0. You can find the UUID of/dev/md0by running the command:blkid /dev/md0 -
Save the changes and exit the editor.
-
Run the following command to reload the systemd configuration:
-
- User
What's the point of bothering to run systemctl daemon-reload?
- Assistant
Running
systemctl daemon-reloadis necessary when modifying certain system configuration files, including/etc/fstab. This command notifies systemd to reload its configuration and update any changes made to the configuration files.In this case, updating the
/etc/fstabfile with the new UUID for the/bootpartition requires systemd to be aware of the changes. Without runningsystemctl daemon-reload, systemd may still use the previous configuration and not detect the updated UUID.By running
systemctl daemon-reload, you ensure that systemd reads the modified/etc/fstabfile and applies the changes, allowing the system to correctly mount the/bootpartition using the new UUID specified in the file.