-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Thu, May 28, 2015 at 11:36:02PM +0200, Marek Marczykowski-Górecki wrote:
> On Thu, May 28, 2015 at 11:44:47AM -0700, Vít Šesták wrote:
> > On Thursday, May 28, 2015 at 11:43:41 AM UTC+2, Vít Šesták wrote:
> > >
> > >
> > > Added for next qubes-core-dom0 package version.
> > >>
> > > Great!
> > >
> > >
> > >> To save some space, it would be good idea to create thin volumes
> > >> (lvcreate -T ...). This should work well with private.img as it is
> > >> mounted with -o discard.
> > >>
> > >
> > > Thin provisioning brings some potential issues. I am not sure (and can't
> > > find any details) how is low real space handled:
> > > 1. It should be handled somehow proactively, i.e. warn the user when
> > > running out of space. For imgs on an ordinary filesystem, this is usually
> > > monitored by some user process, which shows some notification about low
> > > space. I am however unsure if there is something similar for LVM thin
> > > provisioning.
>
> There is lvmetad daemon which can send events, but I'm not sure if there
> is any GUI indication of that.
>
> > > 2. I don't know how is this handled reactively, i.e. if it just pauses the
> > > VM until you make some space in the LVM volume group (which would be
> > > similar to the VirtualBox approach) or if it is handled somehow differently.
>
> It looks like it crashes badly... I was able to recover test volume
> using lvconvert --repair, but some data were lost.
>
> From lvmthin manual:
> (...) Writes to thin LVs are accepted and queued,
> with the expectation that pool data space will be extended soon.
> Once data space is extended, the queued writes will be processed, and
> the thin pool will return to normal operation.
>
> While waiting to be extended, the thin pool will queue writes for up
> to 60 seconds (the default). If data space has not been extended
> after this time, the queued writes will return an error to the
> caller, e.g. the file system. This can result in file system
> corruption for non-journaled file systems that may require fsck.
> When a thin pool returns errors for writes to a thin LV, any file
> system is subject to losing unsynced user data.
>
> There is an option to return an error immediately when volume is full
> (so there will be no lost writes from a queue). I'm attaching terminal
> output from test session at the end.
Oops, forgot that:
[root@testvm user]# truncate -s 128M test.img
[root@testvm user]# losetup /dev/loop0 test.img
[root@testvm user]# vgcreate test /dev/loop0
Physical volume "/dev/loop0" successfully created
Volume group "test" successfully created
[root@testvm user]# lvcreate -T --thinpool pool -V 10G -L 32M -n vol1 test
Logical volume "vol1" created.
[root@testvm user]# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
pool test twi-aotz-- 32.00m 0.00 0.98
vol1 test Vwi-a-tz-- 10.00g pool 0.00
[root@testvm user]# yes | dd of=/dev/test/vol1 bs=1M count=48 iflag=fullblock
48+0 records in
48+0 records out
50331648 bytes (50 MB) copied, 60.7506 s, 828 kB/s
[root@testvm user]# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
pool test twi-aotzD- 32.00m 100.00 1.37
vol1 test Vwi-aotz-- 10.00g pool 0.31
May 29 00:07:06 testvm kernel: device-mapper: thin: 253:3: reached low water mark for data device: sending event.
May 29 00:07:06 testvm lvm[9814]: Thin test-pool-tpool is now 100% full.
May 29 00:07:06 testvm kernel: device-mapper: thin: 253:3: switching pool to out-of-data-space mode
(...)
May 29 00:08:06 testvm kernel: device-mapper: thin: 253:3: switching pool to read-only mode
May 29 00:08:06 testvm kernel: buffer_io_error: 6135 callbacks suppressed
May 29 00:08:06 testvm kernel: Buffer I/O error on dev dm-5, logical block 8192, lost async page write
May 29 00:08:06 testvm kernel: device-mapper: thin: 253:3: metadata operation 'dm_pool_commit_metadata' failed: error = -1
May 29 00:08:06 testvm kernel: device-mapper: thin: 253:3: aborting current metadata transaction
May 29 00:08:06 testvm kernel: Buffer I/O error on dev dm-5, logical block 8193, lost async page write
May 29 00:08:06 testvm kernel: Buffer I/O error on dev dm-5, logical block 8194, lost async page write
(...)
[root@testvm user]# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
pool test twi-aotzM- 32.00m 100.00 1.37
vol1 test Vwi-a-tz-- 10.00g pool 0.31
[root@testvm user]# hexdump /dev/test/vol1
0000000 0a79 0a79 0a79 0a79 0a79 0a79 0a79 0a79
*
hexdump: /dev/test/vol1: Input/output error
2000000
[root@testvm user]# lvconvert --repair test/pool
Only inactive pool can be repaired.
[root@testvm user]# lvchange -an test/vol1
[root@testvm user]# lvchange -an test/pool
[root@testvm user]# lvconvert --repair test/pool
WARNING: If everything works, remove "test/pool_meta0".
WARNING: Use pvmove command to move "test/pool_tmeta" on the best fitting PV.
[root@testvm user]# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
pool test twi---tz-- 32.00m
pool_meta0 test -wi------- 4.00m
vol1 test Vwi---tz-- 10.00g pool
[root@testvm user]# lvchange -ay test/vol1
[root@testvm user]# hexdump /dev/test/vol1
0000000 0a79 0a79 0a79 0a79 0a79 0a79 0a79 0a79
*
2000000 0000 0000 0000 0000 0000 0000 0000 0000
*
280000000
- --
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQEcBAEBAgAGBQJVZ5MpAAoJENuP0xzK19csPEAIAIfoScmVGYq6o+W8XDMHjxAD
XeEullrcKRFm/TPBCfac85LYv5h1j4/HpDX0+xjyvS90Ls3LuudkpGXAmoeSyHMh
J/il75GDmBKaG1lnqLcxcowMKHLIsvf0SK1RhaG0v4X47e9zXZ3/LX6qkVYTfYPd
vow7/pd4+dFIoWNIY8PrQVKHZqiOUne4+jqjgJFgm1+DfcUDcdapuXS3DdlmvMNe
2JO/eMK8u+pIfwDV9HRkC5zqdtn3c6poZQkuLj6igZrItA6O9BqmgyQyX08qdxeX
Ua9E5NxeHz8bFB/2KypVRRvCCluIoIC5Nfy/talN+q2od795G96WzYDpNjqbjE0=
=wwzj
-----END PGP SIGNATURE-----