Page 2 of 13 FirstFirst 123412 ... LastLast
Results 11 to 20 of 129

Thread: Startup disc creator

  1. #11
    Join Date
    Jun 2007
    Beans
    17,329

    Re: Startup disc creator

    Well gparted in a live session isn't going to help format the drive that's running the live session.
    As far as Disks, Gnome goes to some lengths to minimize options & capabilities of it's apps,the older gnome-disk-utility may have been able to handle.

  2. #12
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: Startup disc creator

    Quote Originally Posted by mc4man View Post
    I would like this info/a warning in the package description for sdc & in the sdc dialog prior to creating the disk.
    Best would be to provide a means in sdc to format the device if Disks can't be improved to do the job. ( though that's unlikely, at least for 16.04

    Slightly off-topic maybe gparted should be in default install though it's package description is somewhat deficient as doesn't show in Dash with some common terms like 'format' & 'disk'
    There could be a button 'Restore a USB drive for data storage' and behind that button there could be information and a tool (in a second window).

    Quote Originally Posted by MikeMecanic View Post
    First, SDC was not working before and now it works. SDC is a dedicated ISO maker made for Ubuntu and is the most user friendly app that I ever seen. There is no choice to deal with because it makes only one thing: Build an ISO image of any Ubuntu flavors. Once the ISO image have been created you must keep it in case (for n reasons) you need to do a fresh install.

    It's Disk that needs correction now. For Gparted, it is in all Ubuntu Installers. Every time I do a fresh install, I always pass by Try Ubuntu and search Gparted in Dash to delete Ubuntu partitions. That way, I always do a fresh install on an empty hard drive disk.

    Cheers,
    I agree, that it is good that the new SDC is very simple and works

    An extra button might be OK - would not make it much more complicated. An alternative is to have another very simple tool to 'Restore a USB drive for data storage'.

    I don't agree that you must keep the iso image in a USB pendrive. I consider pendrives to be temporary devices. I keep the iso files in my main computer's data partition (which is backed up separately), and I flash the image from an iso file into a pendrive, when i need it.

    Quote Originally Posted by mc4man View Post
    Well gparted in a live session isn't going to help format the drive that's running the live session.
    As far as Disks, Gnome goes to some lengths to minimize options & capabilities of it's apps,the older gnome-disk-utility may have been able to handle.
    I think it will be hard to make the gnome developers add this feature to Disks. It is already available in mkusb (so I know how to do it) and I think it would be easier to get it into the SDC

    We can also make a simple dedicated tool for it - that would be easiest. But then there would be a huge problem - to get that dedicated tool accepted into a repository

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

    Re: Startup disc creator

    Maybe something like the function mk_msdos of following script might be added to the Ubuntu Startup Disk Creator, SDC, to be 'started from a button'. The function written in bash could be translated to python if it would be integrated better that way, and the echo statements should be replaced or removed.

    Edit: Version 1.0 replaced by version 1.1, and a third screenshot is added. Please try this new shellscript

    Code:
    #! /bin/bash
    
    #-----------------------------------------------------------------------------
    #
    ## Copyright 2016 Nio Wiklund
    #
    # GPLv3: GNU GPL version 3
    # <http://gnu.org/licenses/gpl.html>.
    #
    # This is free software: you are free to change and redistribute it.
    # There is NO WARRANTY, to the extent permitted by law.
    
    # date        editor   comment
    # 20160226    sudodus  created from mk_mkdos in mkusb
    # 20160227    sudodus  accepting only mass storage devices as target
    # 20160227    sudodus  version 1.1
    
    version=1.1
    
    inversvid="\0033[7m"
    resetvid="\0033[0m"
    redtext="\0033[31;47m"
    
    #######################################################################
    #######################################################################
    
    function mk_msdos {
    
    # make an MSDOS partition table and a FAT32 file system
    
    target="$1"
    label1="$2"
    
    label1="${label1:0:11}"
    label1="${label1^^}"
    #echo "Label (name) for the FAT32 partition: $label1"
    
    echo "Trying to unmount partitions if mounted on the target device"
    umount "$target"*
    df | grep "$target"
    if [ $? -eq 0 ]
    then
     echo "mk_msdos: could not unmount a partition on the target device"
     exit
    fi
    echo "------------------------------------------------------------"
    dd if=/dev/zero of="$target" bs=1024 count=1024 2>&1
    parted -s "$target" mklabel msdos
    sleep 0.5
    parted -s "$target" mkpart primary 1048576b 100%
    sleep 0.5
    parted -s "$target" set 1 boot on  # set boot flag on partition 1
    sleep 0.5
    mkfs.vfat -v -F 32 -n "$label1" "${target}1"
    if [ $? -eq 0 ]
    then
     success=true
    else
     success=false
    fi
    sleep 0.5
    sync
    if $success
    then
     /bin/echo -e "$inversvid created MSDOS partition table and FAT file system $resetvid"
    else
     /bin/echo -e "$inversvid mk_msdos: could not create MSDOS partition table and FAT file system $resetvid"
    fi
    }
    
    ########################################################################
    ########################################################################
    #
    # main program
    #
    ########################################################################
    ########################################################################
    
    # print version on demand
    
    if [ "$1" == "-v" ]
    then
     echo "$0 version $version"
     exit
    fi 
    
    # identify usb devices
    
    usb_dev=$(ls -l /dev/disk/by-id|grep usb|grep -v 'part.*->' \
    |sed -e 's/.*usb-/usb-/' -e 's#../..#/dev#' -e 's/^/ /' -e 's/$/ /'|sort -k3)
    
    # usage text
    
    leng=${#1}
    leng1=$((leng - 1))
    trunk=${1:0:leng1}
    
    if [ "$(whoami)" != "root" ] || [ $# -gt 2 ] || ! test -b "$1" || test -b "$trunk" || [ "$1" == "-h" ]
    then
     echo "Restore a USB install device to a device with MSDOS partition table
    and FAT32 partition (to store and transfer files)"
     echo "Usage:"
     echo "sudo $0 <mass storage device> [label]  # max 11 characters in label"
     echo "Example:"
     echo "sudo $0 /dev/sdx usb-123"
     echo "Help:"
     echo "$0 -h"
     echo "Version:"
     echo "$0 -v"
     /bin/echo -e "${inversvid}${usb_dev}${resetvid}"
     exit
    fi
    
    # checkpoint
    
    /bin/echo -en "$redtext$inversvid Warning! $resetvid$redtext
    This shellsript is only a $inversvid demo $resetvid$redtext for a function to be built into a program,
    that is selecting the target device in a safe way to avoid overwriting     
    valuable data by mistake. This simple script is not really safe.           
    $inversvid Use it very carefully and only for testing! $resetvid$redtext [press Enter to continue] $resetvid"
    read -n1 tmp
    lsblk -o NAME,MODEL,FSTYPE,LABEL,MOUNTPOINT,SIZE,NAME
    
    /bin/echo -e "${inversvid}${usb_dev}${resetvid}"
    echo ''
    echo "$usb_dev"|grep -m1 "$1" > /dev/null
    if [ $? -ne 0 ]
    then
     /bin/echo -en "$redtext Not a USB device. Do you really want to overwrite $inversvid ${1} $resetvid$redtext ? (y/N)$resetvid "
     read ans
     if [ "$ans" != "y" ]
     then
      exit
     fi
    fi
    
    /bin/echo -e "$inversvid Final checkpoint $resetvid"
    /bin/echo -en "Do you want to restore $inversvid ${1} $resetvid to a FAT32 partition? (y/N) "
    read ans
    if [ "$ans" == "y" ]
    then
    # do it
     mk_msdos "$1" "$2"
    # check it
     parted -s "$target" print
    fi
    The attached screenshots illustrate what it looked like, when I used it. I do not expect that you will like the interface - but I would like to know if you think it is doing what it should do. When it is 'good enough for us' I can ask the people in charge of the SDC to adopt it or do something similar
    Attached Images Attached Images
    Last edited by sudodus; February 27th, 2016 at 11:16 AM. Reason: updated the shellscript, added screenshot

  4. #14
    Join Date
    Jun 2007
    Beans
    17,329

    Re: Startup disc creator

    This is what I get from script -
    Warning!
    This shellsript is only a demo for a function to be built into a program,
    that is selecting the target device in a safe way to avoid overwriting
    valuable data by mistake. This simple script is not really safe.
    Use it very carefully and only for testing!
    NAME MODEL FSTYPE LABEL MOUNTPOINT SIZE NAME
    sda LITEONIT LSS-24L 22.4G sda
    sdb Crucial_CT500MX2 465.8G sdb
    ├─sdb1 vfat /boot/efi 200M ├─sdb1
    ├─sdb2 ext4 / 150.9G ├─sdb2
    ├─sdb3 ext4 93.1G ├─sdb3
    └─sdb4 ntfs media /media/doug/media 55.9G └─sdb4
    sdc MONSTER DIGITAL iso9660 Ubuntu 14.04.4 LTS amd64 14.9G sdc
    ├─sdc1 iso9660 Ubuntu 14.04.4 LTS amd64 1G ├─sdc1
    └─sdc2 vfat Ubuntu 14.04.4 LTS amd64 2.2M └─sdc2
    sr0 DVD-RAM UJ8DB 1024M sr0
    Final checkpoint
    Do you want to restore /dev/sdc1 to a FAT32 partition? (y/N) y
    Trying to unmount partitions if mounted on the target device
    umount: /dev/sdc1: not mounted
    ------------------------------------------------------------
    1024+0 records in
    1024+0 records out
    1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.956693 s, 1.1 MB/s
    Error: Partition(s) 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64 on /dev/sdc1 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.
    Error: Partition(s) 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64 on /dev/sdc1 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.
    Error: Partition(s) 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64 on /dev/sdc1 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.
    mkfs.fat 3.0.28 (2015-05-16)
    /dev/sdc11: No such file or directory
    created MSDOS partition table and FAT file system
    Model: Unknown (unknown)
    Disk /dev/sdc1: 1074MB
    Sector size (logical/physical): 512B/512B
    Partition Table: msdos
    Disk Flags:

    Number Start End Size Type File system Flags
    1 1049kB 1074MB 1073MB primary boot
    sudo blkid
    [sudo] password for doug:
    /dev/sdb1: UUID="E0DA-0C61" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="f6a0b209-b862-40fb-b065-01aff5e1555d"
    /dev/sdb2: UUID="20dcab9e-a4f9-41c1-967c-4e5ff2bec646" TYPE="ext4" PARTUUID="e36425fb-4fa3-4852-8423-01952d97ccb7"
    /dev/sdb3: UUID="ebbeb1c2-8431-4ab7-ac2f-99caf3e9a893" TYPE="ext4" PARTUUID="bea53c19-94b0-4ac6-b4e5-a7107c9e136d"
    /dev/sdb4: LABEL="media" UUID="6F77440D3428E11F" TYPE="ntfs" PARTUUID="12a8a557-85dd-40b9-adbb-21b73e461bb3"
    /dev/sda: PTUUID="74f02dea" PTTYPE="dos"
    /dev/sdc1: PARTUUID="5a7359c1-01"
    Attached Images Attached Images

  5. #15
    Join Date
    Jan 2015
    Beans
    366

    Re: Startup disc creator

    Sudodus gets my vote for President! +2 and forward to SDC team.

  6. #16
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: Startup disc creator

    @ mc4man,

    Let me guess that you ran the script with a partition as target instead of a whole mass storage device, /dev/sdc1 instead of /dev/sdc. Otherwise I don't understand how you could manage to get that result. Anyway, good catch

    This is a bug in the 'main script' - but such things should not happen when the function mk_msdos is called from the SDC. It should point to the whole mass storage device, selected by the main user interface. Anyway, I should remove that bug ...

    @ MikeMecanic,

    I think we need to make this script more robust before we forward it to the SDC team.



    Edit: Done - version 1.1 uploaded to post #13.
    Last edited by sudodus; February 27th, 2016 at 11:32 AM.

  7. #17
    Join Date
    Jun 2007
    Beans
    17,329

    Re: Startup disc creator

    Quote Originally Posted by sudodus View Post
    @ mc4man,

    Let me guess that you ran the script with a partition as target instead of a whole mass storage device, /dev/sdc1 instead of /dev/sdc. Otherwise I don't understand how you could manage to get that result. Anyway, good catch

    This is a bug in the 'main script' - but such things should not happen when the function mk_msdos is called from the SDC. It should point to the whole mass storage device, selected by the main user interface. Anyway, I should remove that bug ...

    @ MikeMecanic,

    I'm think we need to make this script more robust before we forward it to the SDC team.
    Yeah, I was telling myself to just use sdc but checking history see I did use sdc1...
    (In any event the device was able to be formatted in Disks after using the wrong target.

  8. #18
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: Startup disc creator

    I have replaced restore-pendrive version 1.0 with version 1.1, and a third screenshot is added in post #13.

    Please try this new shellscript

    Can it do what it should do? Is it ready for the the SDC team yet?

  9. #19
    Join Date
    Jan 2010
    Location
    Hyperborea
    Beans
    2,049
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Startup disc creator

    Quote Originally Posted by mc4man View Post
    While the new method never fails it seems to create a disk that becomes difficult to format back to a plain storage device. Disks has issues, gparted also inc. totally mis reading the size.
    Maybe there is a trick to simply format the device back to let's say fat32, if so I've not found
    Some various images attached, first gparted is after attempting to format in Disks, 2nd gparted is on a fresh disc never opened in Disks
    Yesterday I tried to blank a working Ubuntu 15.10 64 bit install USB stick and make it into a Xubuntu 14.04 32 bit installer. After trying all the usual methods I still have had no success
    You can add this gparted error message to yours above
    Attached Images Attached Images
    Last edited by coldraven; February 27th, 2016 at 02:38 PM.

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

    Re: Startup disc creator

    Quote Originally Posted by coldraven View Post
    Yesterday I tried to blank a working Ubuntu 15.10 64 bit install USB stick and make it into a Xubuntu 14.04 32 bit installer. After trying all the usual methods I still have had no success
    You can add this gparted error message to yours above
    1. To solve your current problem, you can use an option from the mkusb wipe menu!

    2. Please add your error message (as an attached file) to a new comment in the Launchpad bug report

    3. To help improve the Ubuntu Startup Disk Creator, please fetch the script from post #13 and test if it solves your problem

Page 2 of 13 FirstFirst 123412 ... LastLast

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
  •