extending a logical volume
I've read the extending logical volume section and I can't believe this. According to the doc, it would be impossible to extend a logical volume without unmounting it first.
I'm using a ext3 (with a 2.4.17 kernel) filesystem and I'd like to extend my logical volume without unmounting it first. This would be used on a production server, so I can't unmount any logical volume.
I've seen that a ext2online patch does exist, maybe this fonctionnality is still implemented in a newer kernel ?
Could you give me, if it exists, a method to extend the size without unmount the logical volume ?
Thank's a lot.
Pierrick
-- Pierrick PONS <[email protected]> on 01/21/02 19:09:31 +0100
Quoted 7 lines
I've read the extending logical volume section and I can't believe this. According to the doc, it would be impossible to extend a logical volume without unmounting it first.
I'm using a ext3 (with a 2.4.17 kernel) filesystem and I'd like to extend my logical volume without unmounting it first. This would be used on a production server, so I can't unmount any logical volume.
Quoted 7 lines
I've seen that a ext2online patch does exist, maybe this fonctionnality is still implemented in a newer kernel ?
Could you give me, if it exists, a method to extend the size without unmount the logical volume ?
Thank's a lot.
Put it another way: You can lvextend a mounted volume. There isn't any good way to extend the file system while it's mounted. Adding the cyl groups to a mounted file system would blow up several parts of the VFS layer. Since extending the LVM takes O(ms) to finish there isn't much gain in doing it mounted anyway.
The simplest way to handle it is unmounting, fsck-ing and re-mounting the thing immediately after your weekly backup, when users have to be off the system anyway [if you want to tell me that the system is too important to offline for a backup I'd strongly suggest finding a 9-story window near the console, it'll be easier to handle it yourself than have the users do it for you after a crash looses all of the data].
If the sytsem is used for real-time processing then simply switch to the backup server for 10 minutes, extend and validate the system then switch back.
Total time for, say, 100GB file system doubling in size would be 60 seconds on any reasonably fast I/O system, nearly all of which is spent extending the filesystem.
Even HP's LVM -- probably the most forgiving of all -- has to be dismounted for extendfs; lvextend can be run any time you like.
--
Steven Lembark 2930 W. Palmer
Workhorse Computing Chicago, IL 60647
+1 800 762 1582
Quoted 9 lines · --- [email protected] wrote:
-- Pierrick PONS <[email protected]> on 01/21/02 19:09:31 +0100
Quoted 1 line
I've read the extending logical volume section and
I can't believe this.
Quoted 1 line
According to the doc, it would be impossible to
extend a logical volume
um - i think i just did this...
lvextend -L +10G /dev/vg1/data
followed by
resize-reiserfs
no corruption (at least not that I've noticed)
maybe i'm misunderstanding...
brad
__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/
Quoted 9 lines · Brad Langhorst
Quoted 7 lines · --- [email protected] wrote:
-- Pierrick PONS <[email protected]> on 01/21/02 19:09:31 +0100
Quoted 1 line
I've read the extending logical volume section and
I can't believe this.
Quoted 1 line
According to the doc, it would be impossible to
extend a logical volume
Quoted 7 lines
um - i think i just did this...
lvextend -L +10G
/dev/vg1/data
followed by
resize-reiserfsno corruption (at least not that I've noticed)
I do this all the time with XFS, Reiser and even ext3. At least reiser also shrinks, I think.
Signature · 3 lines
I presented the idea of entropy informally recently as "when you put a frog in a blender, the bits that are no longer frog". -- Alan Rosentahl, Scary Devil Monastery
-- Harri Haataja <[email protected]> on 01/21/02 22:48:17 +0200
Quoted 8 lines
Quoted 5 lines
lvextend -L +10G
/dev/vg1/data
followed by
resize-reiserfsno corruption (at least not that I've noticed)
I do this all the time with XFS, Reiser and even ext3. At least reiser also shrinks, I think.
The lvextend is almost always safe, extending a mounted file system can cause real pain if it glitches at all. There are just too many ways for the system to get fried if it croaks while someone is both writing a file and the system is being updated and neither reiser nor ext3 nor xfs nor lvm at this point seem solid enough to recover gracefully from heavy duty failures at that point (at least from what I've seen going by on the mailing lists).
--
Steven Lembark 2930 W. Palmer
Workhorse Computing Chicago, IL 60647
+1 800 762 1582
[linux-lvm] Whats wrong with this picture?
--- Physical volume ---
PV Name /dev/ide/host2/bus1/target0/lun0/part4 VG Name sunset_vg PV Size 11.24 GB / NOT usable 51.50 MB [LVM: 125.00 KB] PV# 2 PV Status available Allocatable yes (but full) Cur LV 4 PE Size (KByte) 32768 Total PE 358 Free PE 0 Allocated PE 358 PV UUID 0jqg8y-LkA2-vZ1w-jHpv-cSY6-t7sh-BcmDS6
My PE size 32M yet my unusable space is > 32M
I tested this with different PE sizes and found that the unusable space reported is aways in the range >= 1PE and < 2PE
I would have expected it in the range >=0PE and <1PE
Why is this not so?
James
Re: [linux-lvm] Whats wrong with this picture?
Quoted 14 lines · James Hawtin
--- Physical volume ---
PV Name /dev/ide/host2/bus1/target0/lun0/part4 VG Name sunset_vg PV Size 11.24 GB / NOT usable 51.50 MB [LVM: 125.00 KB] PV# 2 PV Status available Allocatable yes (but full) Cur LV 4 PE Size (KByte) 32768 Total PE 358 Free PE 0 Allocated PE 358 PV UUID 0jqg8y-LkA2-vZ1w-jHpv-cSY6-t7sh-BcmDS6
Quoted 8 lines
My PE size 32M yet my unusable space is > 32M
I tested this with different PE sizes and found that the unusable space reported is aways in the range >= 1PE and < 2PE
I would have expected it in the range >=0PE and <1PE
Why is this not so?
Because the Sistina folks changed it in a recent tools release to have a _full_ empty PE available for future expansion. IMHO that is a bit of a waste, especially if you have large PEs. I would much rather that it reserve some minimum amount of free space (e.g. 4MB or whatever) and then it doesn't need to waste so much.
Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/
Re: [linux-lvm] Whats wrong with this picture?
Quoted 7 lines · Andreas Dilger
Because the Sistina folks changed it in a recent tools release to have a _full_ empty PE available for future expansion. IMHO that is a bit of a waste, especially if you have large PEs. I would much rather that it reserve some minimum amount of free space (e.g. 4MB or whatever) and then it doesn't need to waste so much.
Cheers, Andreas
Thats ok I guess, I kind of agree with you, They should have reserved a finite amount of space. After all someone might have a pe of 512k which could prove to be not enough and land them in trouble. If they have reserved one PE the output of pvdisplay should say (1 PE reserved) cos its not unusable, they have reserved it!
James
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
I can't believe this.
Quoted 1 line
According to the doc, it would be impossible to
extend a logical volume
um - i think i just did this...
Quoted 10 lines
Quoted 5 lines
lvextend -L +10G
/dev/vg1/data
followed by
resize-reiserfsno corruption (at least not that I've noticed)
I do this all the time with XFS, Reiser and even ext3. At least reiser also shrinks, I think.
Sorry to sound stupid, but using what tools? resize-reiserfs for Reiser, but what to use for ext3?
--Mitch
Quoted 10 lines · On Mon, Jan 21, 2002 at 03:29:45PM -0600, [email protected] wrote:
Quoted 10 lines
Quoted 10 lines
Quoted 3 lines
I can't believe this.
Quoted 1 line
According to the doc, it would be impossible to
extend a logical volume
um - i think i just did this...
lvextend -L +10G
/dev/vg1/data
followed by
resize-reiserfs
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
no corruption (at least not that I've noticed)
I do this all the time with XFS, Reiser and even ext3. At least reiser also shrinks, I think.
Sorry to sound stupid, but using what tools? resize-reiserfs for Reiser, but what to use for ext3?
Come to think of it, that may be false. I don't have certain memory of extn resizing. Sorry. Might try, though. Then it would be resize2fs or something like that.
resize_reiserfs and xfs_growfs I'm quite certain I have used (how else have I grown those part^Wvolumes I have?
Signature · 4 lines
Lusers annoy you; Backups are crap; | -- David P. Murphy Morons employ you; And samba won't map. | in the S.D.M. Printers need cable; Installs restart; | (parodying Dorothy Servers aren't stable; You might as well LART. | Parker's "Resume")
Quoted 12 lines · Harri Haataja
Quoted 11 lines · Brad Langhorst
Quoted 7 lines · --- [email protected] wrote:
-- Pierrick PONS <[email protected]> on 01/21/02 19:09:31 +0100
Quoted 1 line
I've read the extending logical volume section and
I can't believe this.
Quoted 1 line
According to the doc, it would be impossible to
extend a logical volume
um - i think i just did this...
Quoted 9 lines
Quoted 5 lines
lvextend -L +10G
/dev/vg1/data
followed by
resize-reiserfsno corruption (at least not that I've noticed)
I do this all the time with XFS, Reiser and even ext3. At least reiser also shrinks, I think.
I had a resize reiserfs go really bad on 2.4.9 + patches, noticed it after a couple of days. Personally i don't trust it, but thats just probably me, I aways try to rebuild filesystems.
James
-- Brad Langhorst <[email protected]> on 01/21/02 12:13:14 -0800
Quoted 14 lines
Quoted 9 lines · --- [email protected] wrote:
-- Pierrick PONS <[email protected]> on 01/21/02 19:09:31 +0100
Quoted 1 line
I've read the extending logical volume section and
I can't believe this.
Quoted 1 line
According to the doc, it would be impossible to
extend a logical volume
um - i think i just did this...
Quoted 7 lines
lvextend -L +10G
/dev/vg1/data
followed by
resize-reiserfsno corruption (at least not that I've noticed)
maybe i'm misunderstanding...
There has been a bit if mail on the reiser list about corruption from expanding in-use file systems. Frankly, for the number of [milli?]seconds it takes to do the expansion offline it seems easier to do it unmounted.
I'm also not sure that ext3 supports online extension (thought the original post was about ext3), and ext2 or msdos file systems certianly don't.
You also don't know if anyone is using the volume for a networked file system, which may screw things up if the caching is too aggressive.
--
Steven Lembark 2930 W. Palmer
Workhorse Computing Chicago, IL 60647
+1 800 762 1582
Quoted 3 lines · On Jan 21, 2002 14:53 -0600, [email protected] wrote:
I'm also not sure that ext3 supports online extension (thought the original post was about ext3), and ext2 or msdos file systems certianly don't.
Actually, both _could_ support online resizing if I ever got my butt in gear. As it is, only ext2 supports it, but ext3 has untested code to do it for 2.2 kernels.
Quoted 3 lines
You also don't know if anyone is using the volume for a networked file system, which may screw things up if the caching is too aggressive.
No, never seen a problem with this. Nobody shrinks filesystems online, so at worst you might not fully utilize the newly allocated space. In the end, however, applications rarely check the total free space in a filesystem, but rather just write until the write command returns ENOSPC.
Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/
Quoted 18 lines
Quoted 9 lines · --- [email protected] wrote:
-- Pierrick PONS <[email protected]> on 01/21/02 19:09:31 +0100
Quoted 1 line
I've read the extending logical volume section and
I can't believe this.
Quoted 1 line
According to the doc, it would be impossible to
extend a logical volume
um - i think i just did this...
lvextend -L +10G
/dev/vg1/data
followed by
resize-reiserfs
Quoted 7 lines
no corruption (at least not that I've noticed)
maybe i'm misunderstanding...
brad
I think it's because you're under reiserfs.
I have chosen ext3 file system instead of reiserfs because in case of current failure some data may have problems if there are data accesses on. That's what I was said.
Pierrick
Quoted 4 lines
I have chosen ext3 file system instead of reiserfs because in case of current failure some data may have problems if there are data accesses on. That's what I was said.
I'd suggest checking carefully before attempting to extend a mounted ext3 filesystem. Even if the doc's claim it's supported you can get into nasty logic races caused by not wanting to buffer either the journal or cyl groups as they are written. Theoretically it's all meta-data, but in reality it takes time to write and failures during that process can leave buffered cyl group information in core if the system croaks.
--
Steven Lembark 2930 W. Palmer
Workhorse Computing Chicago, IL 60647
+1 800 762 1582
Quoted 8 lines · On Jan 21, 2002 12:40 -0600, [email protected] wrote:
The simplest way to handle it is unmounting, fsck-ing and re-mounting the thing immediately after your weekly backup, when users have to be off the system anyway [if you want to tell me that the system is too important to offline for a backup I'd strongly suggest finding a 9-story window near the console, it'll be easier to handle it yourself than have the users do it for you after a crash looses all of the data].
I agree about the backups. Most people don't think about backups until it is too late. I disagree about only doing resizing at some late hour in the night though. Many times there are unexpected demands on storage, and the sysadmin doesn't have control over the cause, but gets blamed for the effect (i.e. running out of space). Hence, online fs resizing is a critical operation for an enterprise system.
Quoted 3 lines
Even HP's LVM -- probably the most forgiving of all -- has to be dismounted for extendfs; lvextend can be run any time you like.
??? That was only with the old HP LVM filesystem (UFS I think). If you formatted with the new filesystem (can't remember the name), you could do online resizing. AIX has had online resizing forever, and so has XFS. None of these allow even offline shrinking though, which ext2/ext3 does.
Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/
Quoted 18 lines · Andreas Dilger
Quoted 8 lines · On Jan 21, 2002 12:40 -0600, [email protected] wrote:
The simplest way to handle it is unmounting, fsck-ing and re-mounting the thing immediately after your weekly backup, when users have to be off the system anyway [if you want to tell me that the system is too important to offline for a backup I'd strongly suggest finding a 9-story window near the console, it'll be easier to handle it yourself than have the users do it for you after a crash looses all of the data].
I agree about the backups. Most people don't think about backups until it is too late. I disagree about only doing resizing at some late hour in the night though. Many times there are unexpected demands on storage, and the sysadmin doesn't have control over the cause, but gets blamed for the effect (i.e. running out of space). Hence, online fs resizing is a critical operation for an enterprise system.
Quoted 6 lines
Quoted 3 lines
Even HP's LVM -- probably the most forgiving of all -- has to be dismounted for extendfs; lvextend can be run any time you like.
??? That was only with the old HP LVM filesystem (UFS I think). If you formatted with the new filesystem (can't remember the name),
Andreas,
they got a Veritas license for vxfs and that could be online grown but you couldn't shrink it without purchasing an additional license.
Quoted 16 lines
you could do online resizing. AIX has had online resizing forever, and so has XFS. None of these allow even offline shrinking though, which ext2/ext3 does.
Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/_______________________________________________
linux-lvm mailing list
[email protected]
http://lists.sistina.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://www.sistina.com/lvm/Pages/howto.html
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
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-Quoted 3 lines · Pierrick PONS
I've read the extending logical volume section and I can't believe this. According to the doc, it would be impossible to extend a logical volume without unmounting it first.
LV resize != fs resize.
Quoted 3 lines
I'm using a ext3 (with a 2.4.17 kernel) filesystem and I'd like to extend my logical volume without unmounting it first. This would be used on a production server, so I can't unmount any logical volume.
Currently, you cannot online resize ext3, but that is only because the code which I wrote to do this for 2.2 was never released, and it has not been ported to 2.4/2.5 yet.
Quoted 2 lines
I've seen that a ext2online patch does exist, maybe this fonctionnality is still implemented in a newer kernel ?
No, still only available as a patch. The ext2 online resizing patch is very solid. The ext3 code is, by necessity, a total rewrite of the code to work with ext3 journaling, but the fundamental concepts are the same.
Quoted 2 lines
Could you give me, if it exists, a method to extend the size without unmount the logical volume ?
Use ext2 + ext2online patch (not great, because you probably crash more often than you need to resize), use ext3 but no online resizing (offline resizing works just fine with ext2resize), or work on porting the ext3 resizing code to 2.4.
Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/
Quoted 7 lines · Pierrick PONS
Quoted 3 lines
I've read the extending logical volume section and I can't believe this. According to the doc, it would be impossible to extend a logical volume without unmounting it first.
LV resize != fs resize.
Yes you're right. It's possible to extend LV online but it's not the same for file systems.
Quoted 8 lines
Quoted 3 lines
I'm using a ext3 (with a 2.4.17 kernel) filesystem and I'd like to extend my logical volume without unmounting it first. This would be used on a production server, so I can't unmount any logical volume.
Currently, you cannot online resize ext3, but that is only because the code which I wrote to do this for 2.2 was never released, and it has not been ported to 2.4/2.5 yet.
It would be a really goud feature .... :-)
Quoted 7 lines
Quoted 2 lines
I've seen that a ext2online patch does exist, maybe this fonctionnality is still implemented in a newer kernel ?
No, still only available as a patch. The ext2 online resizing patch is very solid. The ext3 code is, by necessity, a total rewrite of the code to work with ext3 journaling, but the fundamental concepts are the same.
Quoted 8 lines
Quoted 2 lines
Could you give me, if it exists, a method to extend the size without unmount the logical volume ?
Use ext2 + ext2online patch (not great, because you probably crash more often than you need to resize), use ext3 but no online resizing (offline resizing works just fine with ext2resize), or work on porting the ext3 resizing code to 2.4.
hmmm, I'm not good enough to code this :-(
So you'd rather use ext3 with offline resizing.
That is a real problem because LVM would be used on a 24/24 available data server with nfs accesses . Datas should be get as often as the other servers need to.
Maybe I should have a look at reiserfs + resize-reiserfs instead of using ext3 . What a pitty, ext3 is easy to install and is jouralised.
Quoted 8 lines
Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/
Thank you Andreas .
Pierrick
I really which the filesystem people would add support for lvm, partitulary when "shrinking". At the moment you have to strink then FS, then strink the LVM, it scares the hell out of me that I will get the sizes wrong and badness would happen, ie part of the resized fs becomes unaddressable. (all it needs is someone to take a different definition of MB for example).
James
Quoted 6 lines · James Hawtin
I really which the filesystem people would add support for lvm, partitulary when "shrinking". At the moment you have to strink then FS, then strink the LVM, it scares the hell out of me that I will get the sizes wrong and badness would happen, ie part of the resized fs becomes unaddressable. (all it needs is someone to take a different definition of MB for example).
Please see "e2fsadm". It will resize the LV and the ext2 fs properly. Note also, that if it happens that you resize the LV smaller than the fs, it is possible to just resize the LV larger again to get the end of the fs back. In some cases, LVM will not assign the same PE to the LV, so you will need to restore the LVM config from backup.
Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/
To conclude on this subject, here is what I've done.
I've extended my ext3 partition offline and not online.
These commands are easy but maybe they will help some persons. They would have helped me ...
lvextend -L+200 /dev/testlvm/testlv
lvscan
umount /dev/testlvm/testlv
e2fsck -f /dev/testlvm/testlv
resize2fs -d -p /dev/testlvm/testlv
mount /dev/testlvm/testlv /mnt/lvm
df -k
Hope this will help some user, if it's not the case sorry to put a so newbie post.
Regards.
Signature · 3 lines
Pierrick PONS CVF Bordeaux mail: [email protected]
Quoted 6 lines · Pierrick PONS
To conclude on this subject, here is what I've done. I've extended my ext3 partition offline and not online. These commands are easy but maybe they will help some persons. They would have helped me ...
Quoted 8 lines
lvextend -L+200
/dev/testlvm/testlv
lvscan
umount/dev/testlvm/testlve2fsck -f
/dev/testlvm/testlv
resize2fs -d -p/dev/testlvm/testlv
mount/dev/testlvm/testlv/mnt/lvm
df -k
This is all done for you with the "e2fsadm" command included with the LVM user tools (including e2fsck):
umount /dev/testlvm/testlv
e2fsadm -L+200 /dev/testlvm/testlv
mount /dev/testlvm/testlv
Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/