2

I followed this article: Create a persistent Ubuntu USB which boots to RAM so I can have Ubuntu running from a USB and it will persist any changes I make.

The problem is it doesn't persist - I created a text file, saved it, and shut down. Than I boot my laptop, pick the USB from the menu, I see the Ubuntu OS but the file is gone. I tried the first option (using the hard drive) and the second (using the RAM).

enter image description here

Edit: Here is the output that was requested in the comments

ubuntu@ubuntu:~$ df -h ; sudo lsblk -f ; sudo lsblk -m ; echo "hello world" > hello.txt
Filesystem      Size  Used Avail Use% Mounted on
udev            3.8G     0  3.8G   0% /dev
tmpfs           767M  9.5M  757M   2% /run
/dev/sdb4       1.5G  1.5G     0 100% /cdrom
/dev/loop0      1.4G  1.4G     0 100% /rofs
aufs            3.8G   35M  3.8G   1% /
tmpfs           3.8G   26M  3.8G   1% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           3.8G     0  3.8G   0% /sys/fs/cgroup
tmpfs           3.8G  580K  3.8G   1% /tmp
tmpfs           767M   76K  767M   1% /run/user/999
/dev/sdb5       2.5G  3.9M  2.3G   1% /media/ubuntu/99b89b3c-5035-4a32-bf5a-514640fc7493
/dev/sdb1        11G   53M   11G   1% /media/ubuntu/usbdata
NAME   FSTYPE  LABEL             UUID                                 MOUNTPOINT
sdb                                                                  
├─sdb4 iso9660 Ubuntu 16.04.2 LTS amd64
│                                2017-02-15-21-44-13-00               /cdrom
├─sdb2                                                               
├─sdb5 ext4                      99b89b3c-5035-4a32-bf5a-514640fc7493 /media/ubu
├─sdb3 vfat    usbboot           E2B5-7A49                           
└─sdb1 ntfs    usbdata           25FB337F388A948A                     /media/ubu
loop0  squashf                                                        /rofs
sda                                                                  
├─sda2                                                               
├─sda5 swap                      6fa9b4a3-962f-4677-8055-e5192e2f1fb3 [SWAP]
└─sda1 ext4                      7edab5f8-81d1-45c8-93de-cf3dfe74d152
NAME     SIZE OWNER GROUP MODE
sdb     14.3G root  disk  brw-rw----
├─sdb4   1.5G root  disk  brw-rw----
├─sdb2     1M root  disk  brw-rw----
├─sdb5   2.6G root  disk  brw-rw----
├─sdb3   122M root  disk  brw-rw----
└─sdb1  10.2G root  disk  brw-rw----
loop0    1.4G root  disk  brw-rw----
sda    223.6G root  disk  brw-rw----
├─sda2     1K root  disk  brw-rw----
├─sda5   7.7G root  disk  brw-rw----
└─sda1 215.9G root  disk  brw-rw----


--------


ubuntu@ubuntu:~$ df -h ; sudo lsblk -f ; cat hello.txt
Filesystem      Size  Used Avail Use% Mounted on
udev            3.8G     0  3.8G   0% /dev
tmpfs           767M  9.5M  757M   2% /run
/dev/sdb4       1.5G  1.5G     0 100% /cdrom
/dev/loop0      1.4G  1.4G     0 100% /rofs
aufs            3.8G   35M  3.8G   1% /
tmpfs           3.8G   26M  3.8G   1% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           3.8G     0  3.8G   0% /sys/fs/cgroup
tmpfs           3.8G  580K  3.8G   1% /tmp
tmpfs           767M   68K  767M   1% /run/user/999
/dev/sdb5       2.5G  3.9M  2.3G   1% /media/ubuntu/99b89b3c-5035-4a32-bf5a-514640fc7493
/dev/sdb1        11G   53M   11G   1% /media/ubuntu/usbdata
NAME   FSTYPE   LABEL                    UUID                                 MOUNTPOINT
sdb                                                                          
├─sdb4 iso9660  Ubuntu 16.04.2 LTS amd64 2017-02-15-21-44-13-00               /cdrom
├─sdb2                                                                       
├─sdb5 ext4                              99b89b3c-5035-4a32-bf5a-514640fc7493 /media/ubuntu/99b89b3c-5035-4a32-bf5a
├─sdb3 vfat     usbboot                  E2B5-7A49                           
└─sdb1 ntfs     usbdata                  25FB337F388A948A                     /media/ubuntu/usbdata
loop0  squashfs                                                               /rofs
sda                                                                          
├─sda2                                                                       
├─sda5 swap                              6fa9b4a3-962f-4677-8055-e5192e2f1fb3 [SWAP]
└─sda1 ext4                              7edab5f8-81d1-45c8-93de-cf3dfe74d152
cat: hello.txt: No such file or directory

