LVM on loopback device do not work

Kazutoshi Morioka morioka at at.wakwak.com
Sun Jan 11 10:38:09 UTC 2004


I'm trying to setup LVM on a loopback device for educational purpose.
But It didn't work.
Volume group and logical volumes are created successfuly without error.
But after mkfs, It could not be mounted and got error.
Logical volumes won't be initialized.
As described below, a logical volume, /dev/myvg/lvol1 returns random garbages
every time I dump it; this garbage looks like contents of .bash_history.
After LVM setup, loopbacked file "/PV1" was also tainted with garbages.
A LVM on harddisk partition worked well.
This is what I did.  Any suggession?

[root at myhost root]# dd if=/dev/zero of=/PV1 bs=100k count=1k
[root at myhost root]# losetup /dev/loop1 /PV1
[root at myhost root]# vgscan
[root at myhost root]# pvcreate /dev/loop1
[root at myhost root]# pvscan
[root at myhost root]# vgcreate myvg /dev/loop1
[root at myhost root]# vgscan
[root at myhost root]# lvcreate myvg -L 50m
[root at myhost root]# xxd /dev/myvg/lvol1 | head
0000000: 7669 204d 616b 6566 696c 6500 1900 0000  vi Makefile.....
0000010: 1838 fb08 303b fb08 8091 fb08 d13f 72e1  .8..0;.......?r.
0000020: 0100 0000 1900 0000 0000 0000 58d3 fb08  ............X...
0000030: 28d3 fb08 a9d1 8fcc 9100 0000 1900 0000  (...............
[root at myhost root]# xxd /dev/myvg/lvol1 | head
0000000: 672f 0001 1100 0000 1850 fb08 0000 0000  g/.......P......
0000010: 0101 0101 1100 0000 6c73 0000 88a1 2600  ........ls....&.
0000020: 4059 fb08 1100 0000 f063 fb08 0000 0000  @Y.......c......
0000030: 6857 fb08 1100 0000 204d fb08 0000 0000  hW...... M......
[root at myhost root]# mkfs -t ext3 /dev/myvg/lvol1
[root at myhost root]# mount /dev/myvg/lvol1 /test
mount: you must specify the filesystem type
[root at myhost root]# mount -t ext3 /dev/myvg/lvol1 /test
mount: wrong fs type, bad option, bad superblock on /dev/myvg/lvol1,
       or too many mounted file systems
[root at myhost root]# xxd /dev/myvg/lvol1 | head -4
0000000: 4a4c 4553 5343 4841 5253 4554 3d6a 6170  JLESSCHARSET=jap
0000010: 616e 6573 652d 6575 6300 0000 2100 0000  anese-euc...!...
0000020: 503c fb08 f03d fb08 a0fe fb08 0000 0000  P<...=..........
0000030: 0000 0000 0100 0000 0000 0000 8900 0000  ................
[root at myhost root]# xxd /dev/myvg/lvol1 | head -4
0000000: 4553 0008 1100 0000 e854 fb08 0000 0000  ES.......T......
0000010: 1000 0000 1900 0000 0000 0000 3042 fb08  ............0B..
0000020: 0042 fb08 12b4 47a6 0200 0000 5100 0000  .B....G.....Q...
0000030: 636d 7020 2f6d 6e74 2f65 7463 2f73 7368  cmp /mnt/etc/ssh
[root at nikujaga root]# rpm -q kernel lvm losetup
kernel-2.4.22-1.2140.nptl
lvm-1.0.3-13
losetup-2.11y-29





More information about the fedora-list mailing list