Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
12-01-2016, 12:00 AM
|
#1
|
LQ Newbie
Registered: Oct 2016
Posts: 13
Rep: 
|
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...
|
|
|
12-01-2016, 01:02 AM
|
#2
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,448
|
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.
|
|
|
12-01-2016, 09:27 AM
|
#3
|
Senior Member
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,828
|
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.
Last edited by rknichols; 12-01-2016 at 09:32 AM.
Reason: Also, ...
|
|
|
12-02-2016, 11:21 PM
|
#4
|
LQ Newbie
Registered: Oct 2016
Posts: 13
Original Poster
Rep: 
|
Quote:
Originally Posted by syg00
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
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.
|
|
|
12-03-2016, 06:53 AM
|
#5
|
Senior Member
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,959
|
Is it possible to boot a LVM disk without having a separate /boot partition?
|
|
|
12-03-2016, 09:01 AM
|
#6
|
Senior Member
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,828
|
Quote:
Originally Posted by JeremyBoden
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.
|
|
1 members found this post helpful.
|
12-07-2016, 11:16 PM
|
#7
|
Member
Registered: Aug 2007
Posts: 483
Rep: 
|
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 06:53 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|