More information:

mkusb -v

mkusb-dus:   dus 12.2.2
mkusb-11:  mkusb 11.2.1
mkusb-nox: mkusb-nox 11.1.9
mkusb-bas: mkusb version 7.4.2

I am running it on my laptop that have Ubuntu 16.04 -

cat /etc/lsb-release

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.2 LTS"

I run the following:

sudo add-apt-repository universe
sudo add-apt-repository ppa:mkusb/ppa
sudo apt-get update
sudo apt-get install mkusb
sudo -H mkusb

This is the initial output:

Usage: mkusb [input-file]      # optional parameter
---------------------------------------------------------------------
d:  dus , guidus, mkusb-dus    - New, easy to use
e: Eleven, sudo -H mkusb-11    - Classic user interface
n: NoX,    sudo mkusb-nox      - original text mode
b: Bas,    sudo mkusb-bas      - basic text mode for old/basic linux
q: Quit
---------------------------------------------------------------------
Select version of mkusb (d/e/n/b/q) 

And during the installation I believe I chose msdos and to use 20%.

roy
  • 287
  • 2
    In order to help I need some detailed information about your system. Please run the following commands and edit your original question to show the output from the commands (as code by indenting four spaces). Boot from the USB pendrive. First select 'Run Ubuntu - persistent live' Open a terminal window. Run df -h ; sudo lsblk -f ; sudo lsblk -m ; echo "hello world" > hello.txt . Reboot and select 'Run Ubuntu - persistent live' and open a terminal window again. Run df -h ; sudo lsblk -f ; cat hello.txt . (Copy and paste the content in the terminal window into the question.) – sudodus Jul 13 '17 at 05:43
  • 1
    When starting up, do you see any messages about "checking disk", or unclean shutdown? – ubfan1 Jul 14 '17 at 04:10
  • I can't remember any message like this but I'll keep my eyes alert to similar messages. – roy Jul 14 '17 at 08:39
  • Ubuntu 16.04.2 LTS is a new system, released after mkusb version 11 (with the classic user interface) was developed and updated. sudo -H mkusb is a deprecated command. Today you should either start mkusb from dash or with the command line mkusb and select 'd' to get dus (or 'e' to get mkusb-11 (the classic user interface)). I think you have better chances to succeed with new versions of Ubuntu, if you use dus alias mkusb version 12. So please try that way (and check like you did before to find out if you manage to create and run a persistent live system). – sudodus Jul 14 '17 at 10:12
  • Did you try to put the label 'casper-rw' onto the partition for persistence (in our tests /dev/sdb5)? In that case, what was the result? – sudodus Jul 14 '17 at 10:19
  • I didn't try putting the label 'casper-rw'. would you like to share the commands for doing it? I assume it should be done on my host laptop, and than I should reboot, hit f12, and chose the USB stick? – roy Jul 14 '17 at 15:21
  • It is already in the answer: Boot live-only. First check that the target partition is the correct one, /dev/sdb5 . Then you can try with the following commands,

    sudo umount /dev/sdb5 and sudo tune2fs -L casper-rw /dev/sdb5

    – sudodus Jul 14 '17 at 15:24
  • I decided to repeat the steps but with the 'mkusb' command without any arguments. first I hit 'd'. Than I hit 'i' - install (make a boot device). Than I hit 'p' - persistent live. Than I am presented with a yes no question but I don't understand it: http://paste.ubuntu.com/25093582/ – roy Jul 15 '17 at 03:31
  • Also, you wrote above: 'First check that the target partition is the correct one, /dev/sdb5'. How do I do that? What exactly should I look for? – roy Jul 15 '17 at 03:32
  • For example drive size and file system and model name as seen by sudo lsblk -f; sudo lsblk -m; sudo parted -ls -- At this stage the AskUbuntu system suggests that we continue in a chat room. So please join this chat room :-) – sudodus Jul 15 '17 at 05:06

2 Answers2

1

Beginning to debug your problem

  • In the output of df -h the line for aufs should match that of /dev/sdb5

    aufs            3.8G   35M  3.8G   1% /
    /dev/sdb5       2.5G  3.9M  2.3G   1% /media/ubuntu/99b89b3c-5035-4a32-bf5a-514640fc7493
    

    but the sizes are different. This indicates, that persistence does not work.

  • The partition /dev/sdb5 should be labeled 'casper-rw', but no label is found by lsblk -f

    NAME   FSTYPE  LABEL             UUID                                 MOUNTPOINT
    ...
    ├─sdb5 ext4                      99b89b3c-5035-4a32-bf5a-514640fc7493 /media/ubu
    

    I am surprised, that there is no label on this partition. Maybe this is the only reason why persistence does not work. Boot live-only. First check that the target partition is the correct one, /dev/sdb5. Then you can try with the following commands,

    sudo umount /dev/sdb5
    sudo tune2fs -L casper-rw /dev/sdb5
    

    reboot and try again, if there is persistence.

A working persistent live system

It looks like this in a working persistent live system with the default settings (in my Sandisk Extreme 16 GB pendrive)

ubuntu@ubuntu:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            1.9G     0  1.9G   0% /dev
tmpfs           384M  6.4M  378M   2% /run
/dev/sdb4       1.5G  1.5G     0 100% /cdrom
/dev/loop0      1.4G  1.4G     0 100% /rofs
aufs            6.6G   21M  6.2G   1% /
tmpfs           1.9G  172K  1.9G   1% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           1.9G     0  1.9G   0% /sys/fs/cgroup
tmpfs           1.9G  4.0K  1.9G   1% /tmp
tmpfs           384M   72K  384M   1% /run/user/999
/dev/sdb5       6.6G   21M  6.2G   1% /media/ubuntu/casper-rw
/dev/sdb1       6.7G   35M  6.6G   1% /media/ubuntu/usbdata
ubuntu@ubuntu:~$ lsblk -f
NAME   FSTYPE   LABEL                    UUID                                 MOUNTPOINT
sdb                                                                           
├─sdb4 iso9660  Ubuntu 16.04.2 LTS amd64 2017-02-15-21-44-13-00               /cdrom
├─sdb2                                                                        
├─sdb5 ext4     casper-rw                713e6d96-24fe-443e-adf8-25d9212e5d33 /media/ubuntu/casper-rw
├─sdb3 vfat     usbboot                  CC21-48C5                            
└─sdb1 ntfs     usbdata                  0514A98E7CA45722                     /media/ubuntu/usbdata
loop0  squashfs                                                               /rofs
sda                                                                           
├─sda4 swap                              b69324e1-cab0-459c-97f3-bb42926ee94e [SWAP]
├─sda2                                                                        
├─sda3 ext4     root                     864c54c6-961a-4ad9-8c23-35eb8e0f24fb 
└─sda1 vfat     EFI                      274B-0C82                            
ubuntu@ubuntu:~$ lsblk -m
NAME     SIZE OWNER GROUP MODE
sdb     14.9G root  disk  brw-rw----
├─sdb4   1.5G root  disk  brw-rw----
├─sdb2     1M root  disk  brw-rw----
├─sdb5   6.6G root  disk  brw-rw----
├─sdb3   244M root  disk  brw-rw----
└─sdb1   6.6G root  disk  brw-rw----
loop0    1.4G root  disk  brw-rw----
sda    232.9G root  disk  brw-rw----
├─sda4     5G root  disk  brw-rw----
├─sda2     1M root  disk  brw-rw----
├─sda3   100G root  disk  brw-rw----
└─sda1   300M root  disk  brw-rw----
ubuntu@ubuntu:~$ 
sudodus
  • 46,324
  • 5
  • 88
  • 152
  • @roy, I am surprised, that there is no label on the partition /dev/sdb5. Please describe how you created the persistent live drive. Which host operating system were you using? Which version of mkusb were you using? Did you modify the drive somehow, for example edit the partitions, modify labels etc? Maybe you can try again, and use the current version of mkusb version 12 alias mkusb-dus. – sudodus Jul 14 '17 at 04:55
  • I updated my question with the information you asked about. I can try again and document the exact answers I gave during the installation. – roy Jul 14 '17 at 08:40
  • so the solution was the two commands: sudo umount /dev/sdb5 and sudo tune2fs -L casper-rw /dev/sdb5.

    where can I submit a bug?

    – roy Jul 15 '17 at 21:42
  • Three more questions:
    1. i tried to use it on my mac book but i was not able to see the usb when i hit the option key during the boot.

    2. is there a way to skip the question of HD or RAM so it will always use one or the other?

    3. Is there a way tell my laptop to not present me with the option of what drive to boot from and alway boot from the USB? i assume it's in the bios? i am on carbon x1.

    – roy Jul 15 '17 at 21:44
  • I replied in the chatroom, that we used yesterday. I think you can find it if you try to write a comment to your original question (or via the history in your web browser). – sudodus Jul 16 '17 at 04:26
  • sorry. I am a bit confused. is this an answer to 1, 2 or 3 above? – roy Jul 16 '17 at 10:49
  • Yes, the answer dated 5:56 (central European time). If you cannot find the chatroom, I will copy the answer here. – sudodus Jul 16 '17 at 11:20
