* [linux-lvm] Understand the snapshot process @ 2003-12-31 1:19 Jean Marie Ariès 2003-12-31 15:11 ` David Johnston 0 siblings, 1 reply; 5+ messages in thread From: Jean Marie Ariès @ 2003-12-31 1:19 UTC (permalink / raw) To: linux-lvm Hi, I'm using LVM under SuSE Linux 8.0, and I don't understand all the snapshot process. I know a snapshot is an exact copy of an existing volume :o) Our config is : 2 disks 73 Go RAID 1 --> 1 VG "OVG" (60 GB) --> 1 LV /dev/OVG/data (40 GB) mounted on /share/data To create a snapshot whith ReiserFS, we do this (I'm following the LVM How-To) : Tux :# lvcreate -L30G -s -n snap_admin /dev/OVG/data and so, we mount the snapshot : Tux :# mount /dev/OVG/snap_admin /share/snapshot At this point, the /share/snapshot contain a copy of the /share/data directory. The How To say "Do the backup" for exemple with tar. My question is : Why we must to copy the data with a system command on the snapshot ? Is a "create snapshot/remove snapshot" not possible ? Thanks in advnace for your response. -- Jean Marie Ari�s ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [linux-lvm] Understand the snapshot process 2003-12-31 1:19 [linux-lvm] Understand the snapshot process Jean Marie Ariès @ 2003-12-31 15:11 ` David Johnston 2004-01-02 1:17 ` Jean Marie Ariès 0 siblings, 1 reply; 5+ messages in thread From: David Johnston @ 2003-12-31 15:11 UTC (permalink / raw) To: linux-lvm On Wed, 2003-12-31 at 02:17, Jean Marie Ariès wrote: > Hi, > > I'm using LVM under SuSE Linux 8.0, and I don't understand all the > snapshot process. > > Our config is : > 2 disks 73 Go RAID 1 > --> 1 VG "OVG" (60 GB) > --> 1 LV /dev/OVG/data (40 GB) mounted on /share/data > > To create a snapshot with ReiserFS, we do this: > Tux :# lvcreate -L30G -s -n snap_admin /dev/OVG/data > and so, we mount the snapshot : > Tux :# mount /dev/OVG/snap_admin /share/snapshot > > At this point, the /share/snapshot contain a copy of the /share/data > directory. > > The How To say "Do the backup" for exemple with tar. > > My question is : Why we must to copy the data with a system command on > the snapshot ? Is a "create snapshot/remove snapshot" not possible ? Jean Marie, The snapshot is useful for narrowing a backup window, but is not useful as a backup. In other words, a backup can take hours while a snapshot takes seconds. This is possible because the snapshot creation process does not copy your data; it simply sets up a process that will track any future changes. Once you've created a snapshot, you can go back to work (restart your database, for example). The data in the original LV (/dev/OVG/data) will change, but the data in /share/snapshot won't. Once you've copied /share/snapshot/ somewhere safe, you remove the snapshot with lvremove. The How-To suggests tar, but other commands are possible. Why not leave the snapshot in place all the time? Well, there are three reasons. 1) As long as the snapshot exists, writes to /dev/OVG/data will be slower than usual because they have to be done twice (once to record the new data in /dev/OVG/data, once to record the changes in /dev/OVG/snap_admin). 2)If you leave a snapshot in place long enough, it will run out of space to store the changes; once this happens, your snapshot is useless. In the example you gave, you can make roughly 30GB worth of changes before the snapshot fills up. You can extend the snapshot to the size of the original lv (40GB) but not beyond. 3) If the disk drive fails, both the original LV and the snapshot will be lost. I hope my explanation is clear and correct. If not, somebody please let me know ;-) -- David Johnston <david@littlebald.com> Little Bald Consulting, LLC ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [linux-lvm] Understand the snapshot process 2003-12-31 15:11 ` David Johnston @ 2004-01-02 1:17 ` Jean Marie Ariès 2004-01-02 10:40 ` David Johnston 0 siblings, 1 reply; 5+ messages in thread From: Jean Marie Ariès @ 2004-01-02 1:17 UTC (permalink / raw) To: linux-lvm Great ! Your explanation is perfect :o) So, I understand better the use of a snapshot. The /data contains files sharing with Samba. So, I think I can do one snapshot per day at midnight, and remove it immediatly. If I have to restore data for the snapshot, its's alway possible to mount the /dev/OVG/snap_admin ? Thanks in advance and happy new year ! David Johnston a �crit : > On Wed, 2003-12-31 at 02:17, Jean Marie Ari�s wrote: > > Hi, > > > > I'm using LVM under SuSE Linux 8.0, and I don't understand all the > > snapshot process. > > > > Our config is : > > 2 disks 73 Go RAID 1 > > --> 1 VG "OVG" (60 GB) > > --> 1 LV /dev/OVG/data (40 GB) mounted on /share/data > > > > To create a snapshot with ReiserFS, we do this: > > Tux :# lvcreate -L30G -s -n snap_admin /dev/OVG/data > > and so, we mount the snapshot : > > Tux :# mount /dev/OVG/snap_admin /share/snapshot > > > > At this point, the /share/snapshot contain a copy of the /share/data > > directory. > > > > The How To say "Do the backup" for exemple with tar. > > > > My question is : Why we must to copy the data with a system command on > > the snapshot ? Is a "create snapshot/remove snapshot" not possible ? > > Jean Marie, > The snapshot is useful for narrowing a backup window, but is not useful > as a backup. > > In other words, a backup can take hours while a snapshot takes seconds. > This is possible because the snapshot creation process does not copy > your data; it simply sets up a process that will track any future > changes. > > Once you've created a snapshot, you can go back to work (restart your > database, for example). The data in the original LV (/dev/OVG/data) > will change, but the data in /share/snapshot won't. Once you've copied > /share/snapshot/ somewhere safe, you remove the snapshot with lvremove. > The How-To suggests tar, but other commands are possible. > > Why not leave the snapshot in place all the time? Well, there are three > reasons. > > 1) As long as the snapshot exists, writes to /dev/OVG/data will be > slower than usual because they have to be done twice (once to record the > new data in /dev/OVG/data, once to record the changes in > /dev/OVG/snap_admin). > > 2)If you leave a snapshot in place long enough, it will run out of space > to store the changes; once this happens, your snapshot is useless. In > the example you gave, you can make roughly 30GB worth of changes before > the snapshot fills up. You can extend the snapshot to the size of the > original lv (40GB) but not beyond. > > 3) If the disk drive fails, both the original LV and the snapshot will > be lost. > > I hope my explanation is clear and correct. If not, somebody please let > me know ;-) > -- > David Johnston <david@littlebald.com> > Little Bald Consulting, LLC > > _______________________________________________ > linux-lvm mailing list > linux-lvm@sistina.com > http://lists.sistina.com/mailman/listinfo/linux-lvm > read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/ -- Sinc�rement, Jean Marie Ari�s Imprimeries IPS Responsable Syst�mes/R�seaux ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [linux-lvm] Understand the snapshot process 2004-01-02 1:17 ` Jean Marie Ariès @ 2004-01-02 10:40 ` David Johnston 2004-01-02 11:40 ` Jean Marie Ariès 0 siblings, 1 reply; 5+ messages in thread From: David Johnston @ 2004-01-02 10:40 UTC (permalink / raw) To: linux-lvm On Fri, 2004-01-02 at 02:15, Jean Marie Ariès wrote: > Great ! > > Your explanation is perfect :o) > > So, I understand better the use of a snapshot. > > The /data contains files sharing with Samba. So, I think I can do one > snapshot per day at midnight, and remove it immediatly. If I have to restore > data for the snapshot, its's alway possible to mount the /dev/OVG/snap_admin > ? Jean Marie, I'm not sure I understand what you accomplish this way. Do you mean to say that you would remove yesterday's snapshot and create a new one at midnight each night? This protects you from accidents ("rm -f /data") but not from someone who needs last Friday's version of a file. If you need the data in the snapshot, you need to put it somewhere safe. To summarize: 1. Unmount /data 2. Make the snapshot 3. Remount /data 4. Mount the snapshot 5. Back up the snapshot (copy the data to tape, cd, whatever) 6. Unmount the snapshot 7. Remove the snapshot -David -- David Johnston <david@littlebald.com> Little Bald Consulting, LLC ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [linux-lvm] Understand the snapshot process 2004-01-02 10:40 ` David Johnston @ 2004-01-02 11:40 ` Jean Marie Ariès 0 siblings, 0 replies; 5+ messages in thread From: Jean Marie Ariès @ 2004-01-02 11:40 UTC (permalink / raw) To: linux-lvm Ok. In other sentence, the life of the snapshot is the time between the lvcreate -s and the lvremove command. The data must be saved if we need old files. So the snapshot is only a good solution to backup the data update every time ? David Johnston a �crit : > On Fri, 2004-01-02 at 02:15, Jean Marie Ari�s wrote: > > Great ! > > > > Your explanation is perfect :o) > > > > So, I understand better the use of a snapshot. > > > > The /data contains files sharing with Samba. So, I think I can do one > > snapshot per day at midnight, and remove it immediatly. If I have to restore > > data for the snapshot, its's alway possible to mount the /dev/OVG/snap_admin > > ? > > Jean Marie, > I'm not sure I understand what you accomplish this way. Do you mean to > say that you would remove yesterday's snapshot and create a new one at > midnight each night? This protects you from accidents ("rm -f /data") > but not from someone who needs last Friday's version of a file. > > If you need the data in the snapshot, you need to put it somewhere safe. > > To summarize: > 1. Unmount /data > 2. Make the snapshot > 3. Remount /data > 4. Mount the snapshot > 5. Back up the snapshot (copy the data to tape, cd, whatever) > 6. Unmount the snapshot > 7. Remove the snapshot > > -David > -- > David Johnston <david@littlebald.com> > Little Bald Consulting, LLC > > _______________________________________________ > linux-lvm mailing list > linux-lvm@sistina.com > http://lists.sistina.com/mailman/listinfo/linux-lvm > read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/ -- Sinc�rement, Jean Marie Ari�s Imprimeries IPS Responsable Syst�mes/R�seaux ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2004-01-02 11:40 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2003-12-31 1:19 [linux-lvm] Understand the snapshot process Jean Marie Ariès 2003-12-31 15:11 ` David Johnston 2004-01-02 1:17 ` Jean Marie Ariès 2004-01-02 10:40 ` David Johnston 2004-01-02 11:40 ` Jean Marie Ariès
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.