You are not logged in.
Pages: 1
I'm installing on a brand new disk (/dev/sda). I have no other disks. I decided to go for the lvm option, and I did not use physical partitions: I created a single physical volume that fills the whole disk. I followed this note from the wiki:
Note: If using a SSD without partitioning it first, use pvcreate --dataalignment 1m /dev/sda
I set up happily my lvm logical volumes, mounted them, installed the base system and reached the point where I have to install a bootloader. Here I stopped and I felt quite stupid because I have no clue where to install grub. Installing it in /dev/sda is not an option since it is entirely used by the physical volume.
What is the correct procedure?
Last edited by andyspiros (2015-04-10 09:45:05)
Offline
Doesn't grub go into /boot by default and overwrite the MBR (for BIOS systems)? In case of an UEFI system, you might not need grub at all.
Offline
Install it to /dev/sda. It'll moan if it can't fit, in which case you may need to try a different bootloader, or repartition.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
To install grub into the MBR I need to have the MBR free. But the physical volume owns it completely. If I try and run
grub-install --recheck /dev/sda
I get the following error messages:
Installing for i386-pc platform.
/run/lvm/lvmetad.socket: connect failed: No such file or directory
WARNING: Failed to connect to lvmetad. Falling back to internal scanning
/run/lvm/lvmetad.socket: connect failed: No such file or directory
WARNING: Failed to connect to lvmetad. Falling back to internal scanning
/run/lvm/lvmetad.socket: connect failed: No such file or directory
WARNING: Failed to connect to lvmetad. Falling back to internal scanning
grub-install: error: unable to identify a fielsystem in hostdisk//dev/sda; satefy check can't be performed
Offline
Hello,
This might help:
/etc/default/grub
GRUB_PRELOAD_MODULES="lvm"
/etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="root=lvm/lvm_group_name-lvm_logical_boot_partition_name ..."
Offline
Thanks all for the help, I decided (for other reasons) to do without lvm.
For future reference, I am not sure that setting these variables in the /etc/default/grub file would solve the problem, because I think these are only used after installation, at the time of generating the configuration. But I might be totally wrong, I'm definitely not an expert.
Offline
Thanks all for the help, I decided (for other reasons) to do without lvm.
For future reference, I am not sure that setting these variables in the /etc/default/grub file would solve the problem, because I think these are only used after installation, at the time of generating the configuration. But I might be totally wrong, I'm definitely not an expert.
I know this is irrelevant now, but out of curiosity, did you not create a /boot LV in the VG inside the PG? You would then mount the "mapper-blah-blah" to /mnt/boot(after you mount "/") So that would be where you could install it.
Offline
I did not create a separate /boot LV. Anyway the question is not where to put the grub configuration, but where to install the boot loader so that the system can find it. Even if I had a separate /boot LV how would this help the booting procedure?
Offline
where to install the boot loader so that the system can find it.
If you have a GPT type disk, you will need a BIOS boot partition to house the bootloader (type "ef02" in gdisk, no filesystem) on a non-EFI system.
Check by looking at the output of:
# parted -l
For systems using UEFI a separate /boot partition is needed (512MiB, FAT(32)-formatted, type "ef00" in gdisk); this will hold the bootloader and it's configuration files.
With an MBR disk in a non-EFI system the MBR is used (I think you could have just used `grub-install --force /dev/sda`).
Jin, Jîyan, Azadî
Offline
With an MBR disk in a non-EFI system the MBR is used (I think you could have just used `grub-install --force /dev/sda`).
Are you sure? Even if my LVM physical volume across the whole /dev/sda? Wouldn't I risk overwrite some reserved parts? I does the LVM actual storage start anyway at an offset that allows for the MBR to be written before it?
In case of UEFI now it seems totally clear that using the whole disk for LVM is not an option (if this is your boot disk).
Offline
Are you sure? Even if my LVM physical volume across the whole /dev/sda? Wouldn't I risk overwrite some reserved parts? I does the LVM actual storage start anyway at an offset that allows for the MBR to be written before it?
In case of UEFI now it seems totally clear that using the whole disk for LVM is not an option (if this is your boot disk).
Yes, I'm sure.
The MBR is not part of the filesystem.
https://en.wikipedia.org/wiki/Master_boot_record
With UEFI, LVM can be used as long as a separate EFI system partition is on the system (with /boot or /boot/efi mounted at that partition).
Jin, Jîyan, Azadî
Offline
The MBR is not part of the filesystem.
https://en.wikipedia.org/wiki/Master_boot_record
Agreed, but isn't it part of the disk storage accessible through /dev/sda? Wouldn't I be able to read the MBR contents by using
dd if=/dev/sda bs=512 count=1
(or something similar)?
I'm not arguing, I'm a totally noob of the subject, I'm just trying to understand better.
Offline
Head_on_a_Stick wrote:The MBR is not part of the filesystem.
https://en.wikipedia.org/wiki/Master_boot_recordAgreed, but isn't it part of the disk storage accessible through /dev/sda? Wouldn't I be able to read the MBR contents by using
dd if=/dev/sda bs=512 count=1
(or something similar)?
Yes you can back up your MBR using a similar command but the filesystem itself (ie, the LVM storage area) starts after the MBR.
Jin, Jîyan, Azadî
Offline
Pages: 1