[linux-lvm] Vol management problems over loopback mounted files

Heinz J . Mauelshagen mauelshagen at sistina.com
Fri May 16 06:09:02 UTC 2003


On Wed, May 14, 2003 at 11:06:39AM +0100, Neil, Mark wrote:
> Dear All,
> 
> I am trying to set up a volume managed file system over ordinary files using
> the loopback devices.  However whatever I try seems to work until I try and
> actually use any logical volumes as file systems.  Otherwise the volume
> management system is completely happy with what I have done according to the
> various display utilities 
> 
> What am I doing wrong?  

Likely the LVM version shipped with RedHat (1.0.3 ?).
Try 1.0.7. Works fine with loop devices here.

Regards,
Heinz    -- The LVM Guy --

> 
> As a simple example of this problem see below (all on a Redhat 9.0 system,
> Kernel 2.4.20-9 - also fails in the same way on a Redhat 8 system with a
> 2.4.18 kernel)
> 
> [root at dex root]# dd if=/dev/zero of=/tmp/diskfile0 bs=512M count=1
> 1+0 records in
> 1+0 records out
> [root at dex root]# dd if=/dev/zero of=/tmp/diskfile1 bs=512M count=1
> 1+0 records in
> 1+0 records out
> [root at dex root]# dd if=/dev/zero of=/tmp/diskfile2 bs=512M count=1
> 1+0 records in
> 1+0 records out
> [root at dex root]# losetup /dev/loop0 /tmp/diskfile0
> [root at dex root]# losetup /dev/loop1 /tmp/diskfile1
> [root at dex root]# losetup /dev/loop2 /tmp/diskfile2
> [root at dex root]# pvcreate /dev/loop[0-2]
> pvcreate -- physical volume "/dev/loop0" successfully created
> pvcreate -- physical volume "/dev/loop1" successfully created
> pvcreate -- physical volume "/dev/loop2" successfully created
> 
> [root at dex root]# vgcreate test_vg /dev/loop[0-2]
> vgcreate -- INFO: using default physical extent size 4 MB
> vgcreate -- INFO: maximum logical volume size is 255.99 Gigabyte
> vgcreate -- doing automatic backup of volume group "test_vg"
> vgcreate -- volume group "test_vg" successfully created and activated
> 
> [root at dex root]# lvcreate -L768M -n test_lv test_vg
> lvcreate -- doing automatic backup of "test_vg"
> lvcreate -- logical volume "/dev/test_vg/test_lv" successfully created
> 
> [root at dex root]# mke2fs /dev/test_vg/test_lv
> mke2fs 1.32 (09-Nov-2002)
> Filesystem label=
> OS type: Linux
> Block size=4096 (log=2)
> Fragment size=4096 (log=2)
> 98304 inodes, 196608 blocks
> 9830 blocks (5.00%) reserved for the super user
> First data block=0
> 6 block groups
> 32768 blocks per group, 32768 fragments per group
> 16384 inodes per group
> Superblock backups stored on blocks:
>         32768, 98304, 163840
> 
> Writing inode tables: done
> Writing superblocks and filesystem accounting information: done
> 
> This filesystem will be automatically checked every 33 mounts or
> 180 days, whichever comes first.  Use tune2fs -c or -i to override.
> [root at dex root]# mkdir /mnt/tmp
> [root at dex root]# mount /dev/test_vg/test_lv /mnt/tmp
> mount: you must specify the filesystem type
> [root at dex root]# mount -t ext2 /dev/test_vg/test_lv /mnt/tmp
> mount: wrong fs type, bad option, bad superblock on /dev/test_vg/test_lv,
>        or too many mounted file systems
> [root at dex root]# e2fsck /dev/test_vg/test_lv
> e2fsck 1.32 (09-Nov-2002)
> Couldn't find ext2 superblock, trying backup blocks...
> e2fsck: Bad magic number in super-block while trying to open
> /dev/test_vg/test_lv
> 
> The superblock could not be read or does not describe a correct ext2
> filesystem.  If the device is valid and it really contains an ext2
> filesystem (and not swap or ufs or something else), then the superblock
> is corrupt, and you might try running e2fsck with an alternate superblock:
>     e2fsck -b 8193 <device>
> 
> [root at dex root]#
> 
> Cheers
> 
> Mark Neil
> Imperial College
> London 
> 
> 
> _______________________________________________
> linux-lvm mailing list
> linux-lvm at sistina.com
> http://lists.sistina.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

*** 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
Mauelshagen at Sistina.com                           +49 2626 141200
                                                       FAX 924446
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-




More information about the linux-lvm mailing list