You are not logged in.

#21 2015-11-07 16:40:28

hhh
Gaucho
From: High in the Custerdome
Registered: 2015-09-17
Posts: 16,036
Website

Re: [SOLVED] Cannot create a USB stick with persistence

^Right, we're on the same page now that I've rested. I did use an 8G US drive, but I'm thinking the -d /syslinux command fails because at that point there is no /syslinux directory on the drive, hence the invalid target messages I was getting. I'm figuring you didn't get those errors because you first ran just '(sudo) syslinux -i /dev/sdXY' and didn't run the modified command till the end when everything was extracted and renamed.

You're being perfectly clear about what failed for you. I'm saying that I've slightly modified the instructions I've posted at #! and they work for me when running them from a BL/jessie system. I've already added a note at the bottom of my tutorial with the new command and a link to this thread, as I said. I'm hoping that takes care of problems for people running this from stretch or sid, since it worked for you. I'd like to make this a stickied tutorial, since clear instructions for making a persistent Debian USB don't exist IMO, but it would probably have to only be for jessie systems and it would need more verification.

On a side note, it's really good to have you here. I've come quite a ways from not being able to successfully Debianize xscreensaver, haven't I. smile


No, he can't sleep on the floor. What do you think I'm yelling for?!!!

Online

#22 2015-11-07 16:45:16

xaos52
The Good Doctor
From: Planet of the @pes
Registered: 2015-09-30
Posts: 695

Re: [SOLVED] Cannot create a USB stick with persistence

You sure have. smile
As have damo and John smile
Well done. I am proud of you guys.

Offline

#23 2015-11-07 19:16:53

nobody0
Disabled account
Registered: 2015-09-29
Posts: 664

Re: [SOLVED] Cannot create a USB stick with persistence

You might find some scripts for persistence in this page http://kanotix.com/files/fix/

Offline

#24 2015-11-07 19:36:04

hhh
Gaucho
From: High in the Custerdome
Registered: 2015-09-17
Posts: 16,036
Website

Re: [SOLVED] Cannot create a USB stick with persistence

I can't speak for damo or johnraff, but that means a helluvalot to me, xaos, seriously.

The #! forums are very buggy lately, I thought I'd better copy this tutorial here just in case.

-edit- Updated for helium/stretch
I did this from a BL helium/stretch 64 bit desktop. This is a bit long but it's not complicated. Just be sure to always use the USB drive letter for your drive. You'll most likely be in a world of pain if you do a command to /dev/sda (No!!! sd"a" is probably your hard drive!!! Pick another letter!)

Create a Debian Live 9.* (stretch) USB with Persistence

You'll need a USB key of 4G minimum, 8G or more recommended, and a BunsenLabs helium/stretch ISO...
https://www.bunsenlabs.org/installation … ey-install

You'll also need the following packages...

gparted
mbr
syslinux
p7zip

If you're using these instructions from a BunsenLabs system, the following command will install the packages you need...

sudo apt-get install --no-install-recommends mbr syslinux p7zip

I'm assuming you know the identity of your USB drive (/dev/sdb, for example). I'll use /dev/sdX from here on so nobody copy/pastes the wrong drive.

Partition the USB Drive

@johnraff wisely recommends that you temporarily uncheck "Enable Volume Management" in Thunar>Edit>Preferences>Advanced while creating your persistent USB. You'll need to log out before continuing to make the Thunar changes take effect, or you can kill thunar --daemon.

Open gparted, go to the drive drop-down menu in the upper-right corner (/dev/sda (x.x GiB) and choose your USB drive. Make sure any existing partitions on it are unmounted. If the drive size is 300 GiB, that's probably not the drive you want. 8o

HERE WE DELETE ALL CONTENTS ON THE DRIVE!!! MAKE SURE YOU'RE NOT ERASING YOUR COMPUTER'S DRIVE!!! From the menu bar, choose Device>Create Partition Table...>msdos>Apply. Bye-bye drive contents!

Create a bootable fat32 partition large enough to hold your ISO, plus additional space in case a kernel upgrade becomes available (I have no idea how to make the USB "see" a new kernel if it gets installed.); Ben Armstrong recommends an additional 5%. The ISO I'm using is about 850MB so 1G (1024MB) should be plenty... Right-click the "unallocated" bar>New>New Size (MiB):>1024, Create as:>Primary Partition, File System:>fat32, Add. Click the giant green checkmark in the toolbar at the top of the window and Apply. Now right-click that partition, choose Manage Flags and check "boot".

Right-click "unallocated" again and create an ext4 file system in the remaining space and in the "Label:" field type in "persistence" w/out quotes. Spell it right, please. tongue Add and Apply.

You should now have 2 partitions, /dev/sdX1, a fat32 partition with the Flag "boot" and /dev/sdX2, an ext4 partition with the Label "persistence". Close gparted.

Set Up the Master Boot Record

MAKE SURE YOU USE THE RIGHT DRIVE LETTER SO YOU DON'T OVERWRITE AN EXISTING MBR, LIKE THE ONE ON YOUR HARD DRIVE!!!
Open a terminal and enter the following...

sudo /sbin/install-mbr /dev/sdX

That installs the MBR to the first sector of the drive, hence no number after the drive letter. Then...

sudo syslinux -i /dev/sdX1

Extract the ISO to the First Partition

Mount the partition to a directory, I use /mnt because it's empty (check that it is first, or create an empty directory and use that!)...

sudo mount /dev/sdX1 /mnt

Extract the ISO with p7zip. Mine is in ~/Documents and is named bl-live-rc1-i386.hybrid.iso, so...

cd /mnt
sudo 7z x /home/hhh/Documents/bl-live-rc1-i386.hybrid.iso

Adjust your path and ISO name, of course. The extraction will take a few to several minutes.

Set Up Persistence

We're almost done. We need to rename some things and append the live boot parameters to make sure the ISO boots and is persistent. Run these commands, one at a time...

sudo mv isolinux syslinux
sudo mv syslinux/isolinux.cfg syslinux/syslinux.cfg
sudo mv syslinux/isolinux.bin syslinux/syslinux.bin
sudo sed -i 's/\(append boot=.*\)$/\1 persistence/' syslinux/live.cfg
cd ..
sudo umount /mnt

Now we create the persistence.conf file in the second partition...

sudo mount /dev/sdX2 /mnt
cd /mnt
echo / union | sudo tee persistence.conf

Finally...

sudo syslinux -i /dev/sdX1 -d /syslinux

That's it. Set your Thunar preferences back to how you had them, reboot to your USB drive and choose a Live session. You'll see messages about your drives not mounting to /live/persistence, that's normal. The first time you boot, you'll see a brief cron job running, that's the persistence being configured.

You should be automatically logged into the session. If you want to log out, the username is user and the password is live. You should be able to change those settings, because we now have a persistent USB! Make some changes to your desktop (maybe set your time zone with 'sudo dpkg-reconfigure tzdata') and reboot to check if persistence is working.

Cheers!

Pic or it didn'thappen...
Screenshot_2018-05-26_02-40-08.th.png


No, he can't sleep on the floor. What do you think I'm yelling for?!!!

Online

#25 2015-11-15 21:02:01

Naik
Member
From: the edge of insanity
Registered: 2015-10-03
Posts: 328

Re: [SOLVED] Cannot create a USB stick with persistence

Id did as suggested in the last post and have a great os2go now on a 16G USB-Key. I also added a 3rd NTFS partition in order to still be able to simply carrie data from one workstation to another and everything works like a charm! Thanxs!


"Kaum macht [Mensch]* es richtig, funktioniert es sofort!"
BL-Kitchen Codeberg

Offline

#26 2015-11-30 03:24:48

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,557
Website

Re: [SOLVED] Cannot create a USB stick with persistence

hhh wrote:

I can't speak for damo or johnraff, but that means a helluvalot to me, xaos, seriously.

I missed it at the time, but it is appreciated. smile

@johnraff wisely recommends that you temporarily uncheck "Enable Volume Management" in Thunar>Edit>Preferences>Advanced while creating your persistent USB. You'll need to log out before continuing to make the Thunar changes take effect.

'killall thunar' is enough. Next time it starts it will use the new setting.

Last edited by johnraff (2017-04-15 01:08:35)


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#27 2015-12-10 20:46:22

marc
New Member
Registered: 2015-12-10
Posts: 1

Re: [SOLVED] Cannot create a USB stick with persistence

hhh wrote:

You should be automatically logged into the session. If you want to log out, the username is user and the password is live. You should be able to change those settings, because we now have a persistent USB! Make some changes to your desktop (maybe set your time zone with 'sudo dpkg-reconfigure tzdata') and reboot to check if persistence is working.

Cheers!

It worked perfectly for me except for one hangup.

sudo: unable to stat /etc/sudoers: No such file or directory
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin

The live user is not in the sudoers list/group.  Since I don't know the "root" password, I can't create a new user or allow the live user to change, update or add software.

Where did I go wrong?

Thanks.

Last edited by marc (2015-12-10 21:07:58)

Offline

#28 2015-12-20 21:54:26

zaleksf
New Member
Registered: 2015-12-20
Posts: 2

Re: [SOLVED] Cannot create a USB stick with persistence

Hello, All:

The procedure devised previously by hhh worked perfectly for me, using Debian 8.2.

But I cannot leave well enough alone.... I would like to use a similar/modified/follow-on procedure to update to a Debian Stretch live system on a usb stick. I did update the apt sources.list file on the live system to Stretch/Testing and that went well, sort-of. The live usb system would boot and run, but ultimately there were conflicts, since the live system still boots with kernel 3.16 and the updated system wants to run with kernel 4.2, so things like mounting other disks are an issue, etc.

Any thoughts on how to approach this in a better way? Or should I just behave and stick with Debian 8.2 live?

Thanks!

Offline

#29 2015-12-21 08:49:54

dolly
Miss Mixunderstand
From: /lab701
Registered: 2015-10-03
Posts: 490

Re: [SOLVED] Cannot create a USB stick with persistence

Personally I would stay with stable if everything works ok. The neverending stream of upgrades are a boring nuisance on an usb install. smile

Offline

#30 2015-12-21 09:06:41

Naik
Member
From: the edge of insanity
Registered: 2015-10-03
Posts: 328

Re: [SOLVED] Cannot create a USB stick with persistence

I tried this as well and besides of installing bunsen to harddisk, updating sources and system, repacking the whole thing with something like

mksquashfs /some/dir dir.squashfs

and renaming it and replacing the original filesystem.squashfs there seems to be no way to use an "unstable" kernel. unfortunatly this still could create problems with unmatched (sym-)links and has to be done for any new kernel again.

in fact i stayed with the stable one too until someone comes up with a better idea.
read (a little) more here.

naik --greetz


"Kaum macht [Mensch]* es richtig, funktioniert es sofort!"
BL-Kitchen Codeberg

Offline

#31 2015-12-21 14:39:01

zaleksf
New Member
Registered: 2015-12-20
Posts: 2

Re: [SOLVED] Cannot create a USB stick with persistence

Hi,

Thanks for your feedback. I have one laptop in particular that needs a post-jessie kernel/firmware set to get the wireless working properly, so I had hoped to be able to obtain those on a live setup. I see that Debian has tools to develop a unique live installation. I'll take a look at that.

Offline

#32 2016-05-02 09:51:25

michaelk42
Member
From: Indiana
Registered: 2016-05-01
Posts: 7

Re: [SOLVED] Cannot create a USB stick with persistence

hhh wrote:

You should be automatically logged into the session. If you want to log out, the username is user and the password is live. You should be able to change those settings, because we now have a persistent USB! Make some changes to your desktop (maybe set your time zone with 'sudo dpkg-reconfigure tzdata') and reboot to check if persistence is working.

I followed all the steps and everything seemed to work fine, but no persistence. Doesn't remember browser history/tzdata/wifi/etc. on reboot.

Is there something that could have silently gone wrong?

Offline

#33 2016-05-02 09:58:06

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,066
Website

Re: [SOLVED] Cannot create a USB stick with persistence

@michaelk42: please post the output of:

cat /proc/cmdline

Do you have a file called persistence.conf containing the line / union on the partition which is being used for persistence?

Offline

#34 2016-05-10 23:03:00

michaelk42
Member
From: Indiana
Registered: 2016-05-01
Posts: 7

Re: [SOLVED] Cannot create a USB stick with persistence

Head_on_a_Stick wrote:

@michaelk42: please post the output of:

cat /proc/cmdline

I get:

BOOT_IMAGE=/live/vmlinuz boot=live components quiet splash persistence initrd=/live/initrd.img

I can't find a persistence.conf anywhere on the flash drive.

Offline

#35 2016-05-11 06:27:14

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,066
Website

Re: [SOLVED] Cannot create a USB stick with persistence

So you are booting with the correct boot=live parameter.

michaelk42 wrote:

I can't find a persistence.conf anywhere on the flash drive.

Do you have the persistence partition on the drive?

Plug the drive in and post the output of:

sudo lsblk -f

Offline

#36 2016-05-14 09:11:42

michaelk42
Member
From: Indiana
Registered: 2016-05-01
Posts: 7

Re: [SOLVED] Cannot create a USB stick with persistence

Head_on_a_Stick wrote:

Plug the drive in and post the output of:

sudo lsblk -f
NAME   FSTYPE   LABEL       UUID                                 MOUNTPOINT
sda                                                              
└─sda1 ntfs                 436A3F4C166E6172                    
sdb                                                              
├─sdb1 vfat                 5944-8E19                            /lib/live/mount/pe
└─sdb2 ext4     persistence b1bd11e1-0d97-4db0-bb5b-81e1dcbd06e1

    loop0  squashfs

Offline

#37 2016-05-14 10:01:22

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,066
Website

Re: [SOLVED] Cannot create a USB stick with persistence

Is there a persistence.conf file on /dev/sdb2?

sudo mount /dev/sdb2 /mnt
ls /mnt

If not, create one:

sudo tee /mnt/persistence.conf <<< "/ union"

Offline

#38 2016-05-22 01:09:19

michaelk42
Member
From: Indiana
Registered: 2016-05-01
Posts: 7

Re: [SOLVED] Cannot create a USB stick with persistence

Head_on_a_Stick wrote:

Is there a persistence.conf file on /dev/sdb2?

sudo mount /dev/sdb2 /mnt
ls /mnt

If not, create one:

sudo tee /mnt/persistence.conf <<< "/ union"

That's there, it has the "/ union" in it and everything.

Offline

#39 2016-05-22 14:49:42

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,066
Website

Re: [SOLVED] Cannot create a USB stick with persistence

OK well that's my expertise exhausted, I've never actually set up a live USB with persistence anyway big_smile

I suggest that you start your own thread for your problem and include all details so far with a link back to this thread.

This thread is marked [SOLVED] and may not be checked by all forum users.

Offline

#40 2016-10-19 14:29:45

Tony
Member
From: Saskatchewan, Canada
Registered: 2016-04-22
Posts: 15

Re: [SOLVED] Cannot create a USB stick with persistence

This worked for me on the second try. On the "Now we create the persistence.conf file in the second partition..." instructions you should add at the end.....

cd ..
sudo umount /mnt

Without this the persistence.conf file is not created and my pc needed a hard power off to shut down. smile


One question, can I run update on this usb and keep it updated?

Offline

Board footer

Powered by FluxBB