Hi,
I'm a newbie to dm, and i'm not sure if it's the right place to ask the following question. Please correct me if not, and thanks for any reply.In short, I did mkfs.ext3 on a dm thin-vol, and it looks consumed much more data space than on a loop image. As a result, mkfs failed due to inadequate space.
---
[root@vm ~]# dd if=/dev/zero of=10G_1.img bs=1 count=0 seek=10G
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0.000102011 s, 0.0 kB/s
[root@vm ~]# /usr/sbin/mkfs -t ext3 -- -F -b 1024 10G_1.img
mke2fs 1.42.9 (28-Dec-2013)
Discarding device blocks: done
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
655360 inodes, 10485760 blocks
524288 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=77594624
1280 block groups
8192 blocks per group, 8192 fragments per group
512 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409, 663553,
1024001, 1990657, 2809857, 5120001, 5971969
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
[root@vm ~]# du -sh 10G_1.img
199M 10G_1.img
---
---
[root@vm ~]# dd if=/dev/zero of=10G_1.img bs=1 count=0 seek=10G
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0.000102011 s, 0.0 kB/s
[root@vm ~]# /usr/sbin/mkfs -t ext3 -- -F -b 1024 10G_1.img
mke2fs 1.42.9 (28-Dec-2013)
Discarding device blocks: done
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
655360 inodes, 10485760 blocks
524288 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=77594624
1280 block groups
8192 blocks per group, 8192 fragments per group
512 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409, 663553,
1024001, 1990657, 2809857, 5120001, 5971969
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
[root@vm ~]# du -sh 10G_1.img
199M 10G_1.img
---
As shown above, mks.ext3 on a 10G loop image should use 199M space. In the following test, i'll create a dm thin-vol with 10G virtual size and 500m backing size, and i expect 500m is adequate for mkfs.ext3.
---
[root@vm ~]# dd if=/dev/zero of=10G.img bs=1 count=0 seek=10G
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0.000125097 s, 0.0 kB/s
[root@vm ~]# losetup /dev/loop0 /root/10G.img
[root@vm ~]# /usr/sbin/dmsetup create thin-meta --table '0 48000 linear /dev/loop0 10240'
[root@vm ~]# /usr/sbin/dmsetup create thin-data --table '0 1024000 linear /dev/loop0 58240'
[root@vm ~]# /usr/sbin/dmsetup create thin-pool --table '0 1024000 thin-pool /dev/mapper/thin-meta /dev/mapper/thin-data 1024 200'
[root@vm ~]# /usr/sbin/dmsetup message /dev/mapper/thin-pool 0 'create_thin 17021'
[root@vm ~]# /usr/sbin/dmsetup create thin-vol --table '0 10240000 thin /dev/mapper/thin-pool 17021'
[root@vm ~]# dmsetup status | grep pool
thin-pool: 0 1024000 thin-pool 0 10/6000 0/1000 - rw discard_passdown queue_if_no_space -
[root@vm ~]# /usr/sbin/mkfs -t ext3 -- -F -b 1024 /dev/mapper/thin-vol
mke2fs 1.42.9 (28-Dec-2013)
Discarding device blocks: done
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=64 blocks, Stripe width=512 blocks
320000 inodes, 5120000 blocks
256000 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=72351744
625 block groups
8192 blocks per group, 8192 fragments per group
512 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409, 663553,
1024001, 1990657, 2809857
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information:
Warning, had trouble writing out superblocks.
[root@vm ~]# echo $?
5
[root@vm ~]# dmsetup status | grep pool
thin-pool: 0 1024000 thin-pool 0 17/6000 1000/1000 - out_of_data_space discard_passdown error_if_no_space -
[root@vm ~]# journalctl -k
Jan 15 18:15:38 vm kernel: device-mapper: thin: 253:8: switching pool to write mode
Jan 15 18:15:38 vm kernel: device-mapper: thin: 253:8: switching pool to out-of-data-space (queue IO) mode
Jan 15 18:16:39 vm kernel: device-mapper: thin: 253:8: switching pool to out-of-data-space (error IO) mode
Jan 15 18:16:39 vm kernel: buffer_io_error: 25590 callbacks suppressed
Jan 15 18:16:39 vm kernel: Buffer I/O error on dev dm-9, logical block 988832, lost async page write
Jan 15 18:16:39 vm kernel: Buffer I/O error on dev dm-9, logical block 989184, lost async page write
Jan 15 18:16:39 vm kernel: Buffer I/O error on dev dm-9, logical block 990896, lost async page write
Jan 15 18:16:39 vm kernel: Buffer I/O error on dev dm-9, logical block 991232, lost async page write
Jan 15 18:16:39 vm kernel: Buffer I/O error on dev dm-9, logical block 992960, lost async page write
Jan 15 18:16:39 vm kernel: Buffer I/O error on dev dm-9, logical block 993280, lost async page write
Jan 15 18:16:39 vm kernel: Buffer I/O error on dev dm-9, logical block 995024, lost async page write
Jan 15 18:16:39 vm kernel: Buffer I/O error on dev dm-9, logical block 995328, lost async page write
Jan 15 18:16:39 vm kernel: Buffer I/O error on dev dm-9, logical block 997088, lost async page write
Jan 15 18:16:39 vm kernel: Buffer I/O error on dev dm-9, logical block 997376, lost async page write
---
---
[root@vm ~]# dd if=/dev/zero of=10G.img bs=1 count=0 seek=10G
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0.000125097 s, 0.0 kB/s
[root@vm ~]# losetup /dev/loop0 /root/10G.img
[root@vm ~]# /usr/sbin/dmsetup create thin-meta --table '0 48000 linear /dev/loop0 10240'
[root@vm ~]# /usr/sbin/dmsetup create thin-data --table '0 1024000 linear /dev/loop0 58240'
[root@vm ~]# /usr/sbin/dmsetup create thin-pool --table '0 1024000 thin-pool /dev/mapper/thin-meta /dev/mapper/thin-data 1024 200'
[root@vm ~]# /usr/sbin/dmsetup message /dev/mapper/thin-pool 0 'create_thin 17021'
[root@vm ~]# /usr/sbin/dmsetup create thin-vol --table '0 10240000 thin /dev/mapper/thin-pool 17021'
[root@vm ~]# dmsetup status | grep pool
thin-pool: 0 1024000 thin-pool 0 10/6000 0/1000 - rw discard_passdown queue_if_no_space -
[root@vm ~]# /usr/sbin/mkfs -t ext3 -- -F -b 1024 /dev/mapper/thin-vol
mke2fs 1.42.9 (28-Dec-2013)
Discarding device blocks: done
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=64 blocks, Stripe width=512 blocks
320000 inodes, 5120000 blocks
256000 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=72351744
625 block groups
8192 blocks per group, 8192 fragments per group
512 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409, 663553,
1024001, 1990657, 2809857
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information:
Warning, had trouble writing out superblocks.
[root@vm ~]# echo $?
5
[root@vm ~]# dmsetup status | grep pool
thin-pool: 0 1024000 thin-pool 0 17/6000 1000/1000 - out_of_data_space discard_passdown error_if_no_space -
[root@vm ~]# journalctl -k
Jan 15 18:15:38 vm kernel: device-mapper: thin: 253:8: switching pool to write mode
Jan 15 18:15:38 vm kernel: device-mapper: thin: 253:8: switching pool to out-of-data-space (queue IO) mode
Jan 15 18:16:39 vm kernel: device-mapper: thin: 253:8: switching pool to out-of-data-space (error IO) mode
Jan 15 18:16:39 vm kernel: buffer_io_error: 25590 callbacks suppressed
Jan 15 18:16:39 vm kernel: Buffer I/O error on dev dm-9, logical block 988832, lost async page write
Jan 15 18:16:39 vm kernel: Buffer I/O error on dev dm-9, logical block 989184, lost async page write
Jan 15 18:16:39 vm kernel: Buffer I/O error on dev dm-9, logical block 990896, lost async page write
Jan 15 18:16:39 vm kernel: Buffer I/O error on dev dm-9, logical block 991232, lost async page write
Jan 15 18:16:39 vm kernel: Buffer I/O error on dev dm-9, logical block 992960, lost async page write
Jan 15 18:16:39 vm kernel: Buffer I/O error on dev dm-9, logical block 993280, lost async page write
Jan 15 18:16:39 vm kernel: Buffer I/O error on dev dm-9, logical block 995024, lost async page write
Jan 15 18:16:39 vm kernel: Buffer I/O error on dev dm-9, logical block 995328, lost async page write
Jan 15 18:16:39 vm kernel: Buffer I/O error on dev dm-9, logical block 997088, lost async page write
Jan 15 18:16:39 vm kernel: Buffer I/O error on dev dm-9, logical block 997376, lost async page write
---
In another test, mkfs succeeds with creating a 2500m virtual size thin-vol instead of 5000m:
/usr/sbin/dmsetup create thin-vol --table '0 5120000 thin /dev/mapper/thin-pool 17021'
/usr/sbin/dmsetup create thin-vol --table '0 5120000 thin /dev/mapper/thin-pool 17021'
I think the failure is due to mkfs runs out of space on dm thin-vol, but why is it?
Thanks,
Young
-- dm-devel mailing list dm-devel@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/dm-devel