LVM on loopback device do not work

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@myhost root]# dd if=/dev/zero of=/PV1 bs=100k count=1k
[root@myhost root]# losetup /dev/loop1 /PV1
[root@myhost root]# vgscan
[root@myhost root]# pvcreate /dev/loop1
[root@myhost root]# pvscan
[root@myhost root]# vgcreate myvg /dev/loop1
[root@myhost root]# vgscan
[root@myhost root]# lvcreate myvg -L 50m
[root@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@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@myhost root]# mkfs -t ext3 /dev/myvg/lvol1
[root@myhost root]# mount /dev/myvg/lvol1 /test
mount: you must specify the filesystem type
[root@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@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@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@nikujaga root]# rpm -q kernel lvm losetup
kernel-2.4.22-1.2140.nptl
lvm-1.0.3-13
losetup-2.11y-29




[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux