LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 12-01-2016, 12:00 AM   #1
Cracked Pane
LQ Newbie
 
Registered: Oct 2016
Posts: 13

Rep: Reputation: Disabled
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...
 
Old 12-01-2016, 01:02 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
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.
 
Old 12-01-2016, 09:27 AM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
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, ...
 
Old 12-02-2016, 11:21 PM   #4
Cracked Pane
LQ Newbie
 
Registered: Oct 2016
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by syg00 View Post
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 View Post
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.
 
Old 12-03-2016, 06:53 AM   #5
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,947

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
Is it possible to boot a LVM disk without having a separate /boot partition?
 
Old 12-03-2016, 09:01 AM   #6
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by JeremyBoden View Post
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.
Old 12-07-2016, 11:16 PM   #7
tofino_surfer
Member
 
Registered: Aug 2007
Posts: 483

Rep: Reputation: 153Reputation: 153
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
lvm ontop of raid10 or combine two raid1 via lvm? okar Linux - Server 3 09-11-2009 02:37 PM
LXer: How To Resize LVM Software RAID1 Partitions (Shrink & Grow) LXer Syndicated Linux News 0 01-09-2009 02:11 PM
Non-bootable software RAID1 partitions also cannot be mounted pcardout Linux - Server 4 06-28-2007 08:13 PM
LXer: Recover Data From RAID1 LVM Partitions With Knoppix Linux LiveCD LXer Syndicated Linux News 0 04-24-2007 04:01 PM
[RAID1, GRUB] Secondary HDD can't boot up when primary HDD fails Akhran Linux - Newbie 2 05-04-2006 04:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration