All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-lvm] [Q] LVM snapshot volume extendable?
@ 2003-01-12  6:11 Sean Oh
  2003-01-12  7:09 ` Alasdair G Kergon
  2003-01-12  7:09 ` jon+lvm
  0 siblings, 2 replies; 6+ messages in thread
From: Sean Oh @ 2003-01-12  6:11 UTC (permalink / raw)
  To: linux-lvm

Hi

I am using LVM 1.0.6, kernel 2.4.20 and XFS (from linux-2.4-xfs CVS).

My question is that is the snapshot volume extendable?

My environment is as follows:

/dev/vg01/lv01 ---> XFS, 2G
/dev/vg01/lv01_snap --> 256M, snapshot for /dev/vg01/lv01, mounted under
/snap with ro,nouuid,usrquota,grpquota,noatime

Now I have wrote a small shell scripts that if lv01_snap is more than 50%
full, automatically increase the lv01_snap. But it seems to me that it does
not work well..

What I did in the shell scripts are 'lvextend -L+256M /dev/vg01/lv01_snap'
with/without 'xfs_growfs /snap'.

After umounting the /snap and trying to remount /snap, it complaints as
below

XFS: recovery required required on read-only device
XFS: write access unavailabe, cannot proceed
XFS: log mount/recovery failed
XFS: log mount failed
mount: wrong fs type, bad option, bad superblock on /dev/vg01/lv01,
       or too many mounted file systems
       (aren't you trying to mount an extended partition,
       instead of some logical partition inside?)

BTW, extending the original lv01 works fine with lvextend and xfs_growfs.

Could someone please help?

Thanks in advance

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [linux-lvm] [Q] LVM snapshot volume extendable?
  2003-01-12  6:11 [linux-lvm] [Q] LVM snapshot volume extendable? Sean Oh
@ 2003-01-12  7:09 ` Alasdair G Kergon
  2003-01-12  7:09 ` jon+lvm
  1 sibling, 0 replies; 6+ messages in thread
From: Alasdair G Kergon @ 2003-01-12  7:09 UTC (permalink / raw)
  To: linux-lvm

On Sun, Jan 12, 2003 at 09:12:07PM +0900, Sean Oh wrote:
> What I did in the shell scripts are 'lvextend -L+256M /dev/vg01/lv01_snap'
> with/without 'xfs_growfs /snap'.
The snapshot volume does not hold a filesystem - it is just a storage
area for deltas that enable the system to reconstruct a filesystem. 
So you don't need to run xfs utilities on it to make more space.  [But
of course some people might want to run them on writeable snapshots 
(needs kernel patch) for testing the effect of utilities.]

Alasdair
-- 
agk@uk.sistina.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [linux-lvm] [Q] LVM snapshot volume extendable?
  2003-01-12  6:11 [linux-lvm] [Q] LVM snapshot volume extendable? Sean Oh
  2003-01-12  7:09 ` Alasdair G Kergon
@ 2003-01-12  7:09 ` jon+lvm
  2003-01-12  7:29   ` Sean Oh
  1 sibling, 1 reply; 6+ messages in thread
From: jon+lvm @ 2003-01-12  7:09 UTC (permalink / raw)
  To: linux-lvm

On Sun, Jan 12, 2003 at 09:12:07PM +0900, Sean Oh wrote:
> Hi
> 
> I am using LVM 1.0.6, kernel 2.4.20 and XFS (from linux-2.4-xfs CVS).
> 
> My question is that is the snapshot volume extendable?

yes, just use lvextend.


> My environment is as follows:
> 
> /dev/vg01/lv01 ---> XFS, 2G
> /dev/vg01/lv01_snap --> 256M, snapshot for /dev/vg01/lv01, mounted under
> /snap with ro,nouuid,usrquota,grpquota,noatime
> 
> Now I have wrote a small shell scripts that if lv01_snap is more than 50%
> full, automatically increase the lv01_snap. But it seems to me that it does
> not work well..

I wrote one too, but rather than 50% used, i used XX MB free space.

 
> What I did in the shell scripts are 'lvextend -L+256M /dev/vg01/lv01_snap'
> with/without 'xfs_growfs /snap'.

you dont need to grow the filesystem on the snapshot.

 
> After umounting the /snap and trying to remount /snap, it complaints as
> below

you dont need to unmount it



A LVM snapshot works by allocating a new "PE table". This means.
(# is allocated, - is not, and | is the end)

LV: |-#################--##---#####-|
snapshot: |---|

so, you change something in the LV

LV: |-#############+###--##---#####-|
snapshot: |#--|

Only the block that is actualy changed is moved to the snapshot.
If you need alot of changes your snapshot should be big, if you dont
change alot, you can use a much smaller snapshot.





JonB

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [linux-lvm] [Q] LVM snapshot volume extendable?
  2003-01-12  7:09 ` jon+lvm
@ 2003-01-12  7:29   ` Sean Oh
  2003-01-12 11:16     ` jon+lvm
  0 siblings, 1 reply; 6+ messages in thread
From: Sean Oh @ 2003-01-12  7:29 UTC (permalink / raw)
  To: linux-lvm

Thanks for the replay.
Well, just doing 'lvextend' does not work for me here.
Is there any other thing that I need to look for?

This is what I do for testing the extending the snapshot volume

------------------
[root@storageone root]# df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda1              5903668   1476712   4426956  26% /
/dev/vg01/lv01       567079312      2200 567077112   1% /vg01/lv01
/dev/vg01/lv01_snap0112_2159
                     567079312      2200 567077112   1%
/snap/lv01_snap0112_2159

[root@storageone root]# lvdisplay /dev/vg01/lv01_snap0112_2159
--- Logical volume ---
LV Name                /dev/vg01/lv01_snap0112_2159
VG Name                vg01
LV Write Access        read only
LV snapshot status     active destination for /dev/vg01/lv01
LV Status              available
LV #                   2
# open                 1
LV Size                540.88 GB
Current LE             8654
Allocated LE           8654
snapshot chunk size    64 KB
Allocated to snapshot  0.00% [0/127.88 MB]
Allocated to COW-table 128 KB
Allocation             next free
Read ahead sectors     1024
Block device           58:1

[root@storageone root]# dd if=/dev/zero of=/vg01/lv01/SOMEFILE bs=1024k
count=64
64+0 records in
64+0 records out

[root@storageone root]# sync

[root@storageone root]# lvdisplay /dev/vg01/lv01_snap0112_2159
--- Logical volume ---
LV Name                /dev/vg01/lv01_snap0112_2159
VG Name                vg01
LV Write Access        read only
LV snapshot status     active destination for /dev/vg01/lv01
LV Status              available
LV #                   2
# open                 1
LV Size                540.88 GB
Current LE             8654
Allocated LE           8654
snapshot chunk size    64 KB
Allocated to snapshot  50.15% [64.12 MB/127.88 MB]
Allocated to COW-table 128 KB
Allocation             next free
Read ahead sectors     1024
Block device           58:1

[root@storageone root]# lvextend -L+127M /dev/vg01/lv01_snap0112_2159
lvextend -- rounding relative size up to physical extent boundary
lvextend -- extending logical volume "/dev/vg01/lv01_snap0112_2159" to 256
MB
lvextend -- doing automatic backup of volume group "vg01"
lvextend -- logical volume "/dev/vg01/lv01_snap0112_2159" successfully
extended

[root@storageone root]# df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda1              5903668   1476624   4427044  26% /
/dev/vg01/lv01       567079312     67736 567011576   1% /vg01/lv01
/dev/vg01/lv01_snap0112_2159
                     567079312      2200 567077112   1%
/snap/lv01_snap0112_2159

[root@storageone root]# umount /snap/lv01_snap0112_2159/

[root@storageone root]# mount /snap/lv01_snap0112_2159/
mount: wrong fs type, bad option, bad superblock on
/dev/vg01/lv01_snap0112_2159,
       or too many mounted file systems

[root@storageone root]# cat /etc/fstab
/dev/sda1          /                        reiserfs defaults         0  0
/dev/sda2          swap                     swap     defaults         0  0
/dev/vg01/lv01     /vg01/lv01               xfs
defaults,usrquota,grpquota,noatime 0  0
/dev/vg01/lv01_snap0112_2159 /snap/lv01_snap0112_2159 xfs
ro,nouuid,usrquota,grpquota,noatime 0  0
none               /proc                    proc     defaults         0  0
none               /dev/pts                 devpts   mode=622         0  0
-------------

The reasone that I did 'unmount' is to simulate the 'rebooting'. Because
after rebooting, I can not mount the extended snapshot anymore.

Thanks in advance



----- Original Message -----
From: <jon+lvm@silicide.dk>
To: <linux-lvm@sistina.com>
Sent: Sunday, January 12, 2003 10:09 PM
Subject: Re: [linux-lvm] [Q] LVM snapshot volume extendable?


> On Sun, Jan 12, 2003 at 09:12:07PM +0900, Sean Oh wrote:
> > Hi
> >
> > I am using LVM 1.0.6, kernel 2.4.20 and XFS (from linux-2.4-xfs CVS).
> >
> > My question is that is the snapshot volume extendable?
>
> yes, just use lvextend.
>
>
> > My environment is as follows:
> >
> > /dev/vg01/lv01 ---> XFS, 2G
> > /dev/vg01/lv01_snap --> 256M, snapshot for /dev/vg01/lv01, mounted under
> > /snap with ro,nouuid,usrquota,grpquota,noatime
> >
> > Now I have wrote a small shell scripts that if lv01_snap is more than
50%
> > full, automatically increase the lv01_snap. But it seems to me that it
does
> > not work well..
>
> I wrote one too, but rather than 50% used, i used XX MB free space.
>
>
> > What I did in the shell scripts are 'lvextend -L+256M
/dev/vg01/lv01_snap'
> > with/without 'xfs_growfs /snap'.
>
> you dont need to grow the filesystem on the snapshot.
>
>
> > After umounting the /snap and trying to remount /snap, it complaints as
> > below
>
> you dont need to unmount it
>
>
>
> A LVM snapshot works by allocating a new "PE table". This means.
> (# is allocated, - is not, and | is the end)
>
> LV: |-#################--##---#####-|
> snapshot: |---|
>
> so, you change something in the LV
>
> LV: |-#############+###--##---#####-|
> snapshot: |#--|
>
> Only the block that is actualy changed is moved to the snapshot.
> If you need alot of changes your snapshot should be big, if you dont
> change alot, you can use a much smaller snapshot.
>
>
>
>
>
> JonB
>
> _______________________________________________
> 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/
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [linux-lvm] [Q] LVM snapshot volume extendable?
  2003-01-12  7:29   ` Sean Oh
@ 2003-01-12 11:16     ` jon+lvm
  2003-01-12 22:37       ` Sean Oh
  0 siblings, 1 reply; 6+ messages in thread
From: jon+lvm @ 2003-01-12 11:16 UTC (permalink / raw)
  To: linux-lvm

On Sun, Jan 12, 2003 at 10:29:54PM +0900, Sean Oh wrote:

[cut]

Would you be so kind to reply inbetween the text, as i did, or below (if
it's not that much text) 
and while you are at it, cut the unneeeded lines out. You left all my
text intact, which was 70 useless lines.




JonB

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [linux-lvm] [Q] LVM snapshot volume extendable?
  2003-01-12 11:16     ` jon+lvm
@ 2003-01-12 22:37       ` Sean Oh
  0 siblings, 0 replies; 6+ messages in thread
From: Sean Oh @ 2003-01-12 22:37 UTC (permalink / raw)
  To: jon+lvm; +Cc: linux-lvm

Sorry about the long text.

Could you please tell me what kind of LVM version, kernel version, File
System you are using for the extendabe snapshot?

Do I need to apply writeable snapshot patch to have snapshot extendable? If
so, Where can I get the patch for kernel 2.4.20?

I have applied VFS-lock patch, lvm-0.8final-2.4.0.patch that comes with
1.0.6 distribution.

Thanks in advance

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-01-12 22:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-12  6:11 [linux-lvm] [Q] LVM snapshot volume extendable? Sean Oh
2003-01-12  7:09 ` Alasdair G Kergon
2003-01-12  7:09 ` jon+lvm
2003-01-12  7:29   ` Sean Oh
2003-01-12 11:16     ` jon+lvm
2003-01-12 22:37       ` Sean Oh

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.