0

I don't know mkusb or what it's trying to do but I wanna give you some advices.

Try this options too:

First, the simplest way, create a live cd or dvd (preferably) installation and try to create a new user (other than the ubuntu user), I have understood that work but I never tried honestly.
Advantage:
· you will be logged in 5 seconds.
Disadvantages: · you could not install updates because your system will crash for incompatibilities when trying to create new images.. update kernel.. or something like that, I really don't know and not remember also.
· keep reading..

Another way is trying to install directly in the usb-stick, but you should keep this in mind:
· Do your usb-stick act as an SDD? so you have to consider things like noatime, nodiratime and stuffs like that (Info for debian)

My best advice would be this: did you tried to install on the usb-stick but it fail? well, do not try reinstall again... instead, try to recover your usb-stick to normal state (format compatible, full capacity, etc), then try again. I've had bad experiences last week related to performance and "Unable to format USB drive with Disks (udisks-error-quark, 0)" In fact I'm just trying to get some reputation to answer HOW TO RECOVER your usb from that -.-

I'm not reply to mkusb, neither giving a solution.. I know that, but if you're loosing a lot of time installing at 2nd time think about this

Karmavil
  • 101
  • 1
    Please ask an own question (and make a comment here with a link to it) :-) and I will discuss the problem with you (and try to help if you need help). – sudodus Jul 14 '17 at 06:27
  • 1
    Thank you @sudodus I will. I just recover the micro-usb 15 gb, tomorrow I will recover the micro-usb 31 gb and I will try again to install debian there. If I get errors or take too long I will open a new ticket. – Karmavil Jul 14 '17 at 06:36
  • You might find mkusb useful in order to restore your 'micro-usb' drives to standard storage devices. Restore to a standard storage device is one of the tasks, that are made easy with mkusb. See this link, https://help.ubuntu.com/community/mkusb/wipe – sudodus Jul 14 '17 at 06:49