LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Using LVM on RAID, some questions (https://www.linuxquestions.org/questions/slackware-14/using-lvm-on-raid-some-questions-628334/)

[GOD]Anck 03-15-2008 07:25 PM

Using LVM on RAID, some questions
 
Hello,

I'm planning to install Slackware 12 on software raid 1, using LVM to manage partitions. My knowledge of LVM is limited to what I've read the past few days, plus a quick test install on a spare machine, so naturally I have some questions.

I understand it's not possible to boot from LVM, and it's generally not recommended to have / or swap on a logical volume, so my thoughts on partitions would be something like this:

/dev/md0 raid1 consisting of /dev/sd[ab]1, 128M /boot
/dev/md1 raid1 consisting of /dev/sd[ab]2, 2G swap
/dev/md2 raid1 consisting of /dev/sd[ab]3, 6G /
/dev/md3 raid1 consisting of /dev/sd[ab]4, "the rest", linux LVM

/ would contain everything but /usr/local, /var, /tmp and /home, which I plan to have as separate logical volumes on a volume group using /dev/md3 as a physical volume.

The first question would be, is this a good setup? I've read that LVM on some systems supports raid1 style mirroring, but most of the LVM howto's out there suggest using md for that instead. What are the pros and cons of LVM mirroring compared to md raid?

What about the partitions? I'd like to split up everything that could potentially grow out of control and hang the system (/var, /tmp, /home), as well as everything that isn't part of the distribution (/usr/local). Would it make sense to split /usr onto its own logical volume? How "safe" is this setup; if something breaks, can I boot from a CD and fix it without having to worry about the logical volumes?

My last concern is about file systems. Can I just use any file system with LVM? I know reiserfs supports online growing and offline shrinking. Would it be a good file system of choice for use on logical volumes or should I look at something else instead?

Comments and input appreciated. :)

lstamm 03-15-2008 10:51 PM

Quote:

/dev/md1 raid1 consisting of /dev/sd[ab]2, 2G swap
No need to put swap into RAID1; this would probably make for slow swapping since everything swapped out would then need to be written to both discs. Just make two regular swap partitions, one on each disc, and let the computer decide which disc to swap to.

Quote:

Would it make sense to split /usr onto its own logical volume? How "safe" is this setup; if something breaks, can I boot from a CD and fix it without having to worry about the logical volumes?
I put /usr into its own partition on servers, but don't bother for personal workstations. I'm not sure it makes that much difference, unless it helps with your backup regime.

All the lvm tools reside under /sbin, so putting /usr in a logical volume will work fine. If the lvm volumes get screwed up somehow, you will still be able to boot up and attempt a repair as long as /sbin, /bin, and /etc are still under / on a filesystem that is not lvm.

Quote:

Can I just use any file system with LVM?
I think any linux filesystem will work. I don't know about NTFS or VFAT. The only ones I have used are ext3 and reiserfs. I never tried to change the size of the filesystems while mounted either; that just seemed like asking for trouble.

[GOD]Anck 03-16-2008 11:07 AM

Thank you for your reply.

Quote:

Originally Posted by lstamm (Post 3090017)
No need to put swap into RAID1; this would probably make for slow swapping since everything swapped out would then need to be written to both discs. Just make two regular swap partitions, one on each disc, and let the computer decide which disc to swap to.

My reason for having swap on raid1 is higher availability; I realize I would see better swap performance if I let the kernel stripe swap over equal priority partitions, but a disk failure would almost certainly bring the system down. Having swap on raid should allow it to keep running off one disk until the other can be replaced.

Meanwhile I've done some more research into file systems. It seems JFS and XFS only support growing, while reiserfs and ext3 support (offline) shrinking as well. The ability to resize both ways seems to make sense within the LVM environment.


All times are GMT -5. The time now is 05:53 PM.