LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   With bootable RAID1 and LVM, what benefit do HDD partitions provide? (https://www.linuxquestions.org/questions/linux-newbie-8/with-bootable-raid1-and-lvm-what-benefit-do-hdd-partitions-provide-4175594553/)

Cracked Pane 12-01-2016 12:00 AM

With bootable RAID1 and LVM, what benefit do HDD partitions provide?
 
So I've been reading and studying for a few weeks, run xubuntu off a usb, getting ready for my 1st linux install - bootable raid1.

I have read about setting up partitions for /swap, /user, /opt etc.

I understand the benefit of LVM is scaleable Logical Volumes and can add and remove LV's.

reading this guide:
https://linuxconfig.org/linux-lvm-lo...volume-manager

Looking at first diagram or the diagram at Wikipedia:
https://en.wikipedia.org/wiki/Logica...Manager_(Linux)

The Logical Volume Group spans the entire HDD and LVs (can we call those virtual partitions?) are contained in the Vol Group.

If I create an LV to mount /swap,
and an LV to mount /opt
and an LV to mount /user etc

What does partitioning my physical 500GB HDD gain me (for a bootable RAID1) before I install the LVM and Vol Group on top of the HDD?

Doesn't the OS only see the LV's in the Logical Group?

Thanks

Wish I could cut and paste a template for bootable RAID1 hdd LVM/partition setup from someplace...

syg00 12-01-2016 01:02 AM

The bigger benefit is the ability to add/remove PV's.
Do *NOT* make up misleading terminology of you expect help from others. The terminology for LVM is well known and well explained. Use it.

There is no intrinsic benefit in partitioning a device prior to pvcreate - however:
- most documentation you will find will be predicated on partitioned disks.
- initrd may or may not be aware of full disk PVs. YMMV.

rknichols 12-01-2016 09:27 AM

A big reason for partitioning (even if it's just a single partition using the entire drive) is so that at some time in the future you won't see a partitioning tool report "sd{X} has no partitions" and mistakenly conclude that this is the new disk you just installed. It's similar to the reason that GPT always creates a "Protective MBR" with a single, maximum-sized partition. It keeps a non-GPT-aware tool from reporting that nothing is allocated on the disk.

Also, if at some point you decide that you really do want a separate partition on the disk (perhaps for installing another OS), shrinking an existing partition and adding another is a heck of a lot easier than converting a disk from unpartitioned to partitioned.

Cracked Pane 12-02-2016 11:21 PM

Quote:

Originally Posted by syg00 (Post 5636569)
Do *NOT* make up misleading terminology if you expect help from others. The terminology for LVM is well known and well explained. Use it.

Proposed text clarification: Can I think of the LV as being real similar to a disk partition? The OS sees and treats the two devices the same, no?

Quote:

Originally Posted by rknichols (Post 5636684)
A big reason for partitioning (even if it's just a single partition using the entire drive) is so that at some time in the future you won't see a partitioning tool report "sd{X} has no partitions" and mistakenly conclude that this is the new disk you just installed.

Excellent tip RK!!! A single big partition it will be. establishing a partition table makes sense, I just couldn't see the need for multiple partitions, just to have them 'hidden'from the OS by a LG spanning the whole disk.

Thanks Guys.

JeremyBoden 12-03-2016 06:53 AM

Is it possible to boot a LVM disk without having a separate /boot partition?

rknichols 12-03-2016 09:01 AM

Quote:

Originally Posted by JeremyBoden (Post 5637386)
Is it possible to boot a LVM disk without having a separate /boot partition?

With GRUB 2, yes. With GRUB legacy, no. With other boot loaders, YMMV.

tofino_surfer 12-07-2016 11:16 PM

No one has yet mentioned the need for at least one partition, the 1 MiB Bios Boot partition where the grub2 core.img is stored in a small partition with no filesystem. if you plan on booting from these disks you will at least need this small partition.

Also since you plan on using LVM on top of mdraid Raid 1 I recommend using a separate /boot partition outside of LVM. This is what the Fedora installer does as well as others. While technically it is possible to boot a LVM disk without having a separate /boot partition as rknichols said it is more complex and requires the LVM grub modules to be installed into the core.img.

From the GRUB Arch-Wiki

LVM

If you use LVM for your /boot, make sure that the lvm module is preloaded:

/etc/default/grub

GRUB_PRELOAD_MODULES="lvm"

You may also have to add grub modules for mdraid as well in your case. Also from the GRUB Arch-Wiki:

RAID

GRUB provides convenient handling of RAID volumes. You need to add insmod mdraid09 or mdraid1x which allows you to address the volume natively. For example, /dev/md0 becomes:

set root=(md/0)

whereas a partitioned RAID volume (e.g. /dev/md0p1) becomes:

set root=(md/0,1)

To install grub when using RAID1 as the /boot partition (or using /boot housed on a RAID1 root partition), on devices with GPT ef02/'BIOS boot partition', simply run grub-install on both of the drives, such as:

# grub-install --target=i386-pc --debug /dev/sda
# grub-install --target=i386-pc --debug /dev/sdb

There were no guides on how to boot with a /boot directory on lvm on top of raid.

It is much simpler to have a separate /boot partition on a regular partition.


All times are GMT -5. The time now is 07:22 AM.