Discussion:
[dm-devel] Persistent Overlay COW Full: Flipped the Invalid bit in a hexdump; how do I grow it now?
Rahul Nabar
2014-06-03 13:20:50 UTC
Permalink
I accidentally managed to fill up the persistent COW snapshot overlay
on my Fedora20 USB & it got flagged Invalid thus rendering the Live
USB unbootable since the root filesystem couldn't be mounted.

dmsetup status
live-rw 0 8388608 snapshot Invalid.

Subsequently I used a 2011 thread(link below) on the dm-devel mailing
list ( Alasdair Kergon, Frederick Grose etc.) and flipped the invalid
bit in the overlay file by booting a different system and attaching
the USB stick to it.

Like so: echo $'\x01' | dd
of=/run/media..../liveuser/LIVE.../overlay-LIVE-17F4-055A bs=1
count=1 seek=4 conv=notrunc

hexdump of the file verified the flipped 5th byte. Now the LiveUSB
boots & I can successfully see my data but it's hard to do anything
more since it gets full almost immediately after I boot.

Is there a way to grow the overlay file? Would this work?

dd if=/dev/zero of=overlay-LIVE-17F4-055A seek=overlay_size count=size_increase

How do I compute the number overlay_size? I suppose size_increase can
be some large number?

Or are more steps needed to expand the overlay?


http://thread.gmane.org/gmane.linux.kernel.device-mapper.devel/14644
Frederick Grose
2014-06-03 14:45:16 UTC
Permalink
Post by Rahul Nabar
I accidentally managed to fill up the persistent COW snapshot overlay
on my Fedora20 USB & it got flagged Invalid thus rendering the Live
USB unbootable since the root filesystem couldn't be mounted.
dmsetup status
live-rw 0 8388608 snapshot Invalid.
Subsequently I used a 2011 thread(link below) on the dm-devel mailing
list ( Alasdair Kergon, Frederick Grose etc.) and flipped the invalid
bit in the overlay file by booting a different system and attaching
the USB stick to it.
Like so: echo $'\x01' | dd
of=/run/media..../liveuser/LIVE.../overlay-LIVE-17F4-055A bs=1
count=1 seek=4 conv=notrunc
hexdump of the file verified the flipped 5th byte. Now the LiveUSB
boots & I can successfully see my data but it's hard to do anything
more since it gets full almost immediately after I boot.
Is there a way to grow the overlay file? Would this work?
dd if=/dev/zero of=overlay-LIVE-17F4-055A seek=overlay_size
count=size_increase
How do I compute the number overlay_size?
​blockdev -q --getsz <overlay/device/path or overlay/file/path>​

or the denominator in the

dmsetup status

for the live-rw snapshot

(Units are 512 byte sectors.)

I suppose size_increase can
Post by Rahul Nabar
be some large number?
Or are more steps needed to expand the overlay?
http://thread.gmane.org/gmane.linux.kernel.device-mapper.devel/14644
​See
​https://fedoraproject.org/wiki/LiveOS_image#Merge_overlay_into_new_image

--Fred

Loading...