Bug 1475604 - livecd-iso-to-disk fails to create overlay
Summary: livecd-iso-to-disk fails to create overlay
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: livecd-tools
Version: 26
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Neal Gompa
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-07-27 00:37 UTC by Matthew Saltzman
Modified: 2017-11-14 08:50 UTC (History)
9 users (show)

Fixed In Version: livecd-tools-25.0-1.fc26 livecd-tools-25.0-1.fc27 livecd-tools-25.0-1.fc25
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-10-30 16:18:41 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
ignore lsblk error (598 bytes, patch)
2017-07-29 23:44 UTC, Frederick Grose
no flags Details | Diff

Description Matthew Saltzman 2017-07-27 00:37:32 UTC
Description of problem:
livecd-iso-to-disk with the option --overlay-size-mb returns immediately with no error or status message, does not write to USB drive.

Version-Release number of selected component (if applicable):
livecd-tools-24.4-1.fc26.x86_64

How reproducible:
Always

Steps to Reproduce:
1. su -c "livecd-iso-to-disk --format --reset-mbr --overlay-size-mb 2048 Fedora-Workstation-Live-x86_64-26-1.5.iso /dev/sda"
2.
3.

Actual results:
Returns to prompt immediately with no message or action

Expected results:
Prompt about destroying all data, then writes image to USB drive.

Additional info:
USB drive was 8GB, so should not be a space issue. Removing the --overlay-size-mb option works as expected. Removing the --home-size-mb option exhibits the error.

Comment 1 Frederick Grose 2017-07-27 01:53:28 UTC
That command line worked for me.  Could you edit line 1 of /usr/bin/livecd-iso-to-disk to request xtracing:
#!/bin/bash -x

And provide the transcript?

Comment 2 Matthew Saltzman 2017-07-27 14:20:28 UTC
(In reply to Frederick Grose from comment #1)
> That command line worked for me.  Could you edit line 1 of
> /usr/bin/livecd-iso-to-disk to request xtracing:
> #!/bin/bash -x
> 
> And provide the transcript?

With the --overlay-size-mb option:

$ su -c "/home/mjs/bin/livecd-iso-to-disk --format --reset-mbr --overlay-size-mb 2048 Fedora-Workstation-Live-x86_64-26-1.5.iso /dev/sda"
Password: 
+ export PATH=/sbin:/usr/sbin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/mjs/.local/bin:/home/mjs/bin
+ PATH=/sbin:/usr/sbin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/mjs/.local/bin:/home/mjs/bin
+ [[ /home/mjs/bin/livecd-iso-to-disk --format --reset-mbr --overlay-size-mb 2048 Fedora-Workstation-Live-x86_64-26-1.5.iso /dev/sda =~ -help| -h|-\? ]]
++ id -u
+ [[ 0 != 0 ]]
+ ((  6 < 2  ))
+ type rsync
+ copyFile='rsync --inplace --8-bit-output --progress'
+ set -e
+ set -o pipefail
+ trap exitclean EXIT
+ shopt -s extglob
+ cryptedhome=1
+ keephome=1
+ homesizemb=0
+ swapsizemb=0
+ overlaysizemb=0
+ resetoverlay=
+ overlay=
+ srctype=
+ imgtype=
+ packages=
+ LIVEOS=LiveOS
+ HOMEFILE=home.img
+ updates=
+ ks=
+ label=
+ true
+ case $1 in
+ format=1
+ shift
+ true
+ case $1 in
+ resetmbr=1
+ shift
+ true
+ case $1 in
+ checkint 2048
+ case $2 in
+ [[ 2048 == [1-9]*([0-9]) ]]
+ overlaysizemb=2048
+ shift
+ shift
+ true
+ case $1 in
+ break
+ [[ 2 -ne 2 ]]
++ readlink -f Fedora-Workstation-Live-x86_64-26-1.5.iso
+ SRC=/home/mjs/Downloads/Fedora-Workstation-Live-x86_64-26-1.5.iso
++ readlink -f /dev/sda
+ TGTDEV=/dev/sda
+ [[ -z /home/mjs/Downloads/Fedora-Workstation-Live-x86_64-26-1.5.iso ]]
+ [[ -b /home/mjs/Downloads/Fedora-Workstation-Live-x86_64-26-1.5.iso ]]
+ [[ -f /home/mjs/Downloads/Fedora-Workstation-Live-x86_64-26-1.5.iso ]]
+ [[ -z /dev/sda ]]
+ [[ -b /dev/sda ]]
+ checkSyslinuxVersion
+ type syslinux
+ checkMounted /dev/sda
+ local dev=/dev/sda
+ for d in $dev*
++ findmnt -nro TARGET /dev/sda
+ local mountpoint=
+ [[ -n '' ]]
++ swapon -s
+ [[ Filename				Type		Size	Used	Priority
/dev/dm-1                              	partition	8187900	0	-1 =~ /dev/sda ]]
+ checkFilesystem /dev/sda
+ local dev=/dev/sda
++ blkid -s TYPE -o value /dev/sda
++ :
+ TGTFS=
+ [[ -n 1 ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ type extlinux
+ TGTFS=ext4
+ [[ ext4 != @(vfat|msdos|ext[234]|btrfs) ]]
+ [[ ext4 == @(vfat|msdos) ]]
+ [[ LiveOS =~ [[:space:]] ]]
+ [[ '' == none ]]
+ (( overlaysizemb > 0 ))
+ [[ ext4 == @(vfat|msdos) ]]
+ [[ -z '' ]]
++ lsblk -no LABEL /dev/sda
+ label=
+ exitclean
+ RETVAL=32
+ [[ -d '' ]]
+ [[ -d '' ]]
+ exit 32


=============================================================================
Without the offending option:

$ su -c "/home/mjs/bin/livecd-iso-to-disk --format --reset-mbr Fedora-Workstation-Live-x86_64-26-1.5.iso /dev/sda"Password: 
+ export PATH=/sbin:/usr/sbin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/mjs/.local/bin:/home/mjs/bin
+ PATH=/sbin:/usr/sbin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/mjs/.local/bin:/home/mjs/bin
+ [[ /home/mjs/bin/livecd-iso-to-disk --format --reset-mbr Fedora-Workstation-Live-x86_64-26-1.5.iso /dev/sda =~ -help| -h|-\? ]]
++ id -u
+ [[ 0 != 0 ]]
+ ((  4 < 2  ))
+ type rsync
+ copyFile='rsync --inplace --8-bit-output --progress'
+ set -e
+ set -o pipefail
+ trap exitclean EXIT
+ shopt -s extglob
+ cryptedhome=1
+ keephome=1
+ homesizemb=0
+ swapsizemb=0
+ overlaysizemb=0
+ resetoverlay=
+ overlay=
+ srctype=
+ imgtype=
+ packages=
+ LIVEOS=LiveOS
+ HOMEFILE=home.img
+ updates=
+ ks=
+ label=
+ true
+ case $1 in
+ format=1
+ shift
+ true
+ case $1 in
+ resetmbr=1
+ shift
+ true
+ case $1 in
+ break
+ [[ 2 -ne 2 ]]
++ readlink -f Fedora-Workstation-Live-x86_64-26-1.5.iso
+ SRC=/home/mjs/Downloads/Fedora-Workstation-Live-x86_64-26-1.5.iso
++ readlink -f /dev/sda
+ TGTDEV=/dev/sda
+ [[ -z /home/mjs/Downloads/Fedora-Workstation-Live-x86_64-26-1.5.iso ]]
+ [[ -b /home/mjs/Downloads/Fedora-Workstation-Live-x86_64-26-1.5.iso ]]
+ [[ -f /home/mjs/Downloads/Fedora-Workstation-Live-x86_64-26-1.5.iso ]]
+ [[ -z /dev/sda ]]
+ [[ -b /dev/sda ]]
+ checkSyslinuxVersion
+ type syslinux
+ checkMounted /dev/sda
+ local dev=/dev/sda
+ for d in $dev*
++ findmnt -nro TARGET /dev/sda
+ local mountpoint=
+ [[ -n '' ]]
++ swapon -s
+ [[ Filename				Type		Size	Used	Priority
/dev/dm-1                              	partition	8187900	0	-1 =~ /dev/sda ]]
+ checkFilesystem /dev/sda
+ local dev=/dev/sda
++ blkid -s TYPE -o value /dev/sda
++ :
+ TGTFS=
+ [[ -n 1 ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ type extlinux
+ TGTFS=ext4
+ [[ ext4 != @(vfat|msdos|ext[234]|btrfs) ]]
+ [[ ext4 == @(vfat|msdos) ]]
+ [[ LiveOS =~ [[:space:]] ]]
+ [[ '' == none ]]
+ (( overlaysizemb > 0 ))
+ (( homesizemb > 0 ))
+ (( swapsizemb > 0 ))
+ [[ -z '' ]]
++ file -br /home/mjs/Downloads/Fedora-Workstation-Live-x86_64-26-1.5.iso
+ [[ DOS/MBR boot sector; partition 2 : ID=0xef, start-CHS (0x3ff,254,63), end-CHS (0x3ff,254,63), startsector 104772, 13004 sectors == ISO\ 9660\ * ]]
++ mktemp -d /run/srctmp.XXXXXX
+ SRCMNT=/run/srctmp.UhIi1K
+ srcmountopts='-o ro'
+ [[ -f /home/mjs/Downloads/Fedora-Workstation-Live-x86_64-26-1.5.iso ]]
+ srcmountopts+=,loop
+ mount -o ro,loop /home/mjs/Downloads/Fedora-Workstation-Live-x86_64-26-1.5.iso /run/srctmp.UhIi1K
+ trap exitclean SIGINT SIGTERM
+ detectsrctype
+ [[ -e /run/srctmp.UhIi1K/Packages ]]
+ local 'cmdline=BOOT_IMAGE=/vmlinuz-4.11.11-300.fc26.x86_64 root=/dev/mapper/fedora_thinkpad-root ro rd.lvm.lv=fedora_thinkpad/root rd.lvm.lv=fedora_thinkpad/swap rhgb quiet LANG=en_US.UTF-8'
+ local len=174
+ [[ -z '' ]]
+ livedir='BOOT_IMAGE=/vmlinuz-4.11.11-300.fc26.x86_64 root=/dev/mapper/fedora_thinkpad-root ro rd.lvm.lv=fedora_thinkpad/root rd.lvm.lv=fedora_thinkpad/swap rhgb quiet LANG=en_US.UTF-8'
+ [[ 174 == 174 ]]
+ livedir=LiveOS
+ squashimg='BOOT_IMAGE=/vmlinuz-4.11.11-300.fc26.x86_64 root=/dev/mapper/fedora_thinkpad-root ro rd.lvm.lv=fedora_thinkpad/root rd.lvm.lv=fedora_thinkpad/swap rhgb quiet LANG=en_US.UTF-8'
+ [[ 174 == 174 ]]
+ squashimg=squashfs.img
+ liveram='BOOT_IMAGE=/vmlinuz-4.11.11-300.fc26.x86_64 root=/dev/mapper/fedora_thinkpad-root ro rd.lvm.lv=fedora_thinkpad/root rd.lvm.lv=fedora_thinkpad/swap rhgb quiet LANG=en_US.UTF-8'
+ [[ 174 == 174 ]]
+ liveram=
+ writable_fsimg='BOOT_IMAGE=/vmlinuz-4.11.11-300.fc26.x86_64 root=/dev/mapper/fedora_thinkpad-root ro rd.lvm.lv=fedora_thinkpad/root rd.lvm.lv=fedora_thinkpad/swap rhgb quiet LANG=en_US.UTF-8'
+ [[ 174 != 174 ]]
+ [[ -n '' ]]
+ for f in "$SRCMNT/$livedir/$squashimg" "$SRCMNT/$livedir/rootfs.img" "$SRCMNT/$livedir/ext3fs.img"
+ [[ -e /run/srctmp.UhIi1K/LiveOS/squashfs.img ]]
+ SRCIMG=/run/srctmp.UhIi1K/LiveOS/squashfs.img
+ srctype=live
+ break
+ [[ -n live ]]
+ return
+ [[ -n 1 ]]
+ [[ -z '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ type extlinux
+ createEXTFSLayout /dev/sda
+ local dev=/dev/sda
+ getdisk /dev/sda
+ DEV=/dev/sda
+ isdevloop /dev/sda
+ [[ x/dev/sda != x/dev/sda ]]
++ udevadm info -q path -n /dev/sda
+ p=/devices/pci0000:00/0000:00:14.0/usb2/2-3/2-3:1.0/host0/target0:0:0/0:0:0:0/block/sda
+ [[ -n '' ]]
+ [[ -e /sys//devices/pci0000:00/0000:00:14.0/usb2/2-3/2-3:1.0/host0/target0:0:0/0:0:0:0/block/sda/device ]]
+ device=sda
+ [[ -z sda ]]
+ [[ ! -e /sys/block/sda ]]
+ [[ ! -e /dev/sda ]]
+ device=/dev/sda
+ p=/dev/sda
+ p=
+ partnum=
+ printf '\n    WARNING: This will DESTROY ALL DATA on: %s !!\n
        Press Enter to continue, or Ctrl C to abort.\n' /dev/sda

    WARNING: This will DESTROY ALL DATA on: /dev/sda !!

        Press Enter to continue, or Ctrl C to abort.
+ read
^C++ exitclean
++ RETVAL=0
++ [[ -d /run/srctmp.UhIi1K ]]
++ [[ 0 == 0 ]]
++ cleanup
++ sleep 2
++ [[ -d /run/srctmp.UhIi1K ]]
++ umount /run/srctmp.UhIi1K
++ rmdir /run/srctmp.UhIi1K
++ [[ -d '' ]]
+ exitclean
+ RETVAL=1
+ [[ -d /run/srctmp.UhIi1K ]]
+ [[ -d '' ]]
+ exit 1

Comment 3 Frederick Grose 2017-07-29 23:44:38 UTC
Created attachment 1306419 [details]
ignore lsblk error

Curious. Return code 32 for lsblk indicates "not found all specified devices".

Please try this patch.

Comment 4 Matthew Saltzman 2017-07-30 00:06:58 UTC
(In reply to Frederick Grose from comment #3)
> Created attachment 1306419 [details]
> ignore lsblk error
> 
> Curious. Return code 32 for lsblk indicates "not found all specified
> devices".
> 
> Please try this patch.

A little progress:

$ su -c "/home/mjs/bin/livecd-iso-to-disk --format --reset-mbr --overlay-size-mb 2048 Fedora-Workstation-Live-x86_64-26-1.5.iso /dev/sda"
Password: 
+ export PATH=/sbin:/usr/sbin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/mjs/.local/bin:/home/mjs/bin
+ PATH=/sbin:/usr/sbin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/mjs/.local/bin:/home/mjs/bin
+ [[ /home/mjs/bin/livecd-iso-to-disk --format --reset-mbr --overlay-size-mb 2048 Fedora-Workstation-Live-x86_64-26-1.5.iso /dev/sda =~ -help| -h|-\? ]]
++ id -u
+ [[ 0 != 0 ]]
+ ((  6 < 2  ))
+ type rsync
+ copyFile='rsync --inplace --8-bit-output --progress'
+ set -e
+ set -o pipefail
+ trap exitclean EXIT
+ shopt -s extglob
+ cryptedhome=1
+ keephome=1
+ homesizemb=0
+ swapsizemb=0
+ overlaysizemb=0
+ resetoverlay=
+ overlay=
+ srctype=
+ imgtype=
+ packages=
+ LIVEOS=LiveOS
+ HOMEFILE=home.img
+ updates=
+ ks=
+ label=
+ true
+ case $1 in
+ format=1
+ shift
+ true
+ case $1 in
+ resetmbr=1
+ shift
+ true
+ case $1 in
+ checkint 2048
+ case $2 in
+ [[ 2048 == [1-9]*([0-9]) ]]
+ overlaysizemb=2048
+ shift
+ shift
+ true
+ case $1 in
+ break
+ [[ 2 -ne 2 ]]
++ readlink -f Fedora-Workstation-Live-x86_64-26-1.5.iso
+ SRC=/home/mjs/Downloads/Fedora-Workstation-Live-x86_64-26-1.5.iso
++ readlink -f /dev/sda
+ TGTDEV=/dev/sda
+ [[ -z /home/mjs/Downloads/Fedora-Workstation-Live-x86_64-26-1.5.iso ]]
+ [[ -b /home/mjs/Downloads/Fedora-Workstation-Live-x86_64-26-1.5.iso ]]
+ [[ -f /home/mjs/Downloads/Fedora-Workstation-Live-x86_64-26-1.5.iso ]]
+ [[ -z /dev/sda ]]
+ [[ -b /dev/sda ]]
+ checkSyslinuxVersion
+ type syslinux
+ checkMounted /dev/sda
+ local dev=/dev/sda
+ for d in $dev*
++ findmnt -nro TARGET /dev/sda
+ local mountpoint=
+ [[ -n '' ]]
++ swapon -s
+ [[ Filename				Type		Size	Used	Priority
/dev/dm-1                              	partition	8187900	72484	-1 =~ /dev/sda ]]
+ checkFilesystem /dev/sda
+ local dev=/dev/sda
++ blkid -s TYPE -o value /dev/sda
++ :
+ TGTFS=
+ [[ -n 1 ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ type extlinux
+ TGTFS=ext4
+ [[ ext4 != @(vfat|msdos|ext[234]|btrfs) ]]
+ [[ ext4 == @(vfat|msdos) ]]
+ [[ LiveOS =~ [[:space:]] ]]
+ [[ '' == none ]]
+ (( overlaysizemb > 0 ))
+ [[ ext4 == @(vfat|msdos) ]]
+ [[ -z '' ]]
++ lsblk -no LABEL /dev/sda
++ :
+ label=
+ label=
+ label=
+ [[ '' =~ [[:space:]] ]]
+ (( homesizemb > 0 ))
+ (( swapsizemb > 0 ))
+ [[ -z '' ]]
++ file -br /home/mjs/Downloads/Fedora-Workstation-Live-x86_64-26-1.5.iso
+ [[ DOS/MBR boot sector; partition 2 : ID=0xef, start-CHS (0x3ff,254,63), end-CHS (0x3ff,254,63), startsector 104772, 13004 sectors == ISO\ 9660\ * ]]
++ mktemp -d /run/srctmp.XXXXXX
+ SRCMNT=/run/srctmp.v4smKv
+ srcmountopts='-o ro'
+ [[ -f /home/mjs/Downloads/Fedora-Workstation-Live-x86_64-26-1.5.iso ]]
+ srcmountopts+=,loop
+ mount -o ro,loop /home/mjs/Downloads/Fedora-Workstation-Live-x86_64-26-1.5.iso /run/srctmp.v4smKv
+ trap exitclean SIGINT SIGTERM
+ detectsrctype
+ [[ -e /run/srctmp.v4smKv/Packages ]]
+ local 'cmdline=BOOT_IMAGE=/vmlinuz-4.11.11-300.fc26.x86_64 root=/dev/mapper/fedora_thinkpad-root ro rd.lvm.lv=fedora_thinkpad/root rd.lvm.lv=fedora_thinkpad/swap rhgb quiet LANG=en_US.UTF-8'
+ local len=174
+ [[ -z '' ]]
+ livedir='BOOT_IMAGE=/vmlinuz-4.11.11-300.fc26.x86_64 root=/dev/mapper/fedora_thinkpad-root ro rd.lvm.lv=fedora_thinkpad/root rd.lvm.lv=fedora_thinkpad/swap rhgb quiet LANG=en_US.UTF-8'
+ [[ 174 == 174 ]]
+ livedir=LiveOS
+ squashimg='BOOT_IMAGE=/vmlinuz-4.11.11-300.fc26.x86_64 root=/dev/mapper/fedora_thinkpad-root ro rd.lvm.lv=fedora_thinkpad/root rd.lvm.lv=fedora_thinkpad/swap rhgb quiet LANG=en_US.UTF-8'
+ [[ 174 == 174 ]]
+ squashimg=squashfs.img
+ liveram='BOOT_IMAGE=/vmlinuz-4.11.11-300.fc26.x86_64 root=/dev/mapper/fedora_thinkpad-root ro rd.lvm.lv=fedora_thinkpad/root rd.lvm.lv=fedora_thinkpad/swap rhgb quiet LANG=en_US.UTF-8'
+ [[ 174 == 174 ]]
+ liveram=
+ writable_fsimg='BOOT_IMAGE=/vmlinuz-4.11.11-300.fc26.x86_64 root=/dev/mapper/fedora_thinkpad-root ro rd.lvm.lv=fedora_thinkpad/root rd.lvm.lv=fedora_thinkpad/swap rhgb quiet LANG=en_US.UTF-8'
+ [[ 174 != 174 ]]
+ [[ -n '' ]]
+ for f in "$SRCMNT/$livedir/$squashimg" "$SRCMNT/$livedir/rootfs.img" "$SRCMNT/$livedir/ext3fs.img"
+ [[ -e /run/srctmp.v4smKv/LiveOS/squashfs.img ]]
+ SRCIMG=/run/srctmp.v4smKv/LiveOS/squashfs.img
+ srctype=live
+ break
+ [[ -n live ]]
+ return
+ [[ -n 1 ]]
+ [[ -z '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ type extlinux
+ createEXTFSLayout /dev/sda
+ local dev=/dev/sda
+ getdisk /dev/sda
+ DEV=/dev/sda
+ isdevloop /dev/sda
+ [[ x/dev/sda != x/dev/sda ]]
++ udevadm info -q path -n /dev/sda
+ p=/devices/pci0000:00/0000:00:14.0/usb2/2-6/2-6:1.0/host0/target0:0:0/0:0:0:0/block/sda
+ [[ -n '' ]]
+ [[ -e /sys//devices/pci0000:00/0000:00:14.0/usb2/2-6/2-6:1.0/host0/target0:0:0/0:0:0:0/block/sda/device ]]
+ device=sda
+ [[ -z sda ]]
+ [[ ! -e /sys/block/sda ]]
+ [[ ! -e /dev/sda ]]
+ device=/dev/sda
+ p=/dev/sda
+ p=
+ partnum=
+ printf '\n    WARNING: This will DESTROY ALL DATA on: %s !!\n
        Press Enter to continue, or Ctrl C to abort.\n' /dev/sda

    WARNING: This will DESTROY ALL DATA on: /dev/sda !!

        Press Enter to continue, or Ctrl C to abort.
+ read

+ umount /dev/sda
+ :
+ wipefs -a /dev/sda
wipefs: error: /dev/sda: probing initialization failed: No medium found
+ exitclean
+ RETVAL=1
+ [[ -d /run/srctmp.v4smKv ]]
+ [[ 1 == 0 ]]
+ echo 'Cleaning up to exit...'
Cleaning up to exit...
+ cleanup
+ sleep 2
+ [[ -d /run/srctmp.v4smKv ]]
+ umount /run/srctmp.v4smKv
+ rmdir /run/srctmp.v4smKv
+ [[ -d '' ]]

Comment 5 Matthew Saltzman 2017-07-30 00:09:26 UTC
Something I noticed: When the device is plugged in and mounted, I have /dev/sda, /dev/sda1, and /dev/sg0. When I unmount the device, I have /dev/sda and /dev/sg0. When I unplug the device, both /dev/sda and /dev/sg0 are removed.

Should I be writing to /dev/sg0 instead?

Comment 6 Frederick Grose 2017-07-30 00:45:13 UTC
(In reply to Matthew Saltzman from comment #5)
> ... When the device is plugged in and mounted, I have
> /dev/sda, /dev/sda1, and /dev/sg0. When I unmount the device, I have
> /dev/sda and /dev/sg0. When I unplug the device, both /dev/sda and /dev/sg0
> are removed.

That's 2 disks in the unit.  Is it something special?

What does
$ sudo fdisk -l /dev/sda /dev/sg0
report?
> 
> Should I be writing to /dev/sg0 instead?

Perhaps.

Comment 7 Matthew Saltzman 2017-07-30 01:00:22 UTC
(In reply to Frederick Grose from comment #6)
> (In reply to Matthew Saltzman from comment #5)
> > ... When the device is plugged in and mounted, I have
> > /dev/sda, /dev/sda1, and /dev/sg0. When I unmount the device, I have
> > /dev/sda and /dev/sg0. When I unplug the device, both /dev/sda and /dev/sg0
> > are removed.
> 
> That's 2 disks in the unit.  Is it something special?

Nope, straight out of the shrink-wrap (other than any thing I've done to it trying to do this.

> 
> What does
> $ sudo fdisk -l /dev/sda /dev/sg0
> report?

With the drive plugged in and unmounted:

$ sudo fdisk -l /dev/sda /dev/sg0
[sudo] password for mjs: 
fdisk: cannot open /dev/sda: No medium found


fdisk: cannot open /dev/sg0: Illegal seek

With the drive plugged in and mounted:

$ sudo fdisk -l /dev/sda /dev/sg0
Disk /dev/sda: 7.2 GiB, 7751073792 bytes, 15138816 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x27cf51cb

Device     Boot Start      End  Sectors  Size Id Type
/dev/sda1  *     8064 15138815 15130752  7.2G  c W95 FAT32 (LBA)


fdisk: cannot open /dev/sg0: Illegal seek


> > 
> > Should I be writing to /dev/sg0 instead?
> 
> Perhaps.

Comment 8 Matthew Saltzman 2017-07-30 01:02:48 UTC
> > 
> > Should I be writing to /dev/sg0 instead?
> 
> Perhaps.

Tried it, but /dev/sg0 is not a block device.

Comment 9 Frederick Grose 2017-07-30 01:25:51 UTC
Well the wipefs and fdisk messages with the unmounted disk seems to indicate that there is some intervening firmware on the device.

Do you need to reformat to an ext4 filesystem for some reason?  If so, you may need to use another tool, perhaps gnome.disk.utility (Disks).

You could install the image into the existing FAT32 volume by leaving out the --format option.

Comment 10 Matthew Saltzman 2017-07-30 11:00:13 UTC
Tried a few things to write to the existing FAT32 volume and discovered the following:

Inserting the device creates /dev/sda. /dev/sda1, and /dev/sg0 and mounts /dev/sda1. Then in GNOME, I get a prompt to open Nautilus with the files on /dev/sda1.

I already know not to write to /dev/sda1 while it is mounted.  Attempting to write the image to /dev/sda while /dev/sda1 is mounted results in a complaint that the device doesn't contain a file system. 

Hitting the eject button in Nautilus causes /dev/sda1 to disappear. Attempting to write to /dev/sda1 then results in a complaint that /dev/sda1 is not a block device. Attempting to mount /dev/sda1 manually fails because the device entry doesn't exist.

If instead of pressing eject in Nautilus, I manually umount /dev/sda1, /dev/sda1 does not disappear. Then, writing the image to /dev/sda1 (without the --format option) actually works. (Well, I haven't tried booting from the image yet...)

So the problem isn't with the script, it's apparently with the interaction between Nautilus and my expectations. Possibly some documentation changes for this tool could clarify how to make sure the device entry for the partition one wants to write to exists even if the partition isn't mounted?

Thanks for your patience working with me on this.

Comment 11 Frederick Grose 2017-07-30 16:23:16 UTC
(In reply to Matthew Saltzman from comment #10)
> So the problem isn't with the script,

Well, the --format option fails on your device.  Could you share the make and model so we can investigate further? The gnome.disk.utility (Disks) tool should help in obtaining information and seeing the status of partitions on the disk.

We should write code to avoid what you experienced.

Comment 12 Matthew Saltzman 2017-07-30 19:22:09 UTC
(In reply to Frederick Grose from comment #11)
> (In reply to Matthew Saltzman from comment #10)
> > So the problem isn't with the script,
> 
> Well, the --format option fails on your device.  Could you share the make
> and model so we can investigate further? The gnome.disk.utility (Disks) tool
> should help in obtaining information and seeing the status of partitions on
> the disk.
> 
> We should write code to avoid what you experienced.

Yeah, that occurred to me after I posted.

The machine in question is a ThinkPad Yoga X1 (1st generation). The main drive is a 256GB SSD. The Disk utility doesn't give any information about make or model. The USB drive is a Kingston USB 3.0 8GB. What else do you need?

Comment 13 Frederick Grose 2017-07-31 02:38:53 UTC
(In reply to Matthew Saltzman from comment #12)
> The USB drive is a Kingston USB 3.0 8GB.

There are a lot of those.  Could you provide a link to your model on Amazon?  Thanks!

Comment 14 Matthew Saltzman 2017-07-31 08:08:04 UTC
(In reply to Frederick Grose from comment #13)
> (In reply to Matthew Saltzman from comment #12)
> > The USB drive is a Kingston USB 3.0 8GB.
> 
> There are a lot of those.  Could you provide a link to your model on Amazon?
> Thanks!

Interestingly, not precisely. It's this one (DTSE9 G2), but only 8GB:

https://www.kingston.com/us/usb/personal_business/dtse9g2

Comment 15 Fedora Update System 2017-10-21 18:49:24 UTC
livecd-tools-25.0-1.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2017-86b225030b

Comment 16 Fedora Update System 2017-10-21 18:50:03 UTC
livecd-tools-25.0-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-56598fe991

Comment 17 Fedora Update System 2017-10-21 18:50:55 UTC
livecd-tools-25.0-1.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-4c20585902

Comment 18 Fedora Update System 2017-10-22 02:26:09 UTC
livecd-tools-25.0-1.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-56598fe991

Comment 19 Fedora Update System 2017-10-22 03:25:28 UTC
livecd-tools-25.0-1.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-4c20585902

Comment 20 Fedora Update System 2017-10-23 00:50:59 UTC
livecd-tools-25.0-1.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-86b225030b

Comment 21 Fedora Update System 2017-10-30 16:18:41 UTC
livecd-tools-25.0-1.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.

Comment 22 Fedora Update System 2017-11-11 03:00:33 UTC
livecd-tools-25.0-1.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.

Comment 23 Fedora Update System 2017-11-14 08:50:25 UTC
livecd-tools-25.0-1.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.