[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: new pc and swap



Le 31/10/2016 à 14:54, Stefan Monnier a écrit :

Of course, it's possible.  But if you setup a system from scratch I'd
highly recommend you put "everything" into an LVM volume group so you
can then use an LVM volume for swap rather than a file (but with the
same advantages as using a file: it's easy to resize/create on-demand
at run-time).

I second that suggestion.
(am I an LVM fanboy ? Hmm, maybe)

PS: I put "everything" between quotes because I'm not sure I'd recommend
    to also put /boot in an LVM volume.  IIUC it can be made to work
    nowadays, but my systems still use a two-partition setup: one small
    partition for /boot, and the rest for LVM.

GRUB 2 can read LVM, so it can boot a system with /boot in LVM. I have used this kind of setup. The advantage is that you don't need a separate partition for /boot and that it provides all the benefits of LVM to /boot. I don't know about LILO nor any other bootloader.

However, if the LVM structure gets corrupted and GRUB cannot read it, then the boot process will fail before the boot menu. If /boot is on a separate partition which can be read, then the boot will fail only after loading and running the kernel and the initramfs. So the initramfs debug shell is still available to investigate and try to repair the issue without requiring to boot another system.

Also, with BIOS/legacy boot, putting /boot in LVM requires that GRUB's core image (boot sector) is installed in the disk boot sector (aka MBR, not in a partition boot sector) and GRUB's core image is installed in the "embedded area" on a DOS-style disk or in a dedicated "BIOS boot"/bios_grub partition on a GPT-style disk (not as a regular file in /boot/grub).


Reply to: