shutting down f19-livecd corrups raid1
by Joshua C.
My raid1 gets corrupted _everytime_ I shut down a
f19-kde-livecd-image. I used kernel.f19 and mdadm.f19 in a f17-livecd
and everything works fine. So these two are not the problem.
What should I look at? maybe dracut???
PS: Testing and experimenting isn't a good idea here because it takes
almost 3 hours for the raid to rebuild...
--
--joshua
10 years
Securing isolinux.cfg
by James Lapthorn
Good Morning,
I'm creating a livecd that will be used to securely send an encrypted
file over FTP and then poweroff. I have successfully built a minimal
installation using the provided kickstart and have secured the OS.
I now need to secure booting the livecd, by default the menu allows me
to edit the boot options and add things like 'init=/bin/bash' to gain
root access.
The issue I have is the isolinux.cfg generated by
'/usr/lib/python2.6/site-packages/imgcreate/live.py' only allows me to
modify the timeout by passing 'bootloader --timeout=1' in the kickstart
file.
Ideally I don't want a menu displayed and the default option to always boot.
I have hacked the live.py to include 'allowoptions 0' which prevents any
modifications but this is far from a good solution, is there a better
way of configuring isolinux.cfg
Many Thanks
James Lapthorn
10 years, 6 months
F18 Live CD works but kickstart version doesn't
by Turtle Wabbit
We've been building LiveCD's since Fedora 8, and have noticed issues
starting with Fedora 18. We started with the stock .ks files, no changes.
These include not booting (freezing) on some machines, wifi not working,
etc..
However, downloading the LiveCD from the Fedora website doesn't exhibit
these issues.
What is the difference between the two?
Thanks.
10 years, 6 months
Re: [Fedora-livecd-list] [PATCH] Boot a Live USB device as read-only after persisting some changes.
by Frederick Grose
From: Frederick Grose <fgrose(a)sugarlabs.org>
commit a6cd70fc9df2d299ed4f347461c33e4824df62f0
Author: Frederick Grose <fgrose(a)sugarlabs.org>
Enable read-only mounting of a persistent home.img filesystem.
Enable one to call for filesystem checking of home.img before
mounting on the next boot.
---
fedora-live-base.ks | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
diff --git a/fedora-live-base.ks b/fedora-live-base.ks
index 6c76e96..0512f67 100644
--- a/fedora-live-base.ks
+++ b/fedora-live-base.ks
@@ -116,9 +116,13 @@ mountPersistentHome() {
elif [ ! -b "\$homedev" ]; then
loopdev=\`losetup -f\`
if [ "\${homedev##/run/initramfs/live}" != "\${homedev}" ]; then
- action "Remounting live store r/w" mount -o remount,rw /run/initramfs/live
+ if [ "\$liverw" = rw ]; then
+ action "Remounting live store r/w" mount -o remount,rw /run/initramfs/live
+ else
+ opts="-r"
+ fi
fi
- losetup \$loopdev \$homedev
+ losetup \$opts \$loopdev \$homedev
homedev=\$loopdev
fi
@@ -130,6 +134,22 @@ mountPersistentHome() {
homedev=/dev/mapper/EncHome
fi
+ # If read-only is requested, prepare a non-persistent overlay and snapshot target.
+ if [ "\$opts" = "-r" ]; then
+ dd if=/dev/null of=/run/initramfs/overlayfs/home_overlay bs=1024 count=1 seek=\$((512*1024)) 2> /dev/null
+ HOME_OVERLAY_LOOPDEV=\$(losetup -f)
+ losetup \$HOME_OVERLAY_LOOPDEV /run/initramfs/overlayfs/home_overlay
+ sz=\$(blockdev --getsz \$homedev)
+ echo 0 \$sz snapshot \$homedev \$HOME_OVERLAY_LOOPDEV N 8 | dmsetup create home-rw
+ homedev=/dev/mapper/home-rw
+ fi
+
+ # Check the filesystem, if requested.
+ if [ -e /forcehomefsck ]; then
+ e2fsck -f -y -v \$homedev || e2fsck -f -y \$homedev
+ rm /forcehomefsck
+ fi
+
# and finally do the mount
mount \$mountopts \$homedev /home
# if we have /home under what's passed for persistent home, then
--
1.8.3.1
10 years, 7 months
Re: [Fedora-livecd-list] [PATCH] Boot a Live USB device as read-only after persisting some changes.
by Frederick Grose
From: Frederick Grose <fgrose(a)sugarlabs.org>
commit 96ff19a87c0be1eca27860aeef5434513b0e8c61
Author: Frederick Grose <fgrose(a)sugarlabs.org>
Allow read-only mounting of the base device filesystem, livedev.
Use read-only loop devices and non-persistent overlay targets.
---
modules.d/90dmsquash-live/dmsquash-live-root.sh | 25 ++++++++++++++++---------
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/modules.d/90dmsquash-live/dmsquash-live-root.sh b/modules.d/90dmsquash-live/dmsquash-live-root.sh
index 14e84e1..af0022f 100755
--- a/modules.d/90dmsquash-live/dmsquash-live-root.sh
+++ b/modules.d/90dmsquash-live/dmsquash-live-root.sh
@@ -24,7 +24,7 @@ squash_image=$(getarg rd.live.squashimg)
getargbool 0 rd.live.ram -d -y live_ram && live_ram="yes"
getargbool 0 rd.live.overlay.reset -d -y reset_overlay && reset_overlay="yes"
-getargbool 0 rd.live.overlay.readonly -d -y readonly_overlay && readonly_overlay="--readonly" || readonly_overlay=""
+getargbool 0 rd.live.overlay.readonly -d -y readonly_overlay && readonly_overlay="-r" || readonly_overlay=""
overlay=$(getarg rd.live.overlay -d overlay)
# CD/DVD media check
@@ -105,17 +105,23 @@ do_live_overlay() {
setup=""
if [ -n "$devspec" -a -n "$pathspec" -a -n "$overlay" ]; then
mkdir -m 0755 /run/initramfs/overlayfs
- mount -n -t auto $devspec /run/initramfs/overlayfs || :
- if [ -f /run/initramfs/overlayfs$pathspec -a -w /run/initramfs/overlayfs$pathspec ]; then
- losetup $OVERLAY_LOOPDEV /run/initramfs/overlayfs$pathspec
- if [ -n "$reset_overlay" ]; then
- dd if=/dev/zero of=$OVERLAY_LOOPDEV bs=64k count=1 conv=fsync 2>/dev/null
+ mount -n -t auto -o $liverw $devspec /run/initramfs/overlayfs || :
+ if [ -f /run/initramfs/overlayfs$pathspec ]; then
+ if [ "$liverw" = ro ]; then
+ readonly_overlay='-r'
+ fi
+ losetup $readonly_overlay $OVERLAY_LOOPDEV /run/initramfs/overlayfs$pathspec
+ if [ -w /run/initramfs/overlayfs$pathspec ]; then
+ if [ -n "$reset_overlay" ]; then
+ dd if=/dev/zero of=$OVERLAY_LOOPDEV bs=64k count=1 conv=fsync 2>/dev/null
+ fi
fi
setup="yes"
fi
umount -l /run/initramfs/overlayfs || :
fi
+ persistent='P'
if [ -z "$setup" -o -n "$readonly_overlay" ]; then
if [ -n "$setup" ]; then
warn "Using temporary overlay."
@@ -123,6 +129,7 @@ do_live_overlay() {
warn "Unable to find persistent overlay; using temporary"
sleep 5
fi
+ persistent='N'
dd if=/dev/null of=/overlay bs=1024 count=1 seek=$((512*1024)) 2> /dev/null
if [ -n "$setup" -a -n "$readonly_overlay" ]; then
@@ -136,14 +143,14 @@ do_live_overlay() {
# set up the snapshot
sz=$(blockdev --getsz $BASE_LOOPDEV)
if [ -n "$readonly_overlay" ]; then
- echo 0 $sz snapshot $BASE_LOOPDEV $OVERLAY_LOOPDEV p 8 | dmsetup create $readonly_overlay live-ro
+ echo 0 $sz snapshot $BASE_LOOPDEV $OVERLAY_LOOPDEV N 8 | dmsetup create $readonly_overlay live-ro
base="/dev/mapper/live-ro"
over=$RO_OVERLAY_LOOPDEV
else
base=$BASE_LOOPDEV
over=$OVERLAY_LOOPDEV
fi
- echo 0 $sz snapshot $base $over p 8 | dmsetup create live-rw
+ echo 0 $sz snapshot $base $over $persistent 8 | dmsetup create live-rw
}
# live cd helper function
@@ -217,7 +224,7 @@ fi
if [ -b "$OSMIN_LOOPDEV" ]; then
# set up the devicemapper snapshot device, which will merge
# the normal live fs image, and the delta, into a minimzied fs image
- echo "0 $( blockdev --getsz $BASE_LOOPDEV ) snapshot $BASE_LOOPDEV $OSMIN_LOOPDEV p 8" | dmsetup create --readonly live-osimg-min
+ echo "0 $( blockdev --getsz $BASE_LOOPDEV ) snapshot $BASE_LOOPDEV $OSMIN_LOOPDEV N 8" | dmsetup create --readonly live-osimg-min
fi
ROOTFLAGS="$(getarg rootflags)"
--
1.8.3.1
10 years, 7 months
Branch 'f19-branch' - docs/livecd-iso-to-disk.pod tools/livecd-iso-to-disk.sh
by Brian C. Lane
docs/livecd-iso-to-disk.pod | 4 ++--
tools/livecd-iso-to-disk.sh | 20 ++++++++++----------
2 files changed, 12 insertions(+), 12 deletions(-)
New commits:
commit caaff7b024aa8a9105825b085ae73d0c1642729b
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Mon Aug 12 10:31:51 2013 -0700
Change vfat limit from 2047 to 4095 (#995552)
The actual filesystem limit is 2^32−1
diff --git a/docs/livecd-iso-to-disk.pod b/docs/livecd-iso-to-disk.pod
index bf52822..cef973f 100644
--- a/docs/livecd-iso-to-disk.pod
+++ b/docs/livecd-iso-to-disk.pod
@@ -117,11 +117,11 @@ Sets up a swap file of <size> mebibytes (integer values only) on the target devi
=item --overlay-size-mb <size>
-This option sets the overlay size in mebibytes (integer values only). The overlay makes persistent storage available to the live operating system, if the operating system supports it. The persistent LiveOS overlay holds image-change snapshots (using write-once, difference-tracking storage) in the /LiveOS/overlay-<device_id> file, which, *one should note*, always grows in size due to the storage mechanism. (The fraction of allocated space that has been consumed may be displayed by issuing the 'dmsetup status' command in a terminal session of a running LiveOS installation.) One way to conserve the unrecoverable, overlay file space, is to specify a persistent home folder for user files, see --home-size-mb below. The target storage device must have enough free space for the image and the overlay. A maximum <size> of 2047 MiB is permitted for vfat-formatted devices. If there is insufficient room on your device, you will be given information to help in adjusting your setti
ngs.
+This option sets the overlay size in mebibytes (integer values only). The overlay makes persistent storage available to the live operating system, if the operating system supports it. The persistent LiveOS overlay holds image-change snapshots (using write-once, difference-tracking storage) in the /LiveOS/overlay-<device_id> file, which, *one should note*, always grows in size due to the storage mechanism. (The fraction of allocated space that has been consumed may be displayed by issuing the 'dmsetup status' command in a terminal session of a running LiveOS installation.) One way to conserve the unrecoverable, overlay file space, is to specify a persistent home folder for user files, see --home-size-mb below. The target storage device must have enough free space for the image and the overlay. A maximum <size> of 4095 MiB is permitted for vfat-formatted devices. If there is insufficient room on your device, you will be given information to help in adjusting your setti
ngs.
=item --home-size-mb <size>
-Sets the home directory size in mebibytes (integer values only). A persistent home directory will be made in the /LiveOS/home.img filesystem image file. This file space is encrypted by default, but not compressed (one may bypass encryption with the --unencrypted-home installation option). Files in this home folder may be erased to recover and reuse their storage space. The target storage device must have enough free space for the image, any overlay, and the home directory. Note that the --delete-home option must also be selected to replace an existing persistent home with a new, empty one. A maximum <size> of 2047 MiB is permitted for vfat-formatted devices. If there is insufficient room on your device, you will be given information to help in adjusting your settings.
+Sets the home directory size in mebibytes (integer values only). A persistent home directory will be made in the /LiveOS/home.img filesystem image file. This file space is encrypted by default, but not compressed (one may bypass encryption with the --unencrypted-home installation option). Files in this home folder may be erased to recover and reuse their storage space. The target storage device must have enough free space for the image, any overlay, and the home directory. Note that the --delete-home option must also be selected to replace an existing persistent home with a new, empty one. A maximum <size> of 4095 MiB is permitted for vfat-formatted devices. If there is insufficient room on your device, you will be given information to help in adjusting your settings.
=item --delete-home
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index b0b5153..b38e3b2 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -214,7 +214,7 @@ usage() {
LiveOS installation.) One way to conserve the unrecoverable, overlay
file space, is to specify a persistent home folder for user files, see
--home-size-mb below. The target storage device must have enough free
- space for the image and the overlay. A maximum <size> of 2047 MiB is
+ space for the image and the overlay. A maximum <size> of 4095 MiB is
permitted for vfat-formatted devices. If there is insufficient room on
your device, you will be given information to help in adjusting your
settings.
@@ -229,7 +229,7 @@ usage() {
have enough free space for the image, any overlay, and the home
directory. Note that the --delete-home option must also be selected to
replace an existing persistent home with a new, empty one. A maximum
- <size> of 2047 MiB is permitted for vfat-formatted devices. If there is
+ <size> of 4095 MiB is permitted for vfat-formatted devices. If there is
insufficient room on your device, you will be given information to help
in adjusting your settings.
@@ -897,8 +897,8 @@ checkMBR $TGTDEV
if [ "$overlaysizemb" -gt 0 ]; then
- if [ "$TGTFS" = "vfat" -a "$overlaysizemb" -gt 2047 ]; then
- echo "Can't have an overlay of 2048MB or greater on VFAT"
+ if [ "$TGTFS" = "vfat" -a "$overlaysizemb" -gt 4095 ]; then
+ echo "Can't have an overlay of 4095MB or greater on VFAT"
exitclean
fi
LABEL=$(/sbin/blkid -s LABEL -o value $TGTDEV)
@@ -910,15 +910,15 @@ if [ "$overlaysizemb" -gt 0 ]; then
fi
if [ "$homesizemb" -gt 0 -a "$TGTFS" = "vfat" ]; then
- if [ "$homesizemb" -gt 2047 ]; then
- echo "Can't have a home overlay greater than 2048MB on VFAT"
+ if [ "$homesizemb" -gt 4095 ]; then
+ echo "Can't have a home overlay greater than 4095MB on VFAT"
exitclean
fi
fi
if [ "$swapsizemb" -gt 0 -a "$TGTFS" = "vfat" ]; then
- if [ "$swapsizemb" -gt 2047 ]; then
- echo "Can't have a swap file greater than 2048MB on VFAT"
+ if [ "$swapsizemb" -gt 4095 ]; then
+ echo "Can't have a swap file greater than 4095MB on VFAT"
exitclean
fi
fi
@@ -968,9 +968,9 @@ if [[ -n $skipcompress ]] && [[ -s $SRCMNT/LiveOS/squashfs.img ]]; then
if mount -o loop $SRCMNT/LiveOS/squashfs.img $SRCMNT; then
livesize=($(du -B 1M --apparent-size $SRCMNT/LiveOS/ext3fs.img))
umount $SRCMNT
- if ((livesize > 2048)) && [[ vfat == $TGTFS ]]; then
+ if ((livesize > 4095)) && [[ vfat == $TGTFS ]]; then
echo "
- An uncompressed image size greater than 2048 MB is not suitable
+ An uncompressed image size greater than 4095 MB is not suitable
for a VFAT-formatted device. The compressed SquashFS will be
copied to the target device.
"
10 years, 7 months
Branch 'f18-branch' - docs/livecd-iso-to-disk.pod tools/livecd-iso-to-disk.sh
by Brian C. Lane
docs/livecd-iso-to-disk.pod | 4 ++--
tools/livecd-iso-to-disk.sh | 20 ++++++++++----------
2 files changed, 12 insertions(+), 12 deletions(-)
New commits:
commit fe006936ebe6a72a62580c1e65a94450ad856896
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Mon Aug 12 10:31:51 2013 -0700
Change vfat limit from 2047 to 4095 (#995552)
The actual filesystem limit is 2^32−1
diff --git a/docs/livecd-iso-to-disk.pod b/docs/livecd-iso-to-disk.pod
index bf52822..cef973f 100644
--- a/docs/livecd-iso-to-disk.pod
+++ b/docs/livecd-iso-to-disk.pod
@@ -117,11 +117,11 @@ Sets up a swap file of <size> mebibytes (integer values only) on the target devi
=item --overlay-size-mb <size>
-This option sets the overlay size in mebibytes (integer values only). The overlay makes persistent storage available to the live operating system, if the operating system supports it. The persistent LiveOS overlay holds image-change snapshots (using write-once, difference-tracking storage) in the /LiveOS/overlay-<device_id> file, which, *one should note*, always grows in size due to the storage mechanism. (The fraction of allocated space that has been consumed may be displayed by issuing the 'dmsetup status' command in a terminal session of a running LiveOS installation.) One way to conserve the unrecoverable, overlay file space, is to specify a persistent home folder for user files, see --home-size-mb below. The target storage device must have enough free space for the image and the overlay. A maximum <size> of 2047 MiB is permitted for vfat-formatted devices. If there is insufficient room on your device, you will be given information to help in adjusting your setti
ngs.
+This option sets the overlay size in mebibytes (integer values only). The overlay makes persistent storage available to the live operating system, if the operating system supports it. The persistent LiveOS overlay holds image-change snapshots (using write-once, difference-tracking storage) in the /LiveOS/overlay-<device_id> file, which, *one should note*, always grows in size due to the storage mechanism. (The fraction of allocated space that has been consumed may be displayed by issuing the 'dmsetup status' command in a terminal session of a running LiveOS installation.) One way to conserve the unrecoverable, overlay file space, is to specify a persistent home folder for user files, see --home-size-mb below. The target storage device must have enough free space for the image and the overlay. A maximum <size> of 4095 MiB is permitted for vfat-formatted devices. If there is insufficient room on your device, you will be given information to help in adjusting your setti
ngs.
=item --home-size-mb <size>
-Sets the home directory size in mebibytes (integer values only). A persistent home directory will be made in the /LiveOS/home.img filesystem image file. This file space is encrypted by default, but not compressed (one may bypass encryption with the --unencrypted-home installation option). Files in this home folder may be erased to recover and reuse their storage space. The target storage device must have enough free space for the image, any overlay, and the home directory. Note that the --delete-home option must also be selected to replace an existing persistent home with a new, empty one. A maximum <size> of 2047 MiB is permitted for vfat-formatted devices. If there is insufficient room on your device, you will be given information to help in adjusting your settings.
+Sets the home directory size in mebibytes (integer values only). A persistent home directory will be made in the /LiveOS/home.img filesystem image file. This file space is encrypted by default, but not compressed (one may bypass encryption with the --unencrypted-home installation option). Files in this home folder may be erased to recover and reuse their storage space. The target storage device must have enough free space for the image, any overlay, and the home directory. Note that the --delete-home option must also be selected to replace an existing persistent home with a new, empty one. A maximum <size> of 4095 MiB is permitted for vfat-formatted devices. If there is insufficient room on your device, you will be given information to help in adjusting your settings.
=item --delete-home
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 9387b39..615ffd7 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -214,7 +214,7 @@ usage() {
LiveOS installation.) One way to conserve the unrecoverable, overlay
file space, is to specify a persistent home folder for user files, see
--home-size-mb below. The target storage device must have enough free
- space for the image and the overlay. A maximum <size> of 2047 MiB is
+ space for the image and the overlay. A maximum <size> of 4095 MiB is
permitted for vfat-formatted devices. If there is insufficient room on
your device, you will be given information to help in adjusting your
settings.
@@ -229,7 +229,7 @@ usage() {
have enough free space for the image, any overlay, and the home
directory. Note that the --delete-home option must also be selected to
replace an existing persistent home with a new, empty one. A maximum
- <size> of 2047 MiB is permitted for vfat-formatted devices. If there is
+ <size> of 4095 MiB is permitted for vfat-formatted devices. If there is
insufficient room on your device, you will be given information to help
in adjusting your settings.
@@ -897,8 +897,8 @@ checkMBR $TGTDEV
if [ "$overlaysizemb" -gt 0 ]; then
- if [ "$TGTFS" = "vfat" -a "$overlaysizemb" -gt 2047 ]; then
- echo "Can't have an overlay of 2048MB or greater on VFAT"
+ if [ "$TGTFS" = "vfat" -a "$overlaysizemb" -gt 4095 ]; then
+ echo "Can't have an overlay of 4095MB or greater on VFAT"
exitclean
fi
LABEL=$(/sbin/blkid -s LABEL -o value $TGTDEV)
@@ -910,15 +910,15 @@ if [ "$overlaysizemb" -gt 0 ]; then
fi
if [ "$homesizemb" -gt 0 -a "$TGTFS" = "vfat" ]; then
- if [ "$homesizemb" -gt 2047 ]; then
- echo "Can't have a home overlay greater than 2048MB on VFAT"
+ if [ "$homesizemb" -gt 4095 ]; then
+ echo "Can't have a home overlay greater than 4095MB on VFAT"
exitclean
fi
fi
if [ "$swapsizemb" -gt 0 -a "$TGTFS" = "vfat" ]; then
- if [ "$swapsizemb" -gt 2047 ]; then
- echo "Can't have a swap file greater than 2048MB on VFAT"
+ if [ "$swapsizemb" -gt 4095 ]; then
+ echo "Can't have a swap file greater than 4095MB on VFAT"
exitclean
fi
fi
@@ -968,9 +968,9 @@ if [[ -n $skipcompress ]] && [[ -s $SRCMNT/LiveOS/squashfs.img ]]; then
if mount -o loop $SRCMNT/LiveOS/squashfs.img $SRCMNT; then
livesize=($(du -B 1M --apparent-size $SRCMNT/LiveOS/ext3fs.img))
umount $SRCMNT
- if ((livesize > 2048)) && [[ vfat == $TGTFS ]]; then
+ if ((livesize > 4095)) && [[ vfat == $TGTFS ]]; then
echo "
- An uncompressed image size greater than 2048 MB is not suitable
+ An uncompressed image size greater than 4095 MB is not suitable
for a VFAT-formatted device. The compressed SquashFS will be
copied to the target device.
"
10 years, 7 months
Branch 'f17-branch' - docs/livecd-iso-to-disk.pod tools/livecd-iso-to-disk.sh
by Brian C. Lane
docs/livecd-iso-to-disk.pod | 4 ++--
tools/livecd-iso-to-disk.sh | 20 ++++++++++----------
2 files changed, 12 insertions(+), 12 deletions(-)
New commits:
commit d429edff0a12e2028bb067acd5b40cb61f5c4572
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Mon Aug 12 10:31:51 2013 -0700
Change vfat limit from 2047 to 4095 (#995552)
The actual filesystem limit is 2^32−1
diff --git a/docs/livecd-iso-to-disk.pod b/docs/livecd-iso-to-disk.pod
index bf52822..cef973f 100644
--- a/docs/livecd-iso-to-disk.pod
+++ b/docs/livecd-iso-to-disk.pod
@@ -117,11 +117,11 @@ Sets up a swap file of <size> mebibytes (integer values only) on the target devi
=item --overlay-size-mb <size>
-This option sets the overlay size in mebibytes (integer values only). The overlay makes persistent storage available to the live operating system, if the operating system supports it. The persistent LiveOS overlay holds image-change snapshots (using write-once, difference-tracking storage) in the /LiveOS/overlay-<device_id> file, which, *one should note*, always grows in size due to the storage mechanism. (The fraction of allocated space that has been consumed may be displayed by issuing the 'dmsetup status' command in a terminal session of a running LiveOS installation.) One way to conserve the unrecoverable, overlay file space, is to specify a persistent home folder for user files, see --home-size-mb below. The target storage device must have enough free space for the image and the overlay. A maximum <size> of 2047 MiB is permitted for vfat-formatted devices. If there is insufficient room on your device, you will be given information to help in adjusting your setti
ngs.
+This option sets the overlay size in mebibytes (integer values only). The overlay makes persistent storage available to the live operating system, if the operating system supports it. The persistent LiveOS overlay holds image-change snapshots (using write-once, difference-tracking storage) in the /LiveOS/overlay-<device_id> file, which, *one should note*, always grows in size due to the storage mechanism. (The fraction of allocated space that has been consumed may be displayed by issuing the 'dmsetup status' command in a terminal session of a running LiveOS installation.) One way to conserve the unrecoverable, overlay file space, is to specify a persistent home folder for user files, see --home-size-mb below. The target storage device must have enough free space for the image and the overlay. A maximum <size> of 4095 MiB is permitted for vfat-formatted devices. If there is insufficient room on your device, you will be given information to help in adjusting your setti
ngs.
=item --home-size-mb <size>
-Sets the home directory size in mebibytes (integer values only). A persistent home directory will be made in the /LiveOS/home.img filesystem image file. This file space is encrypted by default, but not compressed (one may bypass encryption with the --unencrypted-home installation option). Files in this home folder may be erased to recover and reuse their storage space. The target storage device must have enough free space for the image, any overlay, and the home directory. Note that the --delete-home option must also be selected to replace an existing persistent home with a new, empty one. A maximum <size> of 2047 MiB is permitted for vfat-formatted devices. If there is insufficient room on your device, you will be given information to help in adjusting your settings.
+Sets the home directory size in mebibytes (integer values only). A persistent home directory will be made in the /LiveOS/home.img filesystem image file. This file space is encrypted by default, but not compressed (one may bypass encryption with the --unencrypted-home installation option). Files in this home folder may be erased to recover and reuse their storage space. The target storage device must have enough free space for the image, any overlay, and the home directory. Note that the --delete-home option must also be selected to replace an existing persistent home with a new, empty one. A maximum <size> of 4095 MiB is permitted for vfat-formatted devices. If there is insufficient room on your device, you will be given information to help in adjusting your settings.
=item --delete-home
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 939de2f..c2950f7 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -214,7 +214,7 @@ usage() {
LiveOS installation.) One way to conserve the unrecoverable, overlay
file space, is to specify a persistent home folder for user files, see
--home-size-mb below. The target storage device must have enough free
- space for the image and the overlay. A maximum <size> of 2047 MiB is
+ space for the image and the overlay. A maximum <size> of 4095 MiB is
permitted for vfat-formatted devices. If there is insufficient room on
your device, you will be given information to help in adjusting your
settings.
@@ -229,7 +229,7 @@ usage() {
have enough free space for the image, any overlay, and the home
directory. Note that the --delete-home option must also be selected to
replace an existing persistent home with a new, empty one. A maximum
- <size> of 2047 MiB is permitted for vfat-formatted devices. If there is
+ <size> of 4095 MiB is permitted for vfat-formatted devices. If there is
insufficient room on your device, you will be given information to help
in adjusting your settings.
@@ -897,8 +897,8 @@ checkMBR $TGTDEV
if [ "$overlaysizemb" -gt 0 ]; then
- if [ "$TGTFS" = "vfat" -a "$overlaysizemb" -gt 2047 ]; then
- echo "Can't have an overlay of 2048MB or greater on VFAT"
+ if [ "$TGTFS" = "vfat" -a "$overlaysizemb" -gt 4095 ]; then
+ echo "Can't have an overlay of 4095MB or greater on VFAT"
exitclean
fi
LABEL=$(/sbin/blkid -s LABEL -o value $TGTDEV)
@@ -910,15 +910,15 @@ if [ "$overlaysizemb" -gt 0 ]; then
fi
if [ "$homesizemb" -gt 0 -a "$TGTFS" = "vfat" ]; then
- if [ "$homesizemb" -gt 2047 ]; then
- echo "Can't have a home overlay greater than 2048MB on VFAT"
+ if [ "$homesizemb" -gt 4095 ]; then
+ echo "Can't have a home overlay greater than 4095MB on VFAT"
exitclean
fi
fi
if [ "$swapsizemb" -gt 0 -a "$TGTFS" = "vfat" ]; then
- if [ "$swapsizemb" -gt 2047 ]; then
- echo "Can't have a swap file greater than 2048MB on VFAT"
+ if [ "$swapsizemb" -gt 4095 ]; then
+ echo "Can't have a swap file greater than 4095MB on VFAT"
exitclean
fi
fi
@@ -968,9 +968,9 @@ if [[ -n $skipcompress ]] && [[ -s $SRCMNT/LiveOS/squashfs.img ]]; then
if mount -o loop $SRCMNT/LiveOS/squashfs.img $SRCMNT; then
livesize=($(du -B 1M --apparent-size $SRCMNT/LiveOS/ext3fs.img))
umount $SRCMNT
- if ((livesize > 2048)) && [[ vfat == $TGTFS ]]; then
+ if ((livesize > 4095)) && [[ vfat == $TGTFS ]]; then
echo "
- An uncompressed image size greater than 2048 MB is not suitable
+ An uncompressed image size greater than 4095 MB is not suitable
for a VFAT-formatted device. The compressed SquashFS will be
copied to the target device.
"
10 years, 7 months
docs/livecd-iso-to-disk.pod tools/livecd-iso-to-disk.sh
by Brian C. Lane
docs/livecd-iso-to-disk.pod | 4 ++--
tools/livecd-iso-to-disk.sh | 20 ++++++++++----------
2 files changed, 12 insertions(+), 12 deletions(-)
New commits:
commit 16b6c36202f5a78bb8e7ada39d8dbce3075d9cf1
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Mon Aug 12 10:31:51 2013 -0700
Change vfat limit from 2047 to 4095 (#995552)
The actual filesystem limit is 2^32−1
diff --git a/docs/livecd-iso-to-disk.pod b/docs/livecd-iso-to-disk.pod
index bf52822..cef973f 100644
--- a/docs/livecd-iso-to-disk.pod
+++ b/docs/livecd-iso-to-disk.pod
@@ -117,11 +117,11 @@ Sets up a swap file of <size> mebibytes (integer values only) on the target devi
=item --overlay-size-mb <size>
-This option sets the overlay size in mebibytes (integer values only). The overlay makes persistent storage available to the live operating system, if the operating system supports it. The persistent LiveOS overlay holds image-change snapshots (using write-once, difference-tracking storage) in the /LiveOS/overlay-<device_id> file, which, *one should note*, always grows in size due to the storage mechanism. (The fraction of allocated space that has been consumed may be displayed by issuing the 'dmsetup status' command in a terminal session of a running LiveOS installation.) One way to conserve the unrecoverable, overlay file space, is to specify a persistent home folder for user files, see --home-size-mb below. The target storage device must have enough free space for the image and the overlay. A maximum <size> of 2047 MiB is permitted for vfat-formatted devices. If there is insufficient room on your device, you will be given information to help in adjusting your setti
ngs.
+This option sets the overlay size in mebibytes (integer values only). The overlay makes persistent storage available to the live operating system, if the operating system supports it. The persistent LiveOS overlay holds image-change snapshots (using write-once, difference-tracking storage) in the /LiveOS/overlay-<device_id> file, which, *one should note*, always grows in size due to the storage mechanism. (The fraction of allocated space that has been consumed may be displayed by issuing the 'dmsetup status' command in a terminal session of a running LiveOS installation.) One way to conserve the unrecoverable, overlay file space, is to specify a persistent home folder for user files, see --home-size-mb below. The target storage device must have enough free space for the image and the overlay. A maximum <size> of 4095 MiB is permitted for vfat-formatted devices. If there is insufficient room on your device, you will be given information to help in adjusting your setti
ngs.
=item --home-size-mb <size>
-Sets the home directory size in mebibytes (integer values only). A persistent home directory will be made in the /LiveOS/home.img filesystem image file. This file space is encrypted by default, but not compressed (one may bypass encryption with the --unencrypted-home installation option). Files in this home folder may be erased to recover and reuse their storage space. The target storage device must have enough free space for the image, any overlay, and the home directory. Note that the --delete-home option must also be selected to replace an existing persistent home with a new, empty one. A maximum <size> of 2047 MiB is permitted for vfat-formatted devices. If there is insufficient room on your device, you will be given information to help in adjusting your settings.
+Sets the home directory size in mebibytes (integer values only). A persistent home directory will be made in the /LiveOS/home.img filesystem image file. This file space is encrypted by default, but not compressed (one may bypass encryption with the --unencrypted-home installation option). Files in this home folder may be erased to recover and reuse their storage space. The target storage device must have enough free space for the image, any overlay, and the home directory. Note that the --delete-home option must also be selected to replace an existing persistent home with a new, empty one. A maximum <size> of 4095 MiB is permitted for vfat-formatted devices. If there is insufficient room on your device, you will be given information to help in adjusting your settings.
=item --delete-home
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index b0b5153..b38e3b2 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -214,7 +214,7 @@ usage() {
LiveOS installation.) One way to conserve the unrecoverable, overlay
file space, is to specify a persistent home folder for user files, see
--home-size-mb below. The target storage device must have enough free
- space for the image and the overlay. A maximum <size> of 2047 MiB is
+ space for the image and the overlay. A maximum <size> of 4095 MiB is
permitted for vfat-formatted devices. If there is insufficient room on
your device, you will be given information to help in adjusting your
settings.
@@ -229,7 +229,7 @@ usage() {
have enough free space for the image, any overlay, and the home
directory. Note that the --delete-home option must also be selected to
replace an existing persistent home with a new, empty one. A maximum
- <size> of 2047 MiB is permitted for vfat-formatted devices. If there is
+ <size> of 4095 MiB is permitted for vfat-formatted devices. If there is
insufficient room on your device, you will be given information to help
in adjusting your settings.
@@ -897,8 +897,8 @@ checkMBR $TGTDEV
if [ "$overlaysizemb" -gt 0 ]; then
- if [ "$TGTFS" = "vfat" -a "$overlaysizemb" -gt 2047 ]; then
- echo "Can't have an overlay of 2048MB or greater on VFAT"
+ if [ "$TGTFS" = "vfat" -a "$overlaysizemb" -gt 4095 ]; then
+ echo "Can't have an overlay of 4095MB or greater on VFAT"
exitclean
fi
LABEL=$(/sbin/blkid -s LABEL -o value $TGTDEV)
@@ -910,15 +910,15 @@ if [ "$overlaysizemb" -gt 0 ]; then
fi
if [ "$homesizemb" -gt 0 -a "$TGTFS" = "vfat" ]; then
- if [ "$homesizemb" -gt 2047 ]; then
- echo "Can't have a home overlay greater than 2048MB on VFAT"
+ if [ "$homesizemb" -gt 4095 ]; then
+ echo "Can't have a home overlay greater than 4095MB on VFAT"
exitclean
fi
fi
if [ "$swapsizemb" -gt 0 -a "$TGTFS" = "vfat" ]; then
- if [ "$swapsizemb" -gt 2047 ]; then
- echo "Can't have a swap file greater than 2048MB on VFAT"
+ if [ "$swapsizemb" -gt 4095 ]; then
+ echo "Can't have a swap file greater than 4095MB on VFAT"
exitclean
fi
fi
@@ -968,9 +968,9 @@ if [[ -n $skipcompress ]] && [[ -s $SRCMNT/LiveOS/squashfs.img ]]; then
if mount -o loop $SRCMNT/LiveOS/squashfs.img $SRCMNT; then
livesize=($(du -B 1M --apparent-size $SRCMNT/LiveOS/ext3fs.img))
umount $SRCMNT
- if ((livesize > 2048)) && [[ vfat == $TGTFS ]]; then
+ if ((livesize > 4095)) && [[ vfat == $TGTFS ]]; then
echo "
- An uncompressed image size greater than 2048 MB is not suitable
+ An uncompressed image size greater than 4095 MB is not suitable
for a VFAT-formatted device. The compressed SquashFS will be
copied to the target device.
"
10 years, 7 months
[PATCH] Boot a Live USB device as read-only after persisting some changes.
by Frederick Grose
In cases where one would like to make some changes or customizations
on an installed Live USB device and then protect the device
filesystems from further persistent changes, one can boot the device
with the rd.live.overlay.readonly option. This protects the root
operating filesystem, but leaves as read-write both the home.img
filesystem, if used, (needed for encrypting the /home contents) and
the base device filesystem, such as /dev/sdc1.
The following patches adjust the boot scripts dmsquash-live-root.sh
and livesys to enable the base device filesystem, livedev, and the
home.img filesystem, if present, to be mounted read-only at boot and
stay read-only during use. Temporary overlays are created in memory
for device-mapper snapshot targets for the filesystems to handle
non-persistent storage content.
Adjust the boot command line option from rw to ro to invoke the
read-only configuration on all of the discussed filesystems.
rd.live.overlay.readonly may be used as before to add a non-persistent
overlay over an existing persistent overlay to limit further root
filesystem changes. Adjust the /syslinux/syslinux.cfg or
extlinux.conf file on the device to standardize the desired default
configuration. Adjust further, if one wishes later to make more
persistent changes.
The following patches have been tested for the common configurations
described above. Special devspec or pathspec arguments for overlay=
or persistenthome= command line options should be further tested.
A method to call for the check of a persistent home filesystem before
mounting during the next boot has also been added.
--Fred
commit a6cd70fc9df2d299ed4f347461c33e4824df62f0
Author: Frederick Grose <fgrose(a)sugarlabs.org>
Date: Mon Aug 12 00:12:25 2013 -0400
Enable read-only mounting of a persistent home.img filesystem.
Enable one to call for filesystem checking of home.img before
mounting on the next boot.
diff --git a/fedora-live-base.ks b/fedora-live-base.ks
index 6c76e96..0512f67 100644
--- a/fedora-live-base.ks
+++ b/fedora-live-base.ks
@@ -116,9 +116,13 @@ mountPersistentHome() {
elif [ ! -b "\$homedev" ]; then
loopdev=\`losetup -f\`
if [ "\${homedev##/run/initramfs/live}" != "\${homedev}" ]; then
- action "Remounting live store r/w" mount -o remount,rw
/run/initramfs/live
+ if [ "\$liverw" = rw ]; then
+ action "Remounting live store r/w" mount -o remount,rw
/run/initramfs/live
+ else
+ opts="-r"
+ fi
fi
- losetup \$loopdev \$homedev
+ losetup \$opts \$loopdev \$homedev
homedev=\$loopdev
fi
@@ -130,6 +134,22 @@ mountPersistentHome() {
homedev=/dev/mapper/EncHome
fi
+ # If read-only is requested, prepare a non-persistent overlay and
snapshot target.
+ if [ "\$opts" = "-r" ]; then
+ dd if=/dev/null of=/run/initramfs/overlayfs/home_overlay bs=1024
count=1 seek=\$((512*1024)) 2> /dev/null
+ HOME_OVERLAY_LOOPDEV=\$(losetup -f)
+ losetup \$HOME_OVERLAY_LOOPDEV /run/initramfs/overlayfs/home_overlay
+ sz=\$(blockdev --getsz \$homedev)
+ echo 0 \$sz snapshot \$homedev \$HOME_OVERLAY_LOOPDEV N 8 |
dmsetup create home-rw
+ homedev=/dev/mapper/home-rw
+ fi
+
+ # Check the filesystem, if requested.
+ if [ -e /forcehomefsck ]; then
+ e2fsck -f -y -v \$homedev || e2fsck -f -y \$homedev
+ rm /forcehomefsck
+ fi
+
# and finally do the mount
mount \$mountopts \$homedev /home
# if we have /home under what's passed for persistent home, then
commit 96ff19a87c0be1eca27860aeef5434513b0e8c61
Author: Frederick Grose <fgrose(a)sugarlabs.org>
Date: Mon Aug 12 00:29:27 2013 -0400
Allow read-only mounting of the base device filesystem, livedev.
Use read-only loop devices and non-persistent overlay targets.
diff --git a/modules.d/90dmsquash-live/dmsquash-live-root.sh
b/modules.d/90dmsquash-live/dmsquash-live-root.sh
index 14e84e1..af0022f 100755
--- a/modules.d/90dmsquash-live/dmsquash-live-root.sh
+++ b/modules.d/90dmsquash-live/dmsquash-live-root.sh
@@ -24,7 +24,7 @@ squash_image=$(getarg rd.live.squashimg)
getargbool 0 rd.live.ram -d -y live_ram && live_ram="yes"
getargbool 0 rd.live.overlay.reset -d -y reset_overlay && reset_overlay="yes"
-getargbool 0 rd.live.overlay.readonly -d -y readonly_overlay &&
readonly_overlay="--readonly" || readonly_overlay=""
+getargbool 0 rd.live.overlay.readonly -d -y readonly_overlay &&
readonly_overlay="-r" || readonly_overlay=""
overlay=$(getarg rd.live.overlay -d overlay)
# CD/DVD media check
@@ -105,17 +105,23 @@ do_live_overlay() {
setup=""
if [ -n "$devspec" -a -n "$pathspec" -a -n "$overlay" ]; then
mkdir -m 0755 /run/initramfs/overlayfs
- mount -n -t auto $devspec /run/initramfs/overlayfs || :
- if [ -f /run/initramfs/overlayfs$pathspec -a -w
/run/initramfs/overlayfs$pathspec ]; then
- losetup $OVERLAY_LOOPDEV /run/initramfs/overlayfs$pathspec
- if [ -n "$reset_overlay" ]; then
- dd if=/dev/zero of=$OVERLAY_LOOPDEV bs=64k count=1
conv=fsync 2>/dev/null
+ mount -n -t auto -o $liverw $devspec /run/initramfs/overlayfs || :
+ if [ -f /run/initramfs/overlayfs$pathspec ]; then
+ if [ "$liverw" = ro ]; then
+ readonly_overlay='-r'
+ fi
+ losetup $readonly_overlay $OVERLAY_LOOPDEV
/run/initramfs/overlayfs$pathspec
+ if [ -w /run/initramfs/overlayfs$pathspec ]; then
+ if [ -n "$reset_overlay" ]; then
+ dd if=/dev/zero of=$OVERLAY_LOOPDEV bs=64k
count=1 conv=fsync 2>/dev/null
+ fi
fi
setup="yes"
fi
umount -l /run/initramfs/overlayfs || :
fi
+ persistent='P'
if [ -z "$setup" -o -n "$readonly_overlay" ]; then
if [ -n "$setup" ]; then
warn "Using temporary overlay."
@@ -123,6 +129,7 @@ do_live_overlay() {
warn "Unable to find persistent overlay; using temporary"
sleep 5
fi
+ persistent='N'
dd if=/dev/null of=/overlay bs=1024 count=1
seek=$((512*1024)) 2> /dev/null
if [ -n "$setup" -a -n "$readonly_overlay" ]; then
@@ -136,14 +143,14 @@ do_live_overlay() {
# set up the snapshot
sz=$(blockdev --getsz $BASE_LOOPDEV)
if [ -n "$readonly_overlay" ]; then
- echo 0 $sz snapshot $BASE_LOOPDEV $OVERLAY_LOOPDEV p 8 |
dmsetup create $readonly_overlay live-ro
+ echo 0 $sz snapshot $BASE_LOOPDEV $OVERLAY_LOOPDEV N 8 |
dmsetup create $readonly_overlay live-ro
base="/dev/mapper/live-ro"
over=$RO_OVERLAY_LOOPDEV
else
base=$BASE_LOOPDEV
over=$OVERLAY_LOOPDEV
fi
- echo 0 $sz snapshot $base $over p 8 | dmsetup create live-rw
+ echo 0 $sz snapshot $base $over $persistent 8 | dmsetup create live-rw
}
# live cd helper function
@@ -217,7 +224,7 @@ fi
if [ -b "$OSMIN_LOOPDEV" ]; then
# set up the devicemapper snapshot device, which will merge
# the normal live fs image, and the delta, into a minimzied fs image
- echo "0 $( blockdev --getsz $BASE_LOOPDEV ) snapshot
$BASE_LOOPDEV $OSMIN_LOOPDEV p 8" | dmsetup create --readonly
live-osimg-min
+ echo "0 $( blockdev --getsz $BASE_LOOPDEV ) snapshot
$BASE_LOOPDEV $OSMIN_LOOPDEV N 8" | dmsetup create --readonly
live-osimg-min
fi
ROOTFLAGS="$(getarg rootflags)"
10 years, 7 months