0

I am trying to create a live persistent usb bootable stick. I cant figure out what is wrong and it is not working. Terminal out of mkusb is as follows:

start [mkusb 11.0.5] @ 2017-01-01 11:49:37 AM
---------------------------------------------------------------------------
Current directory=/home/gediz
main: usbonly=true
main: liveonly=true
No input file specified yet
main: source=''
TERM=xterm
ubuntu
---------------------------------------------------------------------------
menu_shell:
imagefile=/mnt/hgfs/ACTIVE_SOFTWARE/Other OS/ubuntu-16.04.1-desktop-amd64.iso
The iso file SHOULD BE loop mounted on a temporary file READ-ONLY:
mount: /dev/loop0 is write-protected, mounting read-only
disk_name_type=desktop
Ubuntu 16.04.1 LTS "Xenial Xerus" - Release amd64 _found_ in iso-file
Ubuntu 16.04.1 LTS "Xenial Xerus" - Release amd64 _not_ in any possible target drive
Booted from: /dev/sda
ans=u
ans=
---------------------------------------------------------------------------
menu_shell:
---------------------------------------------------------------------------
menu_shell:
imagefile=/mnt/hgfs/ACTIVE_SOFTWARE/Other OS/ubuntu-16.04.1-desktop-amd64.iso
Booted from: /dev/sda
ans=1
***** tu=/dev/sdb ****************************************************
selected target partition table: 'msdos'
mount: /dev/loop0 is write-protected, mounting read-only
 Ubuntu 16.04.1 LTS "Xenial Xerus" - Release amd64 
---------------------------------------------------------------------------
chk4ubuntu_upgrades: mkusb

can set the security upgrade action (the default action of the persistent
live system when security upgrades are available). This method works for
Ubuntu family operating systems and some 're-spins'. You are installing
Ubuntu 16.04.1 LTS "Xenial Xerus" - Release amd64

This can change 'Download and install automatically' to 'Display immediately'
set security upgrade action to 'Display immediately'
---------------------------------------------------------------------------
mount: /dev/loop0 is write-protected, mounting read-only
select_boot_system: [if installed, use] usb-pack_efi=false
'/mnt/hgfs/ACTIVE_SOFTWARE/Other OS/ubuntu-16.04.1-desktop-amd64.iso' is identified as the source ISO file
<pre>
MODEL            NAME   FSTYPE LABEL      MOUNTPOINT  SIZE
Cruzer Glide 3.0 sdb                                 29.8G
                 ├─sdb1 ntfs   usbdata               22.6G
                 ├─sdb2 vfat                            1M
                 ├─sdb3 vfat   ubu1604164             122M
                 ├─sdb4                               1.4G
                 └─sdb5 ext4   casper-rw              5.7G
</pre>
Using the file '/usr/share/mkusb/grub.cfg'
Clean for a GUID partition table
GPT fdisk (gdisk) version 0.8.10

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): This option deletes all partitions and creates a new protective MBR.
Proceed? (Y/N): 
Command (? for help): 
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed? (Y/N): OK; writing new GUID partition table (GPT) to /dev/sdb.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot.
The operation has completed successfully.
Wipe the first megabyte (mibibyte) to get a clean boot area
1024+0 records in
1024+0 records out
1048576 bytes (1.0 MB) copied, 1.49029 s, 704 kB/s
lsblk: /dev/mmcblk?: not a block device
---------------------------------------------------------------------------
 Selected percentage of remaining space for persistence = 20 
---------------------------------------------------------------------------

lsblk: sdb3: failed to initialize sysfs handler
preparing /dev/sdb3  ------------------------------------------------
1024+0 records in
1024+0 records out
1048576 bytes (1.0 MB) copied, 0.97066 s, 1.1 MB/s
umount: /dev/sdb3: not mounted
mkfs.fat 3.0.27 (2014-11-12)
/dev/sdb3 has 64 heads and 32 sectors per track,
hidden sectors 0x1000;
logical sector size is 512,
using 0xf8 media descriptor, with 249856 sectors;
drive number 0x80;
filesystem has 2 32-bit FATs and 1 sector per cluster.
FAT size is 1922 sectors, and provides 245980 clusters.
There are 32 reserved sectors.
Volume ID is 1430fe73, no volume label.

preparing /dev/sdb1  ------------------------------------------------
1024+0 records in
1024+0 records out
1048576 bytes (1.0 MB) copied, 0.833496 s, 1.3 MB/s
umount: /dev/sdb1: not mounted
Cluster size has been automatically set to 4096 bytes.
Creating NTFS volume structures.
Creating root directory (mft record 5)
Creating $MFT (mft record 0)
Creating $MFTMirr (mft record 1)
Creating $LogFile (mft record 2)
Creating $AttrDef (mft record 4)
Creating $Bitmap (mft record 6)
Creating $Boot (mft record 7)
Creating backup boot sector.
Creating $Volume (mft record 3)
Creating $BadClus (mft record 8)
Creating $Secure (mft record 9)
Creating $UpCase (mft record 0xa)
Creating $Extend (mft record 11)
Creating system file (mft record 0xc)
Creating system file (mft record 0xd)
Creating system file (mft record 0xe)
Creating system file (mft record 0xf)
Creating $Quota (mft record 24)
Creating $ObjId (mft record 25)
Creating $Reparse (mft record 26)
Syncing root directory index record.
Syncing $Bitmap.
Syncing $MFT.
Updating $MFTMirr.
Syncing device.
mkntfs completed successfully. Have a nice day.
preparing /dev/sdb5  ------------------------------------------------
1024+0 records in
1024+0 records out
1048576 bytes (1.0 MB) copied, 0.922333 s, 1.1 MB/s
umount: /dev/sdb5: not mounted
mke2fs 1.42.12 (29-Aug-2014)
Creating filesystem with 1481472 4k blocks and 370944 inodes
Filesystem UUID: 9b06bf50-b1ff-4a60-956b-709ae2ac3b34
Superblock backups stored on blocks: 
    32768, 98304, 163840, 229376, 294912, 819200, 884736

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done 

mount: /mnt/hgfs/ACTIVE_SOFTWARE/Other OS/ubuntu-16.04.1-desktop-amd64.iso is already mounted
fatlabel: warning - lowercase labels might not work properly with DOS or Windows
tune2fs 1.42.12 (29-Aug-2014)
---------------------------------------------------------------------------
source=/mnt/hgfs/ACTIVE_SOFTWARE/Other OS/ubuntu-16.04.1-desktop-amd64.iso
---------------------------------------------------------------------------
item 60
umount: /dev/sdb3: mountpoint not found
mount /dev/sdb3 /tmp/tmp.tbI9gMJvTc
mount: special device /dev/sdb3 does not exist
 '/dev/sdb3' could not be mounted 
umount: /dev/loop-control: not mounted
umount: /dev/loop1: not mounted
umount: /dev/loop2: not mounted
umount: /dev/loop3: not mounted
umount: /dev/loop4: not mounted
umount: /dev/loop5: not mounted
umount: /dev/loop6: not mounted
umount: /dev/loop7: not mounted
/usr/sbin/mkusb: line 3339:  2962 Terminated              tail -f "$tailfile"
      2963                       | zenity --progress --title="$version - preparing persistent live drive ..." --percentage=0 --auto-close --no-cancel --window-icon="/usr/share/icons/hicolor/48x48/apps/mkusb.png" 2>> "/dev/null"
Cleanup after mkusb finished :-)
Zenity error log-file 'zerrlog'=/tmp/tmp.JjJD0x6y2Y

2 Answers2

1
  1. I will try to help you, and fix the bug, if there is one in the current version of mkusb. So I suggest, that you update mkusb to the current stable version, mkusb - 12.0.0-1ubuntu5 alias mkusb-dus, and try again. You were using mkusb 11.0.5. Several bugs are fixed between these two versions.

    Install and use mkusb according to the mkUSB-quick-start-manual.pdf.

    If you have the stable PPA already, ppa:mkusb/ppa, you can run the following commands

    sudo apt-get remove mkusb
    sudo apt-get update
    sudo apt-get install mkusb mkusb-nox usb-pack-efi
    
  2. What the log tells me, is that you boot from /dev/sda and there are problems with the partition /dev/sdb3 (of the target device). Could it be that the system is using /dev/sdb3 as the boot partition or EFI partition? (This might be a bug.)

  3. What happens if you boot with the target drive unplugged? Plug it in after booting the computer, and start mkusb after that. I hope it works, otherwise please post the new log file.


Edit:

Test with Lubuntu 16.04.1 LTS (a linux only test)

I tested with mkusb-dus version 12.0.2 from the unstable PPA, ppa:mkusb/unstable, and could not reproduce the bug in Lubuntu 16.04.1 LTS in BIOS mode (neither booted an installed nor a persistent live system). I tried also in UEFI mode (booting from a persistent live drive) but could not reproduce the bug. I tested with two almost identical pendrives present during boot.

Analysis of the test case of @sk1tt1sh (using LiLi in Windows)

  • I tested mkusb in a (persistent) pendrive made with LiLi running Ubuntu 15.04 (amd64).

  • There was a similar pendrive as the target drive (also made with LiLi).

  • First test: I booted with both pendrives plugged in, and there was confusion. It seemed that it booted from one of the drives and used persistence from the other drive. This created problems for mkusb (also the current mkusb-dus), because both drives were locked and it was not possible to unmount the partition(s) on any of the drives.

  • Second test: I booted with only one of the drives plugged in, and plugged in the other drive when the operating system was running. Then mkusb could create its persistent live system into the other drive. It was not necessary to delete any partitions before starting mkusb.

  • Comments: A work-around in the first test case might be to boot to RAM (with the boot option toram). Then at least one of the drives would be released and possible to use as a target device.

It is possible that there were other conditions and other things were happening for the original poster @ Gediz GÜRSU as well as for @sk1tt1sh.

Conclusion

It works for me to boot with only one drive drive plugged in, to avoid this confusion. The target drive, where you want to create a new persistent live system, can be plugged in when the operating system is running.

I need not delete any partitions before starting mkusb-dus, but there seems to be cases, that I have not tested, where it is necessary.

sudodus
  • 46,324
  • 5
  • 88
  • 152
  • Thank you for your reply, however I have managed to activate persistent mode by terminal and manually without using software. So it is not needed anymore.

    In my opinion , persistent mode installation on usb stick and performing a non-live install on usb stick, must be one click operations in ubuntu LIVE image. Because ubuntu is very portable it works with almost every hardware you can boot on. To leverage this, afore mentioned installation scripts is must for standard non IT user.

    – Gediz GÜRSU Jan 30 '17 at 08:17
  • @ Gediz GÜRSU, Which afore mentioned script(s) would you like to have (built into the iso file)? - Am I understanding correctly, that you want the Ubuntu Startup Disk Creator to be able to create a persistent live drive? Before the Ubuntu version 16.04 this was the case, but the whole Ubuntu Startup Disk Creator was notoriously buggy (for several years). So it was revamped into a cloning tool, which is very robust. But the result is an ISO 9660 partition and file system, which is read-only and cannot use a file or partition for persistence on the same drive. – sudodus Jan 30 '17 at 09:03
  • 1
    I solved the issue by leaving persistent mode and installing ubuntu on a usb stick directly via selecting it as a physical drive in a virtual machine environment. And it booted and works like a charm.

    I have also accomplished persistent mode install but It didnt worked for me. It was buggy , slow and some more issues I cant remember. But I could not install it using mkusb. I did it manually from command line. I expect one click results from GUI applicaiton if I cant get this result. I think I might as well give it a go from terminal classical way.

    – Gediz GÜRSU Feb 27 '19 at 16:42
  • @GedizGÜRSU, I agree, it is a good idea to install Ubuntu into a USB stick like into an internal drive. An installed system in a USB drive is very flexible, can be updated & upgraded like any installed system, and it is portable between many computers, but not as portable as a persistent live system. Recently I made an image, to be cloned to a 16 GB USB stick to get a dual boot system with both Lubuntu persistent live and Lubuntu installed. – sudodus Feb 27 '19 at 20:33
  • There is only one problem: usbs get hot. Watching a movie when playing with web based flash player , an usb of us got damaged (Sandisk Cruizer Glide 16 GB). It gets very hot very fast. I havent tried to optimize it yet. – Gediz GÜRSU Mar 03 '19 at 08:08
  • @GedizGÜRSU, There will be no write actions to a live-only USB pendrive. There will be less write actions to a persistent live drive compared to a drive with an installed system. But some USB pendrives get hot even when they are idle. – sudodus Mar 03 '19 at 08:24
1

There appears to be an issue with how the DUS/mkusb tool deal with existing partitions. The route that was successful for me is as follows:

  1. Boot a live ubuntu, or if you have a full install use that
  2. Plug in the target drive and click the launcher symbol and type "Disks" (no quotes)
  3. Select the target flash drive and delete any and all partitions
  4. Use DUS/GUIDUS/mkusb and go through the normal persistent drive creation steps.

This worked for me two times, wherein the drives both experienced that issue.

-sk1t

  • Why did this get down voted? – sk1tt1sh Jan 28 '17 at 17:57
  • I don't know. Maybe someone thinks it is too brief and would like more details. I can upvote it and bring it to a zero again -1+1=0. – sudodus Jan 30 '17 at 09:07
  • Thanks sudodus. Additionally thank you very much for your work on the tool. – sk1tt1sh Jan 30 '17 at 22:33
  • You are welcome :-) Can you remember which version of mkusb / dus was affected by this bug, when you tested it? I will try to reproduce it in order to squash the bug. – sudodus Jan 31 '17 at 05:24
  • In order to reproduce the bug I need many details: Please tell me 1) which version and flavour of Ubuntu you are running (the system where you install mkusb-dus), 2) Was it an installed system or a persistent live system? 3) which version of mkusb-dus did you install, 4) which method did you use to install mkusb-dus, 5) did you connect the target pendrive before or after booting? - The reason for all these questions is that I suspect problems if there are two identical or very similar persistent live drives present when booting. Otherwise there might be a completely different problem (bug). – sudodus Jan 31 '17 at 07:34
  • I tested with mkusb-dus version 12.0.2 from the unstable PPA, ppa:mkusb/unstable, and could not reproduce the bug in Lubuntu 16.04.1 LTS in BIOS mode (neither booted an installed nor a persistent live system). I tried also in UEFI mode (booting from a persistent live drive) but could not reproduce the bug. I tested with two almost identical pendrives present during boot. – sudodus Jan 31 '17 at 10:17
  • To lend my experience I was using the stable ppa. The conditions for my testing were: boot a 15.04 version of a live drive then try to use mkusb on an already setup LiLi (Linux Live USB windows tool) drive that had 15.04 on it. It's worth noting it uses the casper, casper-rw with the squashfs style setup of the drive. This is how it happened to me. – sk1tt1sh Jan 31 '17 at 14:10
  • 1
    Thanks for the description of your case :-) I have not tested with 15.04 since it passed end of life, but I can try tomorrow. Is LiLi booting with syslinux? I am a little surprised that it needed wiping (with Disks), because one of the first things mkusb-dus does, is to wipe the first megabyte (to remove the partition table). – sudodus Jan 31 '17 at 17:28
  • Yes. Syslinux. I suppose the issue could be in that the partition table is completely wiped where mkusb is only blowing out that byte so there's some sort of lingering data that's making the mountpoint look weird? I think the same issue would probably occur with 16.04 live. If I get a chance tonight I'll try it. – sk1tt1sh Jan 31 '17 at 17:34
  • I tested mkusb in a (persistent) pendrive made with LiLi running Ubuntu 15.04 (amd64). I had a similar pendrive as the target drive (also made with LiLi). I booted with both pendrives plugged in, and there was confusion. It seemed that it booted from one of the drives and used persistence from the other drive. This created problems for mkusb (also the current mkusb-dus). - After that I booted with only one of the drives plugged in, plugged in the other drive after booting. Then mkusb could create its persistent live system into the other drive without deleting any partitions. – sudodus Feb 01 '17 at 15:50
  • Strange, that's what I tried according to your initial answer. Perhaps there is other issues with the drive that I was using. – sk1tt1sh Feb 01 '17 at 18:27
  • Perhaps. USB drives are not strictly standardized. There could also be issues with the USB hardware in the computer, that make things work differently in different computers. - Anyway, when problems, wiping the drive according to your answer is the right thing to do. – sudodus Feb 01 '17 at 18:41
  • I can confirm removing existing partitions from the USB drive fixed the described issue. Using dus-persistent 12.2.9 with Ubuntu 16.04 via Oracle VirtualBox. – Simo Erkinheimo Jan 07 '18 at 15:11
  • 1
    This fix didn't work for me. I have Ubuntu 16.04 running in a VM though (Win 10 host, Virtualbox), so I can see that this isn't really an ideal setup. – oli Apr 23 '20 at 21:28
  • This did not work for me. It is unable to mount /dev/sdb3 which is the FAT partition. I was able to manually mount /dev/sdb3 /mnt and ls shows backup, boot/, efi/ and others. This is on an old Acer E3-111 with Lubuntu 16 on it. iso was Ubuntu 19.04. BTW. I also tried with Ubuntu 2 MATE with same result but additionally it complained about this iso not beeing Ubuntu... – bomben Dec 10 '21 at 15:52
  • You also might have a bug in the code because at one point the log shows umount /dev/sdb3: no mount point specified. – bomben Dec 10 '21 at 15:54
  • I solved my problem by not picking upefi but instead using default values. This guide was wrong in that regard: https://www.howtogeek.com/howto/14912/create-a-persistent-bootable-ubuntu-usb-flash-drive/ – bomben Dec 10 '21 at 16:18