Joseph L. Casale
2008-Feb-04 22:29 UTC
[CentOS] Install on two discs with Software Raid and LVM
I am mirroring two drives during install, what's the best practice here for the swap partition? Maybe two separate lv's from independent vg's *not* mirrored for swap and the let the OS manage it? Boot and the / vg will be mirrored. Thanks! jlc
Ross S. W. Walker
2008-Feb-04 22:40 UTC
[CentOS] Install on two discs with Software Raid and LVM
Create a swap lv in the vg you created out of /dev/md1, assuming /dev/md0 is /boot. -Ross ----- Original Message ----- From: centos-bounces at centos.org <centos-bounces at centos.org> To: 'centos at centos.org' <centos at centos.org> Sent: Mon Feb 04 17:29:45 2008 Subject: [CentOS] Install on two discs with Software Raid and LVM I am mirroring two drives during install, what's the best practice here for the swap partition? Maybe two separate lv's from independent vg's *not* mirrored for swap and the let the OS manage it? Boot and the / vg will be mirrored. Thanks! jlc _______________________________________________ CentOS mailing list CentOS at centos.org http://lists.centos.org/mailman/listinfo/centos ______________________________________________________________________ This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender and permanently delete the original and any copy or printout thereof. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.centos.org/pipermail/centos/attachments/20080204/9369a54d/attachment-0001.html>
Joseph L. Casale
2008-Feb-04 22:43 UTC
[CentOS] Install on two discs with Software Raid and LVM
>Create a swap lv in the vg you created out of /dev/md1, assuming /dev/md0 is /boot. > >-RossOh, I thought it wasn?t good to run swap inside software raid? If I was wrong, I assume this is beneficial since if one of the HD?s tanks while its running, it will survive the failure and not need to reboot? Thanks! jlc
Les Mikesell
2008-Feb-04 22:49 UTC
[CentOS] Install on two discs with Software Raid and LVM
Joseph L. Casale wrote:> I am mirroring two drives during install, what's the best practice here for the swap partition? Maybe two separate lv's from independent vg's *not* mirrored for swap and the let the OS manage it? Boot and the / vg will be mirrored. >If you would like to keep running though a disk failure you need to mirror swap. -- Les Mikesell lesmikesell at gmail.com
Ross S. W. Walker
2008-Feb-04 22:51 UTC
[CentOS] Install on two discs with Software Raid and LVM
That's old information, kernel swapper can handle all types of dev mapper setups these days (well all types on fixed media). -Ross ----- Original Message ----- From: centos-bounces at centos.org <centos-bounces at centos.org> To: 'CentOS mailing list' <centos at centos.org> Sent: Mon Feb 04 17:43:50 2008 Subject: RE: [CentOS] Install on two discs with Software Raid and LVM>Create a swap lv in the vg you created out of /dev/md1, assuming /dev/md0 is /boot. > >-RossOh, I thought it wasn?t good to run swap inside software raid? If I was wrong, I assume this is beneficial since if one of the HD?s tanks while its running, it will survive the failure and not need to reboot? Thanks! jlc ______________________________________________________________________ This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender and permanently delete the original and any copy or printout thereof. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.centos.org/pipermail/centos/attachments/20080204/8def8aac/attachment-0001.html>
Joseph L. Casale
2008-Feb-04 22:53 UTC
[CentOS] Install on two discs with Software Raid and LVM
>That's old information, kernel swapper can handle all types of dev mapper setups these days (well all types on fixed media).Ross and Les, Thank you! jlc
Joseph L. Casale wrote:> I am mirroring two drives during install, what's the best practice here for > the swap partition? Maybe two separate lv's from independent vg's *not* > mirrored for swap and the let the OS manage it? Boot and the / vg will be > mirrored.More of a comment than a answer but I don't use LVM for the internal disks on my systems, only for external disks(SAN, etc). I've found that at least for me LVM is very problematic when used in kickstart, I get frequent failures(python errors). So I just go with normal partitions internally. My software raid setup for systems that use it, is 100MB /boot partition, a 4G swap partition and the rest of the drive is one big root partition. All of them in software RAID 1. #Partition clearing information clearpart --all #Partition the Drives part raid.01 --size=100 --ondisk=sda part raid.02 --size=100 --ondisk=sdb raid /boot --level 1 --device=md0 raid.01 raid.02 part raid.03 --size=4096 --ondisk=sda part raid.04 --size=4096 --ondisk=sdb raid swap --level 1 --device=md1 raid.03 raid.04 part raid.05 --size=100 --ondisk=sda --grow part raid.06 --size=100 --ondisk=sdb --grow raid / --level 1 --device=md2 raid.05 raid.06 Then to work around a software raid bug in anaconda in CentOS/RHEL 4(not sure about 5, but I still do it anyways), in my %post I do: cat >/tmp/grub.txt <<EOF root (hd0,0) geometry (hd0) setup (hd0) geometry (hd1) setup (hd1) quit EOF grub --batch </tmp/grub.txt 2>&1 | tee /root/grub-install.txt Without the workaround there's a high likely hood that the system won't boot to the OS afterwards. If you foresee frequent changes on your OS disks then LVM is probably a good choice, I just got sick of the kickstart failures with it. nate
David G. Miller
2008-Feb-05 15:21 UTC
[CentOS] Re: Install on two discs with Software Raid and LVM
Scott Silva <ssilva at sgvwater.com> wrote:> on 2/4/2008 2:43 PM Joseph L. Casale spake the following: > >>> >> Create a swap lv in the vg you created out of /dev/md1, assuming /dev/md0 is /boot. >>> >> >>> >> -Ross >>> >> > >> > Oh, I thought it wasn???t good to run swap inside software raid? If I was wrong, >> > I assume this is beneficial since if one of the HD???s tanks while its running, > it will survive the failure and not need to reboot? > >> > >> > Thanks! >> > jlc >> > That is an old assumption from the infancy of software raid, less than optimal > installed ram, and slower processors. When ram was expensive, you used more > swap because it was cheaper. But ram is so much cheaper now that it make no > sense to run a machine that needs to touch swap except in an emergency. >Not really a valid assumption about install enough memory and swap won't get used. *nixes have a design feature that swaps out programs that aren't used "just in case" the some other program needs the space. Sun workstations back in the '80s and '90s used to be the worst at this. It was faster to shutdown at night and restart in the morning since leaving the system up all night would result in most everything getting swapped out to disk "just in case" the space would be needed. Try to use the system in the morning and it would be busy swapping everything back into RAM for quite a while. So with 2GB of RAM on my desktop, I still see 144K of swap getting used with me generating very little activity as I read my e-mail. If my swap "went away", I would have a problem if Linux tried to swap back in whatever that 144k of program is. Better to have swap on a RAID volume. Cheers, Dave -- Politics, n. Strife of interests masquerading as a contest of principles. -- Ambrose Bierce