* [linux-lvm] Raid or backups
@ 2003-11-21 11:31 Micah Anderson
2003-11-21 15:13 ` jon
2003-11-24 8:04 ` Brian J. Murrell
0 siblings, 2 replies; 3+ messages in thread
From: Micah Anderson @ 2003-11-21 11:31 UTC (permalink / raw)
To: linux-lvm
I am trying to decide what the best way to deal with backups on a LVM
system is.
I've got one 120gig disk that the system is riding on, 110gigs of that
is setup on a LVM partition as such:
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/sympavg01/spool 511980 101640 410340 20% /home/sympa/spool
/dev/sympavg01/archives 27503796 15009052 12494744 55% /home/sympa/archives
/dev/sympavg01/expl 6291260 3758112 2533148 60% /home/sympa/expl
The rest is partitioned up into separate /, /boot, /tmp, /usr, /var,
and home (and swap).
I don't like a machine that is dependant on one disk any more than the
next guy, so I put another 120gig disk in the machine, thinking I
would raid the two together. After reading months of list archives, I
am seeing that building a raid array on the system at this point is
not going to be straightforward, especially since the machine is in
production. It seems the best method for doing this would be to build
up md raid devices, layer LVM on top of the md's and then create
filesystems, this isn't easy if you already have things up and running
(although I am interested to hear if people have done this, and if so,
how).
In addtion, I feel as if backup up the system is a higher priority
than having disk redundancy (mirrored corrupt data is worse for my
situation than a disk failure and recovery time).
It is simple for me to take a disk backup of the non LVM partitions (I
use StoreBackup), but I am somewhat puzzled about the best direction
to go with the LVM volumes. Should I back them up just like any other
partition and not let the LVM bother me? What about the LVM metadata
and if I needed to restore from this backup?
Would taking snapshots be more advisable? The data in these partitions
changes fairly raipidly. If I were to do snapshots, does it make sense
to make the snapshot onto my backup disk (hdc) and then back up that
snapshot onto the backup disk (hdc again), and then destroy the
snapshot? Or is it a waste to snapshot to a different disk entirely,
should I instead keep the snapshot to the same volume it is on? Or
does it not matter at all because snapshots don't actually do much
disk work until you start accessing the data?
Thanks for any insights!
micah
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [linux-lvm] Raid or backups
2003-11-21 11:31 [linux-lvm] Raid or backups Micah Anderson
@ 2003-11-21 15:13 ` jon
2003-11-24 8:04 ` Brian J. Murrell
1 sibling, 0 replies; 3+ messages in thread
From: jon @ 2003-11-21 15:13 UTC (permalink / raw)
To: linux-lvm
On Fri, Nov 21, 2003 at 11:29:15AM -0600, Micah Anderson wrote:
> I am trying to decide what the best way to deal with backups on a LVM
> system is.
backup like any other system.
[cut]
> I don't like a machine that is dependant on one disk any more than the
> next guy, so I put another 120gig disk in the machine, thinking I
> would raid the two together. After reading months of list archives, I
> am seeing that building a raid array on the system at this point is
> not going to be straightforward, especially since the machine is in
> production. It seems the best method for doing this would be to build
> up md raid devices, layer LVM on top of the md's and then create
> filesystems, this isn't easy if you already have things up and running
> (although I am interested to hear if people have done this, and if so,
> how).
it is very easy, i do it all the time because the debian woody
installer doesnt support a raided install.
Read the software raid howto.
Then read the LVM howto.
Particular:
http://www.tldp.org/HOWTO/Software-RAID-HOWTO-4.html#ss4.4
http://www.tldp.org/HOWTO/Software-RAID-HOWTO-4.html#ss4.10
http://www.tldp.org/HOWTO/Software-RAID-HOWTO-4.html#ss4.11
http://www.tldp.org/HOWTO/Software-RAID-HOWTO-4.html#ss4.12
use method 2
Mark it failed
After this, you either spend time doing this
find . -xdev | cpio -pm /mnt/newroot
which is a waste of time, since this is a LVM system
http://tldp.org/HOWTO/LVM-HOWTO/x546.html
http://tldp.org/HOWTO/LVM-HOWTO/x662.html
http://tldp.org/HOWTO/LVM-HOWTO/removeadisk.html
So really, it is not a problem. If you want to, you can catch me
at irc.oftc.net at #vserver, and i'll walk you through it.
> In addtion, I feel as if backup up the system is a higher priority
> than having disk redundancy (mirrored corrupt data is worse for my
> situation than a disk failure and recovery time).
do both, both mirror and backup.
> It is simple for me to take a disk backup of the non LVM partitions (I
> use StoreBackup), but I am somewhat puzzled about the best direction
> to go with the LVM volumes. Should I back them up just like any other
> partition and not let the LVM bother me? What about the LVM metadata
> and if I needed to restore from this backup?
I would either take filesystem backup, or the partition containing the LVM
system. But... setting up a LVM system does not take long, so just do the
filesystem on file level, not blocklevel.
> Would taking snapshots be more advisable? The data in these partitions
> changes fairly raipidly. If I were to do snapshots, does it make sense
> to make the snapshot onto my backup disk (hdc) and then back up that
> snapshot onto the backup disk (hdc again), and then destroy the
> snapshot? Or is it a waste to snapshot to a different disk entirely,
> should I instead keep the snapshot to the same volume it is on? Or
> does it not matter at all because snapshots don't actually do much
> disk work until you start accessing the data?
Snapshots MIGHT degrade your performance, but they are good if
you run a database, then you can shut it down, take a snapshot
and start it up again.
JonB
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [linux-lvm] Raid or backups
2003-11-21 11:31 [linux-lvm] Raid or backups Micah Anderson
2003-11-21 15:13 ` jon
@ 2003-11-24 8:04 ` Brian J. Murrell
1 sibling, 0 replies; 3+ messages in thread
From: Brian J. Murrell @ 2003-11-24 8:04 UTC (permalink / raw)
To: linux-lvm
[-- Attachment #1: Type: text/plain, Size: 2588 bytes --]
On Fri, 2003-11-21 at 12:29, Micah Anderson wrote:
>
> I don't like a machine that is dependant on one disk any more than the
> next guy, so I put another 120gig disk in the machine, thinking I
> would raid the two together. After reading months of list archives, I
> am seeing that building a raid array on the system at this point is
> not going to be straightforward, especially since the machine is in
> production. It seems the best method for doing this would be to build
> up md raid devices, layer LVM on top of the md's and then create
> filesystems, this isn't easy if you already have things up and running
> (although I am interested to hear if people have done this, and if so,
> how).
Debian Woody's installer has no concept whatsoever of raid and lvm, I
build all my systems with mirrored LVs anyhow. Here is how I do it:
1. Start Debian install
2. Create 20MB /boot filesystem/partition at the start of the disk
3. Then create a "temporary" root filesystem/partition the size
that you want swap to eventually be (minimum 200MB or so to get
minimal debian install onto it)
4. Then create one partition for all remaining space
5. Do not specify to mount /boot partition during installation so
that /boot files are put on "temporary" root filesystem
6. Do minimal Debian install (no to tasksel and dselect) into 250MB
partition, specify no swap partition
7. When all done installing truly minimal install, put second disk
into machine
8. Use sfdisk to duplicate partition table to second disk
9. Create raidtab mapping partition(s) 1, 2 and 3 to md0, md1 and
md2 respectively
10. mkraid /dev/md0
11. Mount /dev/md0 on /mnt and copy /boot to it, remove /boot/* and
mount /dev/md0 on /boot
12. mkraid /dev/md2
13. pvcreate /dev/md2
14. vgcreate /dev/md2
15. lvcreate root, mkfs ... /dev/.../root
16. lvcreate usr, mkfs ... /dev/.../root
17. lvcreate ...
18. mount /dev/.../root /mnt, /dev/.../usr /usr, ...
19. copy -rax / /mnt, cp -rax /usr /mnt, ...
20. Create initrd to reflect above -- I use Adrian Bunk's
initrd-tools
21. Edit /etc/lilo.conf to reflect /dev/md0 is boot partition and
lvm lv as root partition
22. edit fstab to reflect above changes
23. reboot
24. mkraid /dev/md1
25. add /dev/md1 to fstab as swap partition and swapon -a
Have fun.
b.
--
My other computer is your Microsoft Windows server.
Brian J. Murrell
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-11-24 8:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-21 11:31 [linux-lvm] Raid or backups Micah Anderson
2003-11-21 15:13 ` jon
2003-11-24 8:04 ` Brian J. Murrell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox