Page 124 of 128 FirstFirst ... 2474114122123124125126 ... LastLast
Results 1,231 to 1,240 of 1271

Thread: Howto make USB boot drives

  1. #1231
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: Howto make USB boot drives

    @guiverc,

    I'm glad that you find diff_image_drive useful

    Intuitively I did not expect that running a live (live-only) system would modify the cloned part of its boot drive.

    But after some thinking, yes, it will write behind the cloned part (create a partition labeled 'writable' and write log files and possible crashdumps there). And when creating the partition there will be an entry in the partition table at the head of the drive (otherwise the partition would not be detected), and this will modify the sha256sum, so that the drive will no longer match the iso file.

    This might/should be avoid when using the boot option nopersistent. I intend to check this.

    Is it a big problem for you, that the sha256sum check works only before the drive is booted from?

    - Would you want some other tool, for example that would check on the file level, that all the files in the iso file and in the cloned part of the target drive match? I think it should be possible using rsync with the option -c (--checksum).

    - Would it be an option to skip the first few bytes, where the partition table resides, and compare the rest of the content of the iso file and drive?

  2. #1232
    Join Date
    Aug 2017
    Location
    melbourne, au
    Beans
    Hidden!
    Distro
    Lubuntu Development Release

    Re: Howto make USB boot drives

    Quote Originally Posted by sudodus View Post
    @guiverc,

    I'm glad that you find diff_image_drive useful

    Intuitively I did not expect that running a live (live-only) system would modify the cloned part of its boot drive.

    But after some thinking, yes, it will write behind the cloned part (create a partition labeled 'writable' and write log files and possible crashdumps there). And when creating the partition there will be an entry in the partition table at the head of the drive (otherwise the partition would not be detected), and this will modify the sha256sum, so that the drive will no longer match the iso file.

    This might/should be avoid when using the boot option nopersistent. I intend to check this.

    Is it a big problem for you, that the sha256sum check works only before the drive is booted from?

    - Would you want some other tool, for example that would check on the file level, that all the files in the iso file and in the cloned part of the target drive match? I think it should be possible using rsync with the option -c (--checksum).

    - Would it be an option to skip the first few bytes, where the partition table resides, and compare the rest of the content of the iso file and drive?
    I have no experience with any nopersistent option, so I'm skipping that in this reply.

    For most usage of the tool, it doesn't matter that I can only check the ISO that was just written to the thumb-drive, as that's when I can see it being used most of the time. So it's NOTa big problem for me; covering 90%+ (guessing the %, it maybe higher) usage of the tool!

    I went and used it (or at least attempted to) to check my 'grey-white' Lubuntu thumb-drive contained the Lubuntu 23.04 final image, as I was convinced that was what was last written to it. I believe such a tool I'd find useful, however that is a feature I'd not use that often... but I could see myself using it on occasion (eg. I grab my Ubuntu-MATE thumb-drive & I could use the script to confirm the thumb-drive contains the latest ISO I see in my /de2900/ubuntu_mate_64/ directory; using the tool as it's quick & easy for me to start (ignore & check up soon), instead of mounting & exploring the ISO & files on the thumb-drive; it also confirms the media hasn't been corrupted which I think would be useful).

    If it's an option (-flag) that skips the first few bytes, or partition table (but on the current diff_image_drive script), that would probably be my choice I suspect... but that's just my personal preference. I can imagine me forgetting to add the flag; running the script & getting the bright red diff.warning, so I can just hit <UP> arrow & run the command again with the option to skip the first few bytes... I suspect that would be quicker than changing the script name & possibly less error prone, however that's just my opinion & either would be workable.

    Thank you for the great tool, and effort/skill in creating diff_image_drive. It's greatly appreciated.

    Chris g.

  3. #1233
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: Howto make USB boot drives

    Tool to check that cloning was successful, new versions

    diff-image-drive version 1.2 and 1.3.

    Here are new versions of diff-image-drive. When the general check with sha256sum fails, it will check the content except the partition table (and backup table in case of img).

    Version 1.2:
    Code:
    #!/bin/bash
    
    LANG=C
    inversvid="\0033[7m"
    resetvid="\0033[0m"
    #redback="\0033[1;37;41m"
    redback="\0033[97;41m"
    #greenback="\0033[1;37;42m"
    greenback="\0033[97;42m"
    #faintvid="\0033[2m"
    faintvid="\0033[90m"
    size=
    skip=
    chksum=
    skpsum=
    
    ########################################################################
    
    function usage {
    
    echo "usage:    sudo ${0##*/} <image-file> <device>
    examples: sudo ${0##*/} ubuntu.iso /dev/sdc
              sudo ${0##*/} myfile.img /dev/sdc
    version:  1.2"
    exit 1
    }
    ########################################################################
    function checksum {
    
    chksum=$(pv -Ss $size "$1" | sha256sum)
    }
    ########################################################################
    
    function skiphead {
    
    skpsum=$(pv -Ss $size "$1" | \
     dd bs=512 skip="$skip" 2>/dev/null | sha256sum)
    }
    ########################################################################
    
    # main
    
    ########################################################################
    
    if [ "$EUID" != "0" ] || [ $# -ne 2 ] || [ "$1" == "-h" ] || ! test -s "$1" || ! test -b "$2"
    then
     usage
    fi
    echo -e "$inversvid Comparing content of '$1' and '$2' $resetvid"
    echo -en "$faintvid"
    echo -e "partprobe: "
    partprobe
    sleep 1
    echo -e "umount ${2}*: "
    if umount ${2}* 2>&1 | grep 'busy'
    then
     echo -e "$resetvid$redback umount: could not unmount all partitions on $2 $resetvid"
     exit 1
    else
     echo -e "done - no partition mounted on $2 $resetvid"
    fi
    
    echo -e "$inversvid calculating sha256sums ...$resetvid"
    size=$(stat --format %s "$1")
    checksum "$1"
    chk1=$chksum
    echo "file:   $chk1"
    checksum "$2"
    chk2=$chksum
    echo "device: $chk2"
    if [ "$chk1" == "$chk2" ]
    then
     echo -e "$greenback content of iso/img file and device match $resetvid"
    else
     echo -e "$redback content of iso/img file and device differ $resetvid"
     echo "systems cloned from Ubuntu iso files are modified when used and
    mkusb-dus fixes the partition table and its backup of img files with gpt
    so trying again ..."
     echo -e "$inversvid skipping head/tail where the partition table resides $resetvid"
     if [ "${1##*.}" == "iso" ] || [ "${1##*.}" == "ISO" ]
     then
      skip=4
     else
      skip=33
      size=$((size-33*512))
     fi
     skiphead  "$1"
     chk1=$skpsum
     echo "file except head/tail:   $chk1"
     skiphead  "$2"
     chk2=$skpsum
     echo "device except head/tail: $chk2"
     if [ "$chk1" == "$chk2" ]
     then
      echo -e "$greenback except head/tail iso/img file and device match $resetvid"
     else
      echo -e "$redback except head/tail iso/img file and device differ $resetvid"
     fi 
    fi
    Version 1.3:
    Code:
    #!/bin/bash
    
    LANG=C
    inversvid="\0033[7m"
    resetvid="\0033[0m"
    redback="\0033[97;41m"
    greenback="\0033[97;42m"
    faintvid="\0033[90m"
    size=
    skip=
    chksum=
    skpsum=
    str=
    ########################################################################
    
    function usage {
    
    echo "usage:    sudo ${0##*/} <image-file> <device>
    examples: sudo ${0##*/} ubuntu.iso /dev/sdc
              sudo ${0##*/} myfile.img /dev/sdc
    version:  1.3"
    exit 1
    }
    ########################################################################
    function checksum {
    
    chksum=$(pv -Ss $size "$1" | sha256sum)
    }
    ########################################################################
    
    function skiphead {
    
    skpsum=$(pv -Ss $size "$1" | \
     dd bs=512 skip="$skip" 2>/dev/null | sha256sum)
    }
    ########################################################################
    
    function tablecmp {
    
    tmp1=$(mktemp)
    tmp2=$(mktemp)
    echo -e "${faintvid}fdisk:"
    fdisk "$1" -lu -o start,end,sectors,size,type | sed -e '1,/^$/'d | tr -s ' ' ' ' > "$tmp1"
    fdisk "$2" -lu -o start,end,sectors,size,type | sed -e '1,/^$/'d | tr -s ' ' ' ' > "$tmp2"
    echo -en "$resetvid"
    str0=$(head -n1 "$tmp1")
    str=$(diff "$tmp1" "$tmp2")
    ret1=$?
    str=$(echo "$str" |grep -v 'not in disk order' |sed -ne '/^[<>] /p' \
     |cut -d ' ' -f 1,5- |grep -v '^>$' |sed -e 's/^</file:/' -e 's/^>/device:/'| sort -k1 )
    rm "$tmp1" "$tmp2"
    return $ret1
    }
    ########################################################################
    
    # main
    
    ########################################################################
    
    if [ "$EUID" != "0" ] || [ $# -ne 2 ] || [ "$1" == "-h" ] || ! test -s "$1" || ! test -b "$2"
    then
     usage
    fi
    echo -e "$inversvid Comparing content of '$1' and '$2' $resetvid"
    echo -en "$faintvid"
    echo -e "partprobe: "
    partprobe
    sleep 1
    echo -e "umount ${2}*: "
    if umount ${2}* 2>&1 | grep 'busy'
    then
     echo -e "$resetvid$redback umount: could not unmount all partitions on $2 $resetvid"
     exit 1
    else
     echo -e "done - no partition mounted on $2 $resetvid"
    fi
    echo -n "target device: "
    lsblk -ndo model "$2"
    lsblk -o name,size,fstype,label,uuid "$2" | sed 's/writable.*/writable/'
    
    echo -e "$inversvid calculating sha256sums ...$resetvid"
    size=$(stat --format %s "$1")
    if [ "${1##*.}" == "iso" ] && ! tablecmp "$1" "$2"
    then
     echo "unmatched partition(s) :
    $str"
     chk1=1
     chk2=2
    else
     checksum "$1"
     chk1=$chksum
     echo "file:   $chk1"
     checksum "$2"
     chk2=$chksum
     echo "device: $chk2"
    fi
    if [ "$chk1" == "$chk2" ]
    then
     echo -e "$greenback content of iso/img file and device match $resetvid"
    else
     echo -e "$redback content of iso/img file and device differ $resetvid"
     echo "systems cloned from Ubuntu iso files are modified when used and
    mkusb-dus fixes the partition table and its backup of img files with gpt
    so trying ..."
     echo -e "$inversvid skipping head/tail where the partition table resides $resetvid"
     if [ "${1##*.}" == "iso" ] || [ "${1##*.}" == "ISO" ]
     then
      skip=4
     else
      skip=33
      size=$((size-33*512))
     fi
     skiphead  "$1"
     chk1=$skpsum
     echo "file except head/tail:   $chk1"
     skiphead  "$2"
     chk2=$skpsum
     echo "device except head/tail: $chk2"
     if [ "$chk1" == "$chk2" ]
     then
      echo -e "$greenback except head/tail iso/img file and device match $resetvid"
     else
      echo -e "$redback except head/tail iso/img file and device differ $resetvid"
     fi 
    fi


    Demo with diff-image-drive version 1.2.

    Testing with a [maybe old now] Ubuntu Server Jammy compressed image daily iso file and USB SSD drive where it is cloned. The check fails because the partition table (and backup partition table) is fixed bus mkusb-dus and the modified partition table affects the checksum. Then a second check is performed where the partition table is skipped, and this check succeeds.

    Code:
    $ sudo diff-image-drive jammy-preinstalled-server-amd64.img /dev/sdc
    [sudo] password for sudodus: 
     Comparing content of 'jammy-preinstalled-server-amd64.img' and '/dev/sdc' 
    partprobe: 
    umount /dev/sdc*: 
    done - no partition mounted on /dev/sdc 
     calculating sha256sums ...
    3,50GiB 0:00:17 [ 207MiB/s] [=================================>] 100%            
    file:   cf51e240b865c94d72ad3b7b8c2c79c7f814092c775231a47648306e7f7df269  -
    3,50GiB 0:00:17 [ 205MiB/s] [=================================>] 100%            
    device: 654d25bf029f8c7e83e340a0709c7640342c91a1ef6ba0b07597e8b7e2d43246  -
     content of iso/img file and device differ 
    systems cloned from Ubuntu iso files are modified when used and
    mkusb-dus fixes the partition table and its backup of img files with gpt
    so trying again ...
     skipping head/tail where the partition table resides 
    3,50GiB 0:00:17 [ 200MiB/s] [=================================>] 100%            
    file except head/tail:   2eda9fb2dd8564a7d810d7fba08eade3ee8927d0aaba51456bef1ed53db017ff  -
    3,50GiB 0:00:17 [ 199MiB/s] [=================================>] 100%            
    device except head/tail: 2eda9fb2dd8564a7d810d7fba08eade3ee8927d0aaba51456bef1ed53db017ff  -
     except head/tail iso/img file and device match
    Testing a [maybe old now] Lubuntu Mantic daily iso file and USB SSD drive where it is cloned. The check fails because the drive is used (booted from) and a partition labeled 'writable' was created at boot, and this modified the partition table. Then a second check is performed where the partition table is skipped, and this check succeeds.

    See also the first screenshot matching this demo example, where the high-lighting colours are shown. (You may notice that the speed and times differ a little, and this is because I repeated the command to get the screenshot.)

    Code:
    $ sudo diff-image-drive mantic-desktop-amd64.iso /dev/sdc
     Comparing content of 'mantic-desktop-amd64.iso' and '/dev/sdc' 
    partprobe: 
    umount /dev/sdc*: 
    done - no partition mounted on /dev/sdc 
     calculating sha256sums ...
    2,92GiB 0:00:14 [ 207MiB/s] [=================================>] 100%            
    file:   a0ee778df45fed50bfd6d1bafe008b716ec211dffe2249a00efaaf88899e4c92  -
    2,92GiB 0:00:24 [ 123MiB/s] [=================================>] 100%            
    device: 724e192f0c65e39fd9fdc233d5d2966421f4196102b4424485030db8b1666273  -
     content of iso/img file and device differ 
    systems cloned from Ubuntu iso files are modified when used and
    mkusb-dus fixes the partition table and its backup of img files with gpt
    so trying again ...
     skipping head/tail where the partition table resides 
    2,92GiB 0:00:15 [ 197MiB/s] [=================================>] 100%            
    file except head/tail:   14ba2da53e11c2619cef7656c8b7b5011027ef444e423251f070b3db0739d7db  -
    2,92GiB 0:00:24 [ 122MiB/s] [=================================>] 100%            
    device except head/tail: 14ba2da53e11c2619cef7656c8b7b5011027ef444e423251f070b3db0739d7db  -
     except head/tail iso/img file and device match
    Next I tested with 'the wrong USB drive', so also checking 'except head/tail' (alias except the partition table) fails.

    Code:
    $ sudo diff-image-drive mantic-desktop-amd64.iso /dev/sdc
     Comparing content of 'mantic-desktop-amd64.iso' and '/dev/sdc' 
    partprobe: 
    umount /dev/sdc*: 
    done - no partition mounted on /dev/sdc 
     calculating sha256sums ...
    2,92GiB 0:00:14 [ 209MiB/s] [=================================>] 100%            
    file:   a0ee778df45fed50bfd6d1bafe008b716ec211dffe2249a00efaaf88899e4c92  -
    2,92GiB 0:00:14 [ 204MiB/s] [=================================>] 100%            
    device: e7629228960239dbef5f76fb7893a7c0ed691efa8a75b6a38a6ded24c75c0323  -
     content of iso/img file and device differ 
    systems cloned from Ubuntu iso files are modified when used and
    mkusb-dus fixes the partition table and its backup of img files with gpt
    so trying again ...
     skipping head/tail where the partition table resides 
    2,92GiB 0:00:14 [ 199MiB/s] [=================================>] 100%            
    file except head/tail:   14ba2da53e11c2619cef7656c8b7b5011027ef444e423251f070b3db0739d7db  -
    2,92GiB 0:00:14 [ 202MiB/s] [=================================>] 100%            
    device except head/tail: 336f1555ffd8846788737bc106e6b0680c4e1fc548ada39e3428666ad1b2d16f  -
     except head/tail iso/img file and device differ
    Demo with diff-image-drive version 1.3.

    See the second and third screenshots, where the high-lighting colours are shown. Please notice that the calculation of sha256sums is only made once in the file and once in the device when checking iso files. This will save time when iso-testing, particularly when using slow USB pendrives.

    1. Directly after cloning, diff-image-drive_demo-1.3-1.png

    2. After the drive was booted, so that a partition was created, diff-image-drive_demo-1.3-2.png
    Attached Images Attached Images
    Last edited by sudodus; May 15th, 2023 at 10:49 AM. Reason: version 1.2 and 1.3

  4. #1234
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: Howto make USB boot drives

    Quote Originally Posted by guiverc View Post
    I have no experience with any nopersistent option, so I'm skipping that in this reply.
    I checked running the Lubuntu Mantic live with the boot option nopersistent, and as I expected, the USB drive was not modified at all so that the first check by diff-image-drive found a match also after booting into the drive.
    Code:
    ...
     content of iso/img file and device match
    But adding nopersistent at the grub menu is not convenient during iso-testing, so you can use the upgraded version and let it check the content except for the locations of the partition table.
    Last edited by sudodus; May 14th, 2023 at 06:29 PM. Reason: made text easier to understand

  5. #1235
    Join Date
    Aug 2017
    Location
    melbourne, au
    Beans
    Hidden!
    Distro
    Lubuntu Development Release

    Re: Howto make USB boot drives

    I LOVE it.

    Inserted my primary Lubuntu thumb-drive; the one that has yesterday's mantic daily on it, was used in a simple QA-test (thus altered slightly outside of image itself) and

    Code:
    guiverc@d7050-next:/de2900/lubuntu_64$   sudo ~/diff_image_drive.sh mantic-desktop-amd64.iso /dev/sdb
    [sudo] password for guiverc: 
     Comparing content of 'mantic-desktop-amd64.iso' and '/dev/sdb' 
    partprobe: 
    umount /dev/sdb*: 
    done - no partition mounted on /dev/sdb 
     calculating sha256sums ...
    2.92GiB 0:00:30 [97.7MiB/s] [========================================================================================>] 100%            
    file:   a0ee778df45fed50bfd6d1bafe008b716ec211dffe2249a00efaaf88899e4c92  -
    2.92GiB 0:03:31 [14.1MiB/s] [========================================================================================>] 100%            
    device: 821c6e85d8ebdeb907bf02109390cdb50516af92763a6c6039c2aed4570b66c7  -
     content of iso/img file and device differ 
    systems cloned from Ubuntu iso files are modified when used and
    mkusb-dus fixes the partition table and its backup of img files with gpt
    so trying again ...
     skipping head/tail where the partition table resides 
    2.92GiB 0:00:25 [ 119MiB/s] [========================================================================================>] 100%            
    file except head/tail:   14ba2da53e11c2619cef7656c8b7b5011027ef444e423251f070b3db0739d7db  -
    2.92GiB 0:03:31 [14.1MiB/s] [========================================================================================>] 100%            
    device except head/tail: 14ba2da53e11c2619cef7656c8b7b5011027ef444e423251f070b3db0739d7db  -
     except head/tail iso/img file and device match
    This confirms the thumb-drive contains the ISO I want it to contain, PLUS from that report I can see I've actually used it in a QA-test of some sort due to the partition table change(s). That output makes perfect sense to me & my usage. The RED & GREEN highlight makes it super easy (for me) to use !

    Thank you !

  6. #1236
    Join Date
    Aug 2017
    Location
    melbourne, au
    Beans
    Hidden!
    Distro
    Lubuntu Development Release

    Re: Howto make USB boot drives

    For the record.. My favorite & used tool will be version 1.3

    It provides the detail I liked with the version 1.2 tool, but also uses fewer cycles (power & hardware usage), even if the saved time I'll rarely notice (given I start it off & then covering most of the qterminal window with my browser or other windows; though as my window positioning means I can read the two left most characters of the terminal, the color highlighting used will let me see results & know when I can return & its done).

    Note: I've not run it today; this is what I recall of yesterday's testing as I try & complete stuff I didn't get done as hoped yesterday.

  7. #1237
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: Howto make USB boot drives

    mkusb version 23.1.6

    - mkusb 23.1.6
    . dus: p_toolsel: "$source ... --> "\"$source\" ... to allow file names with spaces to be transferred to dus-iso2usb

    Improvement in program package mkusb version 23.1.6

    A user was affected by a classical bug: spaces in the source file name made dus fail to call dus-iso2usb correctly. I had overlooked one step in the transfer of the file name.



    Unstable: You get/update this new version of mkusb from the unstable PPA via the following commands

    Code:
    sudo add-apt-repository universe     # this line only for standard Ubuntu
    
    sudo add-apt-repository ppa:mkusb/unstable
    sudo apt update
    sudo apt install mkusb           # to install
    # sudo apt full-upgrade          # upgrade to current version (with all other upgrades), only for installed systems
    
    sudo apt install mkusb guidus dus mkusb-common  # to upgrade all mkusb basic components including dus
    
    sudo apt install usb-pack-efi    # for persistent live drives that work in UEFI and BIOS mode with 32-bit iso files
    You get only the version dus (alone or with guidus) via one of the following commands (without the whole set of mkusb tools). dus and mkusb-nox are useful for systems without a graphic environment, for example Ubuntu Server.

    Code:
    sudo apt install dus
    sudo apt install guidus
    sudo apt install mkusb-nox
    You get only the version mkusb-plug via [the update command and] the following command,

    Code:
    sudo apt update
    sudo apt install mkusb-plug
    Alternative way to get mkusb: There are tarballs at

    - help.ubuntu.com/community/mkusb/gui/tarball with only dus and guidus (mkusb version 22),

    - help.ubuntu.com/community/mkusb/plug with only mkusb-plug.



    Stable: mkusb version 23.1.6 is in the stable PPA. The policy is to test mkusb for a long time and in several environments before it is uploaded to the stable PPA (unless there are minor tweaks or bug-fixes).

    You get/update this version via the following commands

    Code:
    sudo add-apt-repository universe      # this line only for standard Ubuntu
    
    sudo add-apt-repository ppa:mkusb/ppa
    sudo apt update
    sudo apt install mkusb            # to install
    # sudo apt full-upgrade           # upgrade to current version (with all other upgrades), only for installed systems
    
    sudo apt install usb-pack-efi     # for persistent live drives that work in UEFI and BIOS mode with 32-bit iso files
    You get only the version dus (alone or with guidus) via one of the following commands (without the whole set of mkusb tools). dus and mkusb-nox are useful for systems without a graphic environment, for example Ubuntu Server.

    Code:
    sudo apt install dus
    sudo apt install guidus
    sudo apt install mkusb-nox
    You get only the version mkusb-plug via [the update command and] the following command,

    Code:
    sudo apt update
    sudo apt install mkusb-plug
    Usually there is drive space enough to install all the following mkusb packages explicitly:

    Code:
    sudo apt update
    sudo apt install mkusb guidus mkusb-plug usb-pack-efi

    Please notice that if you have already installed mkusb-plug or dus/guidus from a tarball, you had better remove that version when you install via PPA. The advantage with the PPA version is that it gets updated/upgraded automatically along with other program packages that are installed from the Ubuntu repositories.
    Last edited by sudodus; September 11th, 2023 at 12:31 AM. Reason: mkusb version 23.1.6 is in the stable PPA.

  8. #1238
    Join Date
    Aug 2017
    Location
    melbourne, au
    Beans
    Hidden!
    Distro
    Lubuntu Development Release

    Re: Howto make USB boot drives

    This is mostly FYI @Sudodus

    I just had a write of daily & diff error (I included the last bit of the zsync_mantic script; as the last issue I had was actually after a failed zsync, alas I didn't notice it fast enough).

    Code:
    Read mantic-desktop-amd64.iso. Target 95.7% complete.      *************************************************
    downloading from http://cdimage.ubuntu.com/lubuntu/daily-live/current/mantic-desktop-amd64.iso:
    #################### 100.0% 1158.0 kBps DONE      
    
    verifying download...checksum matches OK
    used 2894548992 local, fetched 130198938
    -rw------- 1 guiverc guiverc 3.2G Jul 20 17:03 mantic-desktop-amd64.iso.2023-07-20
    -rw-rw-r-- 1 guiverc guiverc  57K Jul 21 02:53 mantic-desktop-amd64.manifest.2023-07-20
    -rw------- 1 guiverc guiverc 3.2G Jul 26 17:03 mantic-desktop-amd64.iso.2023-07-26
    -rw-rw-r-- 1 guiverc guiverc  57K Jul 27 02:54 mantic-desktop-amd64.manifest.2023-07-27
    -rw------- 1 guiverc guiverc 3.2G Jul 29 16:02 mantic-desktop-amd64.iso.20230729
    -rw-rw-r-- 1 guiverc guiverc  57K Jul 30 02:52 mantic-desktop-amd64.manifest.20230729
    -rw------- 1 guiverc guiverc 2.9G Sep 18 16:57 mantic-desktop-amd64.iso.zs-old
    -rw------- 1 guiverc guiverc 2.9G Sep 18 16:57 mantic-desktop-amd64.iso.old
    -rw-rw-r-- 1 guiverc guiverc  57K Sep 19 02:51 mantic-desktop-amd64.manifest.old
    -rw-rw-r-- 1 guiverc guiverc 5.7M Sep 19 02:58 mantic-desktop-amd64.zsync.old
    -rw------- 1 guiverc guiverc 2.9G Sep 19 23:55 mantic-desktop-amd64.iso
    -rw-rw-r-- 1 guiverc guiverc  57K Sep 20 09:08 mantic-desktop-amd64.manifest
    -rw-rw-r-- 1 guiverc guiverc 5.7M Sep 20 09:57 mantic-desktop-amd64.iso.zsync
    ** linux-generic
    linux-generic    6.5.0.5.7
    ** prior ISO
    calamares    3.3.0-alpha2-0ubuntu5
    calamares-settings-lubuntu    1:23.10.3
    calamares-settings-ubuntu-common    1:23.10.3
    casper    1.482
    lubuntu-default-settings    23.10.1
    ** latest ISO
    calamares    3.3.0-alpha2-0ubuntu5
    calamares-settings-lubuntu    1:23.10.3
    calamares-settings-ubuntu-common    1:23.10.3
    casper    1.482
    lubuntu-default-settings    23.10.1
    ** diff
    guiverc@d7050-next:/de2900/lubuntu_64$   sudo mkusb-nox mantic-desktop-amd64.iso all
    [sudo] password for guiverc: 
    The iso file SHOULD BE loop mounted on a temporary file READ-ONLY:
    mount: /tmp/tmp.OmEi8RslTT: WARNING: source write-protected, mounted read-only.
    disk_name_type=debian
    Ubuntu mantic 23.10 amd64 i386  _found_ in iso-file
    Ubuntu mantic 23.10 amd64 i386  _found_ in /dev/sdb
    MODEL      NAME FSTYPE  LABEL                SIZE
    STORE N GO sdb  iso9660 Lubuntu 23.10 amd64 14.4G
               sdb1 iso9660 Lubuntu 23.10 amd64  2.8G
               sdb2 vfat    ESP                  4.9M
               sdb3                              300K
               sdb4 ext4    writable            11.6G
     Final checkpoint 
    Install to /dev/sdb? (y/n)
    y
    dd if="mantic-desktop-amd64.iso" of=/dev/sdb bs=1M status=progress oflag=dsync ...
    3024537600 bytes (total size to be cloned)
    3024093184 bytes (3.0 GB, 2.8 GiB) copied, 1118 s, 2.7 MB/s
    2884+1 records in
    2884+1 records out
    3024537600 bytes (3.0 GB, 2.8 GiB) copied, 1117.86 s, 2.7 MB/s
    The Ubuntu mantic 23.10 amd64 i386  USB device is re-cloned  :-)
    guiverc@d7050-next:/de2900/lubuntu_64$   sudo diff_image_drive mantic-desktop-amd64.iso /dev/sdb
    [sudo] password for guiverc: 
     Comparing content of 'mantic-desktop-amd64.iso' and '/dev/sdb' 
    partprobe: 
    Warning: Not all of the space available to /dev/sdb appears to be used, you can fix the GPT to use all of the space (an extra 24378716 blocks) or continue with the current setting? 
    Error: Partition(s) 2, 3, 4 on /dev/sdb have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use.  As a result, the old partition(s) will remain in use.  You should reboot now before making further changes.
    umount /dev/sdb*: 
    done - no partition mounted on /dev/sdb 
     calculating sha256sums ...
    2.82GiB 0:00:26 [ 106MiB/s] [===================================================================================================================================================================>] 100%            
    file:   c07e6b5b4215a04b721871ab9437f1b240c126aed5aab0456ac096af37248f6d  -
    2.82GiB 0:03:23 [14.2MiB/s] [===================================================================================================================================================================>] 100%            
    device: 96ea87de289d2dbb026cf8a36e8bb9b97307c361f559e43e77ce538ab908f77e  -
     content of iso/img file and device differ 
    systems cloned from Ubuntu iso files are modified when used and
    mkusb-dus fixes the partition table and its backup of img files with gpt
    so trying again ...
     skipping head/tail where the partition table resides 
    2.82GiB 0:00:26 [ 107MiB/s] [===================================================================================================================================================================>] 100%            
    file except head/tail:   746ed316d2f58f6a33b568c946e4335beb5869f5c4dcc6b8a178581437af6e5c  -
    2.82GiB 0:03:24 [14.1MiB/s] [===================================================================================================================================================================>] 100%            
    device except head/tail: d64d8255cbb7f858f2f64c80ac166b1ce5de0d71c4c3ee6922cbaf70902be150  -
     except head/tail iso/img file and device differ
    These issues are now extremely rare, but I'm writing fewer ISOs to media now than I used to, thus my hitting these issues will be less often.

  9. #1239
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: Howto make USB boot drives

    @guiverc,

    Thanks for the feedback

    I'm glad that most of your cloning is successful nowadays. Anyway, diff_image_drive works and can detect when there are issues.

    I notice that the average write speed (during cloning) is very low, 2.7 MB/s. Has it been constant for this 'STORE N GO' pendrive? Or has it been gradually decreasing? If it has been decreasing, it might get faster and more reliable, if you wipe the whole device (overwrite with zeros), which is an option of dus as well as of mkusb-nox.

  10. #1240
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: Howto make USB boot drives

    mkusb version 23.2.0

    - mkusb 23.2.0
    . modications in dus, dus-iso2usb and a new file
    .. dd_grub-boot-template-for-uefi-n-bios_grub-new.img.xz:
    . new template with grub 2.12-rc1 (replacing 2.0.6)
    . new grub menuentries:
    .. 'live-only with toRAM' and
    .. new memtest86+ v6.20 that works also in UEFI mode

    Improvement in program package mkusb version 23.2.0

    This upgrade of dus-iso2usb was triggered by problems to boot in UEFI mode with secure boot in a Dell Latitude 3520 with 11th generation Intel i3 CPU.

    - A USB drive with Ubuntu (and Ubuntu flavours) version 23.10 cloned from the iso file boots. A drive by mkusb-plug boot too, also persistent live drives (because they are semi-cloned by sed).

    - But drives made by dus-persistent and dus-iso2usb failed to boot. After some tests I concluded that it would be easiest to upgrade and maintain dus-iso2usb. I made a new template file,
    Code:
    dd_grub-boot-template-for-uefi-n-bios_grub-new.img.xz
    that should be fairly easy to upgrade with future versions of grub, when necessary to make it boot in computers with even stricter policies.

    When working with a new template, it was easy to add a new menuentry (live-only with toRAM), which allows unplugging the boot drive.

    It was also possible to add menuentries for memtest86+ v6.20, which can work in UEFI mode (but not with secure boot).




    Unstable: You get/update this new version of mkusb from the unstable PPA via the following commands

    Code:
    sudo add-apt-repository universe     # this line only for standard Ubuntu
    
    sudo add-apt-repository ppa:mkusb/unstable
    sudo apt update
    sudo apt install mkusb           # to install
    # sudo apt full-upgrade          # upgrade to current version (with all other upgrades), only for installed systems
    
    sudo apt install mkusb guidus dus mkusb-common  # to upgrade all mkusb basic components including dus
    
    sudo apt install usb-pack-efi    # for persistent live drives that work in UEFI and BIOS mode with 32-bit iso files
    You get only the version dus (alone or with guidus) via one of the following commands (without the whole set of mkusb tools). dus and mkusb-nox are useful for systems without a graphic environment, for example Ubuntu Server.

    Code:
    sudo apt install dus
    sudo apt install guidus
    sudo apt install mkusb-nox
    You get only the version mkusb-plug via [the update command and] the following command,

    Code:
    sudo apt update
    sudo apt install mkusb-plug
    Alternative way to get mkusb: There are tarballs at

    - help.ubuntu.com/community/mkusb/gui/tarball with only dus and guidus (mkusb version 22),

    - help.ubuntu.com/community/mkusb/plug with only mkusb-plug.



    Stable: mkusb version 23.2.0 is in the stable PPA. The policy is to test mkusb for a long time and in several environments before it is uploaded to the stable PPA (unless there are minor tweaks or bug-fixes).

    You get/update this version via the following commands

    Code:
    sudo add-apt-repository universe      # this line only for standard Ubuntu
    
    sudo add-apt-repository ppa:mkusb/ppa
    sudo apt update
    sudo apt install mkusb            # to install
    # sudo apt full-upgrade           # upgrade to current version (with all other upgrades), only for installed systems
    
    sudo apt install usb-pack-efi     # for persistent live drives that work in UEFI and BIOS mode with 32-bit iso files
    You get only the version dus (alone or with guidus) via one of the following commands (without the whole set of mkusb tools). dus and mkusb-nox are useful for systems without a graphic environment, for example Ubuntu Server.

    Code:
    sudo apt install dus
    sudo apt install guidus
    sudo apt install mkusb-nox
    You get only the version mkusb-plug via [the update command and] the following command,

    Code:
    sudo apt update
    sudo apt install mkusb-plug
    Usually there is drive space enough to install all the following mkusb packages explicitly:

    Code:
    sudo apt update
    sudo apt install mkusb guidus mkusb-plug usb-pack-efi

    Please notice that if you have already installed mkusb-plug or dus/guidus from a tarball, you had better remove that version when you install via PPA. The advantage with the PPA version is that it gets updated/upgraded automatically along with other program packages that are installed from the Ubuntu repositories.
    Last edited by sudodus; October 27th, 2023 at 10:16 PM. Reason: mkusb version 23.2.0 is in ppa:mkusb/ppa

Page 124 of 128 FirstFirst ... 2474114122123124125126 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •