Skip to contentSkip to conversation

Newbie to snapshot

linux-lvm armani 4 participants 4 messages May 18, 2003 – May 20, 2003

lore
Share & tools
lore

armani

author
#0 lore raw

Hello List

I am a newbie to use LVM.

When I read the HowTo on
http://www.linux.org/docs/ldp/howto/LVM-HOWTO/snapshots_backup.html
I tried to practice it with my Linux Box.

Everything is fine but snapshot !

==============================================================
[root@met tmp]# lvscan
lvscan -- ACTIVE Original "/dev/Vol1/LV1" [10 GB]

lvscan -- ACTIVE            "/dev/Vol1/LV2" [2 GB]
lvscan -- ACTIVE            "/dev/Vol1/LV3" [2 GB]
lvscan -- ACTIVE            "/dev/Vol1/LV4" [2 GB]

lvscan -- ACTIVE Snapshot "/dev/Vol1/snapshot" [1.97 GB] of /dev/Vol1/LV1
lvscan -- 5 logical volumes with 17.97 GB total in 1 volume group lvscan -- 5 active logical volumes
==============================================================

As the description, I make a Original LV device named /dev/Vol1/LV1, and then I make a snapshot device named "/dev/Vol1/snapshot" for /dev/Vol1/LV1 .
So I try to put something for /dev/Vol1/LV1

# mount /dev/Vol1/LV1 /mnt/LV1
# mount /dev/Vol1/snapshot /mnt/snapshot [ I'm using ext3 ]
# dd if=/dev/zero of=/mnt/LV1/test bs=1M count=10

and then

# tar cf /dev/hda8 /mnt/snapshot or # tar cf /tmp/test.tar /mnt/snapshot
but I can't see any file except the "/mnt/snapshot/lost+found" directory
with the following command !!
# tar xf /dev/hda8 or # tar xf /tmp/test.tar

I don't have any idea to use this snapshot, any suggested references ?

#1 lore raw
Quoted 5 lines · armani

Hello List

Quoted 9 lines

As the description, I make a Original LV device named /dev/Vol1/LV1, and then I make a snapshot device named "/dev/Vol1/snapshot" for /dev/Vol1/LV1 .
So I try to put something for /dev/Vol1/LV1

# mount /dev/Vol1/LV1 /mnt/LV1
# mount /dev/Vol1/snapshot /mnt/snapshot [ I'm using ext3 ]
# dd if=/dev/zero of=/mnt/LV1/test bs=1M count=10

A snapshot will only capture what you have in the fs at the moment you create the snapshot - like a photograph. After creation, the two are totally independent of each other ( for most practical purposes.)

So to test it, just make another snapshot. The 2nd snapshot will now contain your 10M test file. If you delete it out of the original fs, the 2nd snapshot will still have your test file.

-toby

#2 lore raw

Thanks for toby's explainations!
==
Eventually I create a new snapshot of my LV partition.
But I have another problem with the snapshot of LV.
That is how much snapshot I could create for my LV partition ? As I know some commercial software could create 254 snapshots for one LV such as IBM.

So I try to create another snapshot for LV by issuing the following command:

This is my first snapshot for /dev/Vol1/LV1

[root@met root]# lvcreate --size 100M -s -nsnapshot /dev/Vol1/LV1 lvcreate -- WARNING: the snapshot will be automatically disabled once it gets full
lvcreate -- INFO: using default snapshot chunk size of 64 KB for "/dev/Vol1/snapshot"
lvcreate -- doing automatic backup of "Vol1"
lvcreate -- logical volume "/dev/Vol1/snapshot" successfully created

I tried to create another snapshot for /dev/Vol1/LV1

[root@met root]# lvcreate --size 100M -s -nsnapshot1 /dev/Vol1/LV1 lvcreate -- WARNING: the snapshot will be automatically disabled once it gets full
lvcreate -- INFO: using default snapshot chunk size of 64 KB for "/dev/Vol1/snapshot1"
lvcreate -- doing automatic backup of "Vol1"
lvcreate -- logical volume "/dev/Vol1/snapshot1" successfully created

And how can I estimate the sizes and counts for them ? Is there any rules or principles to formalize the procedures ?

Quoted 1 line

A snapshot will only capture what you have in the fs at the moment you

-- snip --

Quoted 1 line

-toby

-- Armani Liao

#3 lore raw
Quoted 30 lines · armani

Thanks for toby's explainations!
==
Eventually I create a new snapshot of my LV partition.
But I have another problem with the snapshot of LV.
That is how much snapshot I could create for my LV partition ? As I know some commercial software could create 254 snapshots for one LV such as IBM.

So I try to create another snapshot for LV by issuing the following command:

This is my first snapshot for /dev/Vol1/LV1

[root@met root]# lvcreate --size 100M -s -nsnapshot /dev/Vol1/LV1 lvcreate -- WARNING: the snapshot will be automatically disabled once it gets full
lvcreate -- INFO: using default snapshot chunk size of 64 KB for "/dev/Vol1/snapshot"
lvcreate -- doing automatic backup of "Vol1"
lvcreate -- logical volume "/dev/Vol1/snapshot" successfully created

I tried to create another snapshot for /dev/Vol1/LV1

[root@met root]# lvcreate --size 100M -s -nsnapshot1 /dev/Vol1/LV1 lvcreate -- WARNING: the snapshot will be automatically disabled once it gets full
lvcreate -- INFO: using default snapshot chunk size of 64 KB for "/dev/Vol1/snapshot1"
lvcreate -- doing automatic backup of "Vol1"
lvcreate -- logical volume "/dev/Vol1/snapshot1" successfully created

Quoted 1 line

And how can I estimate the sizes and counts for them ?

lvdisplay /dev/Vol1/snapsh*

Quoted 1 line

Is there any rules or principles to formalize the procedures ?

There's no tool in the LVM distro for that so far.
You can write a script (Shell, Perl, ...) around lvdisplay to create alerts when a snapshot runs out of space or extend it automatically.

Quoted 14 lines
Quoted 3 lines

A snapshot will only capture what you have in the fs at the moment you

-- snip --

Quoted 1 line

-toby

-- Armani Liao

_______________________________________________
linux-lvm mailing list
[email protected]
http://lists.sistina.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

Signature · 15 lines
Regards,
Heinz    -- The LVM Guy --

*** Software bugs are stupid.
    Nevertheless it needs not so stupid people to solve them ***

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Heinz Mauelshagen                                 Sistina Software Inc.
Senior Consultant/Developer                       Am Sonnenhang 11
                                                  56242 Marienrachdorf
                                                  Germany
[email protected]                           +49 2626 141200
                                                       FAX 924446
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-