You are not logged in.

#1 2015-09-30 20:01:39

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

[SOLVED] Cannot create a USB stick with persistence

-mod edit- For current BL helium instructions for the tutorial linked to in this post, see Post #24 in this thread. hhh

After reading this post https://forums.bunsenlabs.org/viewtopic … d=326#p326, went back to #! forums and read this http://crunchbang.org/forums/viewtopic. … 11#p438311. Took sometime to get 8GB usb stick ready and do exactly as the how-to to create the persistence usb stick with the BL RC1 64 bit iso. I get boot error, when I try to boot that usb stick. Any help?

If needed I'd write down the exact words I get on the screen.

Last edited by hhh (2018-05-15 23:24:06)

Offline

#2 2015-09-30 20:04:04

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

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

ostrołęk wrote:

If needed I'd write down the exact words I get on the screen.

Yes please.

You could even use a photo, as long as you post a thumbnail link rather than the fullsize image.

Where exactly in the booting process does it fail?


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#3 2015-09-30 20:15:22

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

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

MBR
Syslinux 6.03 EDD 20150813 (c) 1994-2014 H. Peter Anvin et al
Boot error

That's all I get.

Offline

#4 2015-09-30 20:27:32

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

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

What was the *exact* command that you used to install syslinux?

With your USB stick plugged in, please post the output of:

sudo parted -l

(This can be done from any distribution or live environment)


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#5 2015-09-30 20:30:09

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

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

Model:  USB DISK 2.0 (scsi)
Disk /dev/sdb: 8015MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  1075MB  1074MB  primary  fat32        boot
 2      1075MB  8015MB  6941MB  primary  ext4

The command to install syslinux,

sudo syslinux -i /dev/sdb1

Last edited by nobody0 (2015-09-30 20:32:01)

Offline

#6 2015-09-30 20:40:05

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

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

What is the content of syslinux/live.cfg and the output of:

sudo blkid

(Just the bit showing the USB stick will do)

I've only ever set up persistence with Kali and the method was slightly different so you may have to wait for hhh


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#7 2015-09-30 20:41:14

damo
....moderator....
Registered: 2015-08-20
Posts: 4,878

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

From the Arch wiki (don't know if it applies to your setup though):

Your boot partition, on which you plan to install Syslinux, must contain a FAT, ext2, ext3, ext4, or Btrfs file system. You should install it on a mounted directory—not a /dev/sdXY device. You do not have to install it on the root directory of a file system, e.g., with device /dev/sda1 mounted on /boot. You can install Syslinux in the syslinux directory:

Last edited by damo (2015-09-30 20:42:10)


Be Excellent to Each Other...

FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#8 2015-09-30 20:51:00

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

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

Head_on_a_Stick wrote:

What is the content of syslinux/live.cfg and the output of:

sudo blkid

(Just the bit showing the USB stick will do)

I've only ever set up persistence with Kali and the method was slightly different so you may have to wait for hhh

/dev/sdb1: UUID="F648-535D" TYPE="vfat"
/dev/sdb2: LABEL="persistence" UUID="93765744-f8ad-46b3-a975-ffdd0433a304" TYPE="ext4"

syslinux/live.cfg

label live-amd64
	menu label ^Live (amd64)
	menu default
	linux /live/vmlinuz
	initrd /live/initrd.img
	append boot=live components quiet splash persistence

label live-amd64-failsafe
	menu label ^Live (amd64 failsafe)
	linux /live/vmlinuz
	initrd /live/initrd.img
	append boot=live components memtest noapic noapm nodma nomce nolapic nomodeset nosmp nosplash vga=normal persistence

No hurry. I have to go now.

Last edited by nobody0 (2015-09-30 20:51:49)

Offline

#9 2015-10-01 02:59:43

hhh
That's it!
Registered: 2015-09-17
Posts: 7,465
Website

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

The instructions I posted on the #! forums were only tested from a jessie system. If your trying to run the commands from wheezy or another OS, it probably won't work.

Offline

#10 2015-10-01 05:42:38

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

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

hhh wrote:

The instructions I posted on the #! forums were only tested from a jessie system. If your trying to run the commands from wheezy or another OS, it probably won't work.

I was trying it on the BL RC1 64 bit iso

Offline

#11 2015-10-01 16:05:39

hhh
That's it!
Registered: 2015-09-17
Posts: 7,465
Website

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

ostrołęk wrote:

I was trying it on the BL RC1 64 bit iso

Sorry, I didn't make that post into a full-fledged tutorial because it didn't work for several people. Here are the Debian instructions...
http://live.debian.net/manual/git/html/ … n.html#558

Offline

#12 2015-10-02 21:39:01

SpaghettiCode
Member
Registered: 2015-09-29
Posts: 8

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

I was able to install BL directly to a USB stick so I could have a persistent OS on the go. Would that help at all? I think all you will lose is the live boot option but it's not needed if you can boot into a personalised setup.

Offline

#13 2015-10-06 12:08:44

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

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

I followed the procedure starting with the bl-Hydrogen-rc1-amd64.iso on a 8GB stick.
When trying to boot from the stick it said something about it being unbootable, though the boot flag was set correctly.

I found the solution for this in this link, the one hhh referred to, more specifically in the remark from Piotr Martycz:

I then just ran the command

syslinux -i /dev/sdX3 -d /syslinux

Then, lo and behold,  I could boot successfully into the live system with persistence.

Apparently it is caused by changes to the syslinux package.
Not elementary at all, if you ask me.
Without that remark I would have been as flabbergasted as anyone.

hth

Last edited by xaos52 (2015-10-06 12:56:03)

Offline

#14 2015-10-06 13:28:37

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

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

Not elementary at all. Would you care to write a how-to in https://forums.bunsenlabs.org/viewforum.php?id=9 , xaos52?

Offline

#15 2015-10-06 14:17:28

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

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

^ Perhaps we better wait until hhh has read this.
He has a post already with the procedure to follow. There would only be one line to change in his post.

While we are waiting on him, you could try it out. Perhaps you still have the stick. Jusr run the one command I mentioned and see if it boots.
Could be you are having other problem(s).

Good luck

Last edited by xaos52 (2015-10-06 14:21:35)

Offline

#16 2015-11-07 04:32:33

hhh
That's it!
Registered: 2015-09-17
Posts: 7,465
Website

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

Sorry, I somehow managed to miss these follow-up posts.

xaos52 wrote:
syslinux -i /dev/sdX3 -d /syslinux

So, which command exactly does this replace, the one that renames isolinux.bin to syslinux.bin? I'm guessing it would be sdX2 if following my #! instructions, since I didn't set up 3 partitions.

Curious that the tutorial on #! worked for me and @johnraff, but no matter. I my case, maybe because I was running this from a netinstall version of jessie and not a (live-build built) Bunsen version, but I'm just guessing.

It's late here, but hopefully tomorrow I'll remember to test this from a BL system. I'll also test from my jessie system and if it works on both I can write up the tutorial for these forums.

Thanks for looking into this, good Doctor!

Offline

#17 2015-11-07 04:52:24

hhh
That's it!
Registered: 2015-09-17
Posts: 7,465
Website

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

OK, I think I see. The new command replaces the one early in my tutorial, "Setup the MBR", and in my instructions that was /dev/sdx1.

-edit- that's not right. @xaos, if you see this, please clarify. Calling it a night here.

Offline

#18 2015-11-07 08:51:42

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

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

As a matter of fact, I was following the link you were referring to, using 3 partitions.

Replace the syslinux command early in the blog post,

Make the USB key bootable

Use install-mbr to install an MBR on the key and syslinux to install the bootloader to boot into your live image partition.

$ /sbin/install-mbr /dev/sdX
$ syslinux -i /dev/sdX3

Replace the syslinux command with the one I posted.

Following your tutorial, that would indeed be /dev/sdX2.

I am sure I had to do this building in Debian sid. I don't remember if I tried it from within bunsenlabs.

Edit:
Or, you can follow the complete tutorial as is, and if the stick does not boot, just run the one syslinux command I posted and it should then boot OK.

Last edited by xaos52 (2015-11-07 08:59:35)

Offline

#19 2015-11-07 14:20:14

hhh
That's it!
Registered: 2015-09-17
Posts: 7,465
Website

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

OK, I've had some sleep, drank some coffee and messed with this some more.

Thanks for posting back, xaos!

So we don't have to keep scrolling up, here are the links to my tutorial and the Armstrong tutorial...
http://crunchbang.org/forums/viewtopic. … 11#p438311
http://syn.theti.ca/2013/06/22/tutorial … ce-on-usb/

First, a note here about my using sudo, IIRC the Armstrong instructions started failing for me early, maybe even during partitioning. At the time I had no idea why, now I'm thinking that it was because gparted runs as root and so permissions on the USB weren't set to run these commands as user, but I haven't looked into this.

The Armstrong instructions use 3 partitions, partition 3 is the one he puts the ISO onto. That would correspond to /dev/sdx1 in my instructions. I used only 2 partitions because I thought having 3 unnecessarily confused things (and it has smile ). Indeed, when I tried using sdx2, I got this...

syslinux: invalid media signature (not an FAT/NTFS volume?)

When I ran 'syslinux -i /dev/sdX1 -d /syslinux' I got a segfault and invalid directory messages.

At this point I just ran my instructions as-is from within a week-old RC1 32 bit partition, and except for my umount command and Thunar preferences instructions (added later at the suggestion of johnraff and now fixed), it went without a hitch. I get errors at boot about 'live-persistence failed, resources is busy' and one at shutdown that 'systemd-shutdown failed to finalize system, ignoring', but these seem benign as everything works.

I'm assuming that re-running the syslinux command with the appended '-d /syslinux' is necessary in stretch and sid because of changes to isolinux, so I added an "if/then" line at the end of my instructions and a link to this thread.

That's all the testing I want to do on this for now, my poor USB has been overwritten enough. tongue

Offline

#20 2015-11-07 16:20:40

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

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

Ben uses 'parted' for partitioning - the command line tool - not gparted.

Ben wrote:

Now make changes to the partition table. Use parted because it may be run as an ordinary user and has some advanced capabilities beyond more basic tools like fdisk.

This did not work for me. parted had to be run as root.

Ben creates 3 partitions:
part1(sdX1): EXTRA - fat32 - reserve space on the stick. Nothing to do with Debian live or persistence
part2(sdX2): persistence - ext4
part3(sdx3): boot partition - fat32 - to hold the unpacked live system.

You use two partitions:
part1(sdX1) - boot - fat32 - to hold the unpacked live system.
part2 (sdX2)- persistence - ext4

When following your partitioning schema, syslinux should be run as

sudo syslinux -i /dev/sdX1

So syslinux should be run on the fat32 boot partition, not the persistence partition.
syslinux can only install to a fat32 partition. That is what the error message tried to explain to you. You ran it on the ext4 persistence partition.

This did not work for me. As I was following Ben's instructions, with the boot partition on /dev/sdX3, I had to run

sudo syslinux -i /dev/sdX3 -d /syslinux.

Sorry for introducing the confusion by referring to Ben's partitioning scheme.

If you - kind reader - are following hhh's instructions and you can not boot from the stick, try

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

@hhh: did you use an 8GB stick to test? Could be the syslinux modification was intended for the larger stick sizes?

Hope this has not added more entropy to the already present chaos. smile

Last edited by xaos52 (2015-11-07 16:40:29)

Offline

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

hhh
That's it!
Registered: 2015-09-17
Posts: 7,465
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

Offline

#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
That's it!
Registered: 2015-09-17
Posts: 7,465
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. monkey

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

Offline

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

Naik
Member
From: Lipsia
Registered: 2015-10-03
Posts: 147

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 on GitHub

Offline

Board footer

Powered by FluxBB