LVM questions & problems.
I'm practicing doing some LVM commands, and am coming up with some problems -
Most disconcerting is that when I try to create a directory in the LV, I get the following error - (this does not happen all the time, but almost all the time 99%) -
[root@localhost Tmp]# mkdir test1
mkdir: cannot create directory `test1': Input/output error
Creating normal files on the LV is not a problem.
Also, the figures in the following outputs don't seem to make sense to me -
287Mb of space taken on my LV lvol1 (shown using du -h).
LV lvol1 - shows all 75 logical extends taken, I'm assuming filling up the 300Mb LV size.
LV Size 300 MB Current LE 75 Allocated LE 75
PV shows too many physical extends used for the proportion of disk space used. -
Total PE 76
Free PE 1
PVdisplay shows too many physical extents used again
Total PE 76 Free PE 1 Allocated PE 75
----------------------------------------
LVM command outputs
-------------------
[root@localhost Tmp]# lvdisplay /dev/vg/lvol1
lvdisplay
--- Logical volume ---
LV Name /dev/vg/lvol1 VG Name vg LV Write Access read/write LV Status available LV # 1 # open 1 LV Size 300 MB Current LE 75 Allocated LE 75 Allocation next free Read ahead sectors 120 Block device 58:0
[root@localhost Tmp]# pvdisplay /dev/sdb1
pvdisplay
--- Physical volume ---
PV Name /dev/sdb1 VG Name vg PV Size 305.89 MB / NOT usable 1.89 MB [LVM: 121 KB] PV# 1 PV Status available Allocatable yes Cur LV 1 PE Size (KByte) 4096 Total PE 76 Free PE 1 Allocated PE 75 PV UUID wm3nGp-pEem-0byC-3JOs-OFs4-3kv2-EkPxaK
[root@localhost Tmp]# vgdisplay
vgdisplay
--- Volume group ---
VG Name vg VG Access read/write VG Status available/resizable VG # 0 MAX LV 256 Cur LV 1 Open LV 1 MAX LV Size 255.99 GB Max PV 256 Cur PV 1 Act PV 1 VG Size 304 MB PE Size 4 MB Total PE 76 Alloc PE / Size 75 / 300 MB Free PE / Size 1 / 4 MB VG UUID 0ZyZNT-53L9-tAFJ-GCa4-1Zr5-nZli-IFIbIP
Signature · 2 lines
regs rupert
Quoted 9 lines · Rupert Heesom
I'm practicing doing some LVM commands, and am coming up with some problems -
Most disconcerting is that when I try to create a directory in the LV, I get the following error - (this does not happen all the time, but almost all the time 99%) -
[root@localhost Tmp]# mkdir test1
mkdir: cannot create directory `test1': Input/output error
You didn't metion, if the filesystem is still in a sane state.
Did you check your syslog for "accessess beyond the end of the device" which indicate fs related problems?
If so: did you run fsck to fix those and did you retest?
Quoted 7 lines
Creating normal files on the LV is not a problem.
Also, the figures in the following outputs don't seem to make sense to me -
287Mb of space taken on my LV lvol1 (shown using du -h).
du is a filesystem tool which tells you how much space is used from the fs perspective.
The LV tools provide information from the underlying block device being exposed by the LVM to the filesytem or other users (like databases etc.).
Quoted 7 lines
LV lvol1 - shows all 75 logical extends taken, I'm assuming filling up the 300Mb LV size.
LV Size 300 MB Current LE 75 Allocated LE 75
O.k.
That shows, that you have a 300M logical volume, which you said above.
vgdisplay on your volume group gives you (beside other information) the size of the physical extents (PEs) which is 4M by default.
You can change that in order to address bigger configurations with "vgcreate -s". Please see "man vgcreate" for further details.
Quoted 7 lines
PV shows too many physical extends used for the proportion of disk space used. -
Total PE 76
Free PE 1
That's ok because you allocated 75PEs which are 300M based on 4M PE size.
Quoted 6 lines
PVdisplay shows too many physical extents used again
Total PE 76 Free PE 1 Allocated PE 75
Same as above.
Please have a look at the LVM howto at www.sistina.com/lvm for further hints on LVM usage.
Regards,
Heinz -- The LVM Guy --
Quoted 53 lines
----------------------------------------
LVM command outputs
-------------------[root@localhost Tmp]# lvdisplay
/dev/vg/lvol1
lvdisplay
--- Logical volume ---LV Name /dev/vg/lvol1 VG Name vg LV Write Access read/write LV Status available LV # 1 # open 1 LV Size 300 MB Current LE 75 Allocated LE 75 Allocation next free Read ahead sectors 120 Block device 58:0[root@localhost Tmp]# pvdisplay
/dev/sdb1
pvdisplay
--- Physical volume ---PV Name /dev/sdb1 VG Name vg PV Size 305.89 MB / NOT usable 1.89 MB [LVM: 121 KB] PV# 1 PV Status available Allocatable yes Cur LV 1 PE Size (KByte) 4096 Total PE 76 Free PE 1 Allocated PE 75 PV UUID wm3nGp-pEem-0byC-3JOs-OFs4-3kv2-EkPxaK[root@localhost Tmp]# vgdisplay
vgdisplay
--- Volume group ---VG Name vg VG Access read/write VG Status available/resizable VG # 0 MAX LV 256 Cur LV 1 Open LV 1 MAX LV Size 255.99 GB Max PV 256
Quoted 18 lines
Cur PV 1 Act PV 1 VG Size 304 MB PE Size 4 MB Total PE 76 Alloc PE / Size 75 / 300 MB Free PE / Size 1 / 4 MB VG UUID 0ZyZNT-53L9-tAFJ-GCa4-1Zr5-nZli-IFIbIPSignature · 7 lines
regs rupert _______________________________________________ linux-lvm mailing list [email protected] http://lists.sistina.com/mailman/listinfo/linux-lvm
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Heinz Mauelshagen Sistina Software Inc.
Senior Consultant/Developer Am Sonnenhang 11
56242 Marienrachdorf Germany
[email protected] +49 2626 141200
FAX 924446
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Quoted 8 lines · Heinz J. Mauelshagen
Quoted 7 lines · Rupert Heesom
I'm practicing doing some LVM commands, and am coming up with some problems -
Most disconcerting is that when I try to create a directory in the LV, I get the following error - (this does not happen all the time, but almost all the time 99%) -
Quoted 7 lines
Quoted 2 lines
[root@localhost Tmp]# mkdir test1
mkdir: cannot create directory `test1': Input/output errorYou didn't metion, if the filesystem is still in a sane state.
Did you check your syslog for "accessess beyond the end of the device" which indicate fs related problems?
Well, looking at my syslog after mounting my lvol, I saw the following msg -
"May 7 11:51:26 localhost kernel: EXT2-fs warning: mounting fs with errors, running e2fsck is recommended"
I also saw previous errors which you asked about (lots of them) -
"itmap: Cannot read inode bitmap - block_group = 3, inode_bitmap = 98307
May 6 14:44:13 localhost kernel: attempt to access beyond end of
device...."
I have realised what my base problem is.... I have reduced the LV size, but not reduced the Ext2 filesystem. For some reason I thought that resizing the LV was sufficient. Looking further at the HOWTO, and other web docs has enlightened me further.
It seems I will try to learn how to use teh e2fsadm util. BTW one of the utils seems to be commercial from Powerquest. I have the v4 of Partition Magic already. I know it resizes ext2 filesystems, but as far as I know needs to be run from within windows (it's been a long time since I've used it last). Are the utils such as e2fsadm sufficient / good enough without the commercial PM util?
Signature · 2 lines
regs rupert
Quoted 25 lines · Rupert Heesom
Quoted 8 lines · Heinz J. Mauelshagen
Quoted 7 lines · Rupert Heesom
I'm practicing doing some LVM commands, and am coming up with some problems -
Most disconcerting is that when I try to create a directory in the LV, I get the following error - (this does not happen all the time, but almost all the time 99%) -
Quoted 7 lines
Quoted 2 lines
[root@localhost Tmp]# mkdir test1
mkdir: cannot create directory `test1': Input/output errorYou didn't metion, if the filesystem is still in a sane state.
Did you check your syslog for "accessess beyond the end of the device" which indicate fs related problems?
Well, looking at my syslog after mounting my lvol, I saw the following msg -
"May 7 11:51:26 localhost kernel: EXT2-fs warning: mounting fs with errors, running e2fsck is recommended"
I also saw previous errors which you asked about (lots of them) -
Quoted 7 lines
"itmap: Cannot read inode bitmap -
block_group= 3,inode_bitmap= 98307May 6 14:44:13 localhost kernel: attempt to access beyond end ofdevice...."
I have realised what my base problem is.... I have reduced the LV size, but not reduced the Ext2 filesystem. For some reason I thought that resizing the LV was sufficient.
It likely will be at some point in time in the future. Triggering the fs resize when a LN gets resized is a TODO item :-)
Quoted 9 lines
Looking further at the HOWTO, and other
web docs has enlightened me further.It seems I will try to learn how to use teh e2fsadm util. BTW one of the utils seems to be commercial from Powerquest. I have the v4 of Partition Magic already. I know it resizes ext2 filesystems, but as far as I know needs to be run from within windows (it's been a long time since I've used it last). Are the utils such as e2fsadm sufficient / good enough without the commercial PM util?
You need to get the resize2fs tool (by Ted Ts'o and Powerquest) in order to run e2fsadm.
e2fsadm basically is a wrapper which runs either
e2fsck;lvextend;resize2fs
or
e2fsck;resize2fs;lvreduce
resize2fs might already be contained in your distribution.
If not so, use for eg. ftpsearch.lycos.com to figure piles of spaces where to get it.
Quoted 9 lines
Signature · 8 lines
-- regs rupert _______________________________________________ linux-lvm mailing list [email protected] http://lists.sistina.com/mailman/listinfo/linux-lvm
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 8 lines · Heinz
Quoted 6 lines · Rupert Heesom
It seems I will try to learn how to use teh e2fsadm util. BTW one of the utils seems to be commercial from Powerquest. I have the v4 of Partition Magic already. I know it resizes ext2 filesystems, but as far as I know needs to be run from within windows (it's been a long time since I've used it last). Are the utils such as e2fsadm sufficient / good enough without the commercial PM util?
Quoted 4 lines
You need to get the resize2fs tool (by Ted Ts'o and Powerquest) in order to run e2fsadm.
resize2fs might already be contained in your distribution.
If you have e2fsprogs 1.19 then it contains resize2fs. The deal Ted had with Powerquest is that resize2fs would become GPL after 2 years or so.
The e2fsadm program can use ext2resize (http://ext2resize.sourceforge.net)
instead of resize2fs. If you patch your kernel with the ext2online patch, then you can even use e2fsadm to grow the LV and ext2 filesystem without unmounting it.
Cheers, Andreas
Signature · 3 lines
Andreas Dilger \ "If a man ate a pound of pasta and a pound of antipasto,
\ would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/ -- Dogbert