SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2014-06-16 10:53:05

as_te_ri_x
Member
From: Portugal
Registered: 2014-06-04
Posts: 11

#! CrunchBang waldorf liveUSB with persistence

After several attempts to create a waldorf liveUSB with persistence I finally bumped into this post "The Correct Way for Persistence on a LiveUSB for WALDORF" by kyeshi98 [1], who I would like to thanks again for the great tips.

I guess Kye's guide should work fine, but I don't use unetbootin-like programs, as I like to use fdisk and dd to deal with the partitions and copying the ISO. There's a portuguese version [2] if you prefer. So in this guide I'll explain how:

  1. Setup the USB drive with fdisk

  2. "Burn" the ISO to a partition with dd

  3. Setup and configure the persistence

  4. Install GRUB2 to the USB drive

  5. Troubleshoot the persistence #! environment

ADVISE

Be advised that ALL DATA on your USB drive will be erased! And be extremely careful providing the correct path for the USB drive as you might erase ALL your HARD DRIVE DATA! You've been advise, check twice and only run the commands when you understand what they are doing!


Setup the USB drive

Setup the partitions with fdisk
I assume there is no partition on the USB drive and in this case will be a 4GB device.

fdisk will create two ext2 primary partitions: one labeled persistence, with the boot flag on, and the size of the USB drive minus the size of the ISO (as I roundup the ISO to 1GB), in this case 3GB; the other with the remaining 1GB and no other special care.

$ sudo fdisk /dev/sdX

n - create the first partition
p - indicate it will be a primary partition
[enter] - accept the start of the first partition (zero)
+3GB - size of the partition
a - activate the boot flag so it can be booted from

n - create the second partition
p - indicate it will be a primary partition
[enter] - accept the start of the second partition (usually safe)
[enter] - accept the ending of the second partition (usually the last one of the drive)
w - write all changes
q - exit


"Burn" the ISO to a partition

After the partition setup you should guarantee that the second partition is unmounted before "burning" the ISO.

$ dd if=crunchbang-11-20130506-amd64.iso of=/dev/sdX2; sync

The sync will guarantee that it finishes only after all data is written on the drive


Setup and configure the persistence

Create the filesystem for persistence

$ mkfs.ext2 -L persistence /dev/sdX1

This will format the first partition of the drive with an ext2 filesystem and label it persistence

Configure the persistence
Unfortunately CrunchBang is built up a very old debian live system so the official debian live documentation can't be fully used to configure the persistence. As explained to me there was a very short period of time long ago that the debian live project used the filename "live-persistence.conf", but that was discontinued and almost all versions use the filename "persistence.conf".

So to run #! CrunchBang waldorf with persistence the live-persistence.conf file must exist on the persistence partition. So make sure the persistence partition is mounted, usually in /media/persistence.

$ nano /media/persistence/live-persistence.conf

In it you should define what folders should be persistence and in what manners. You should read the debian live documentation [3] to get a better idea. Don't forget that it still states the persistence configuration file as being persistence.conf!

For quick and simple persistence you should add

/ union

It's a [slash] [space] union stating the root filesystem / will be a union of the files on the liveUSB with the files persistent on the USB drive, so each time it boots it will merge together these files.

My live-persistence.conf is little bit different

/home
/opt
/boot/grub
/etc union
/usr union
/var union
/bin union
/sbin union

I changed it a little bit, mainly for saving some space on the drive, being able to edit the GRUB from inside the liveUSB and to get all /home files and /opt programs on the USB drive directly.
The other folders are still in test but handled well updates, upgrades and program installations using apt-get.
If you need more folders (/root or /srv) just add them with the union option.

If you know more about this please contribute in the comments!

Install GRUB2

You can play a lot with grub and if you need you can check out the CrunchBang ISO configuration boot files like /isolinux/live.cfg.
Also there's a great deal of documentation to the GRUB2, please check the ubuntu community [4] and the dedoimedo documentation [5].

Make sure the persistence partition is mounted, usually in /media/persistence.
To install GRUB2, version 1.99 you should:

$ grub-install --force --no-floppy --root-directory=/media/persistence /dev/sdX

Next setup the menu entries with:

$ nano /media/persistence/boot/grub/grub.cfg

In this case I want two menu entries: one for the persistence environment; and another just to start the live environment as a regular #! CrunchBang liveUSB.

set timeout=5
set default=0

menuentry "#! 11 - waldorf 64bits - Persistence" {
  linux (hd0,2)/live/vmlinuz boot=live config persistence
  initrd (hd0,2)/live/initrd.img
}

menuentry "#! 11 - waldorf 64bits - Live" {
  linux (hd0,2)/live/vmlinuz boot=live config            
  initrd (hd0,2)/live/initrd.img
}

This will boot the first menu entry if no key is pressed within 5 seconds.
Also the first entry launches the kernel and initrd from the second partition (hd0,2) and adds the boot flag persistence to the kernel.
The second entry is used to launch the live environment as a regular waldorf liveUSB.

EDIT
This entry boots #! into install mode.

menuentry "#! 11 - waldorf 64bits - Install" {
  linux (hd0,2)/install/gtk/vmlinuz video=vesa:ywrap,mtrr vga=788 file=/cdrom/install/crunchbang.cfg
  initrd (hd0,2)/install/gtk/initrd.gz
}
Troubleshoot the persistence environment

Users
Add your user and remove the crunchbang user, by the way the crunchbang user has password live.

$ sudo adduser user
$ sudo adduser user sudo
$ sudo su
$ passwd

Logout and login with your user to test if it worked.
Next, change the login options in the System > User Login Settings to comply with your setup.

Test your persistence
Now if you want you might reboot just to check everything works fine!
If so just update, upgrade and install all you need!

Update and upgrade

$ sudo apt-get update
$ sudo apt-get upgrade

UPDATE:
I think it's not possibly to delete crunchbang user as all tty terminals (accessed with CTRL+ALT+F1...F4) are always with crunchbang already logged in...

Please comment!
If you have any issues, i'll try to help you out.


References

[1] - http://crunchbang.org/forums/viewtopic.php?id=25489
[2] - http://librehacks.blogspot.pt/2014/06/c … veusb.html
[3] - http://live.debian.net/manual/current/h … n.html#549
[4] - https://help.ubuntu.com/community/Grub2
[5] - http://www.dedoimedo.com/computers/grub-2.html

Last edited by as_te_ri_x (2014-09-14 18:13:18)

Offline

Be excellent to each other!

#2 2014-06-16 11:39:24

Head_on_a_Stick
CatMod
From: A world of pure imagination
Registered: 2014-01-21
Posts: 4,797

Re: #! CrunchBang waldorf liveUSB with persistence

Fantastic guide as_te_ri_x, thank you smile
Is there any advantage to using live persistence over just installing #! onto the memory stick?
I'm pretty lazy, so I always use the latter method tongue

Offline

#3 2014-06-16 12:30:51

as_te_ri_x
Member
From: Portugal
Registered: 2014-06-04
Posts: 11

Re: #! CrunchBang waldorf liveUSB with persistence

Hello Head_on_a_Stick, actually I never installed #! to a pen, but with Linux Mint the startup of programs was way to slow from the USB install rather than the live environment (LibreOffice took ages). So when I try out liveUSB Mint with persistence I found out that it was running fast as the regular liveUSB.

From these experiences I thought that liveUSB loads all from/to RAM (which nowadays is fair enough with 4GB RAM) on the other hand if running from a USB install I guess the startup (loading still from USB) actually writes changes back to USB and this slows it down.

Do you see any difference of performance between launching Iceweasel from #! liveUSB versus #! USB install?
I found it to be the same on the #! liveUSB and #! liveUSB with persistence.

As currently I don't have any other USB I can't benchmark, but if someone can, it would be great to know.

Thanks!

Offline

#4 2014-06-16 12:43:13

Head_on_a_Stick
CatMod
From: A world of pure imagination
Registered: 2014-01-21
Posts: 4,797

Re: #! CrunchBang waldorf liveUSB with persistence

Thanks for the info, I had never really considered that: I bought a Sandisk Extreme USB stick which is nearly as fast as my SSD (via usb3.0) --- I probably should have just used a cheap USB stick & persistence hmm
The only disadvantage I can see is the increased bootup time...

Offline

#5 2014-06-16 22:08:34

as_te_ri_x
Member
From: Portugal
Registered: 2014-06-04
Posts: 11

Re: #! CrunchBang waldorf liveUSB with persistence

If you have USB3 support you shouldn't have a problem, it should be faster than some of the IDE disks I see in use at work...
Blame my 6+year old USB2 drive for this!    smile

Last edited by as_te_ri_x (2014-06-16 22:08:53)

Offline

#6 2014-07-21 21:32:00

talltallb
New Member
Registered: 2014-07-21
Posts: 5

Re: #! CrunchBang waldorf liveUSB with persistence

Hi there as_te_ri_x,
I made a live usb without persistence suing unetbootin, but now I think that I should probably be using this way, as people seem to think that unetbootin is a nasty hack (see here)

as_te_ri_x wrote:

In this case I want two menu entries: one for the persistence environment; and another just to start the live environment as a regular #! CrunchBang liveUSB.

I'm slightly confused as to what you're trying to do here, why do you need grub? With UNetBootin it seems that you can just create the partition and everything will be happy.

Also, what size should the persistence partition be (using 32gb usb) ? Is it or the other partition more important?
Which will be keeping all my files etc on?

(Pretty much complete newbie, any help appreciated)

Thank you!

Offline

#7 2014-07-21 22:10:38

as_te_ri_x
Member
From: Portugal
Registered: 2014-06-04
Posts: 11

Re: #! CrunchBang waldorf liveUSB with persistence

Hello talltallb,

From my usage unetbootin rarely works... Maybe it's me (or my bad karma wink).

GRUB - it's needed so you can boot a device, I don't think you can boot the USB drive with the dd of the #! ISO...
You can also use another boot manager to show you the boot options.
But GRUB2 has a feature I like: ISO booting. And I'm currently working on having #! booting the way I described before and have a couple of ISO (like Linux Mint and GRML) on the persistence partition and boot them from GRUB2 without a stress. When I have more info I'll post a howto.

SIZE - The persistence partition can be anything you like, but from my point of view 32GB-1GB = 31GB, if you plan to have another partition to boot like #! you should decrease this value. Currently I'm using a 16GB with a 12GB persistence partition (1GB for #! and three more to boot another OS the way I described).

PARTITIONS - This schema uses just two partitions: persistence (all the spare size) and CrunchBang (bigger than the ISO). All files changed during persistence execution will be saved in the persistence partition. So when the system boots up it JOINS all the files from the live ISO and the persistence partition (my configuration specifies a few directories, but you can have just the /   union in the live-persistence.conf and be fine as you've got plenty of space). So all changed/new files are saved in the persistence partition.

Hope this helps.

Any question shoot! (or shout) wink

Offline

#8 2014-07-22 05:56:50

talltallb
New Member
Registered: 2014-07-21
Posts: 5

Re: #! CrunchBang waldorf liveUSB with persistence

Amazing, thanks very much. Fantastic solution!

Offline

#9 2014-08-11 07:16:23

gevera
Member
Registered: 2014-08-10
Posts: 16

Re: #! CrunchBang waldorf liveUSB with persistence

Could we have instead of one partition with x64 iso have an extra one with lets say i686 iso. Add that to the grub config and have an option two choose from two different architectures at boot?

Offline

#10 2014-08-14 15:31:07

as_te_ri_x
Member
From: Portugal
Registered: 2014-06-04
Posts: 11

Re: #! CrunchBang waldorf liveUSB with persistence

Hello!

Right now I don't have the time to inspect that question but I strongly believe that it's possibly to have both 32bits and 64bits ISO on a USB drive and choose which you want to run in grub.

When I get a chance I'll try this, and update the main article.
But the hints go with:
1. add another partition /dev/sdb3
2. dd id=crunchbangi686.iso of=/dev/sdb3
3. add a grub2 entry like this:
menuentry "#! 11 - waldorf 32bits - Live" {
  linux (hd0,3)/live/vmlinuz boot=live config
  initrd (hd0,3)/live/initrd.img
}

If you can, also give it a try! I think it won't get any messier than this. wink

Just pay attention to the persistence, as it might get corrupted with different files used by both architectures, but if you only use persistence in your /home, you'll be safe.

Good luck.

Last edited by as_te_ri_x (2014-08-14 15:35:16)

Offline

#11 2014-08-16 00:23:51

gevera
Member
Registered: 2014-08-10
Posts: 16

Re: #! CrunchBang waldorf liveUSB with persistence

Well, I've tried to do the trick with an extra partition using the new ISO's from elementary OS Freya beta.  I was in a hurry so i might have done a mistake, but anyways it didn't work. When loading the GRUB, the kernel image is missing. I will try one more time, and try to be more attentive.

Offline

#12 2014-11-22 16:21:10

pranav
New Member
Registered: 2014-11-22
Posts: 2

Re: #! CrunchBang waldorf liveUSB with persistence

SIr
when i select live menuentry everything works just fine but in persistence ,a black screen appears with a cross cursor and nothing else. when I go to tty1 (CTRL + ALT + F1) the command prompt is

root@kali

I have currently kali linux installed on HDD.
I think grub is loading os from my HDD [but how is it possible ?]
grub.cfg contents :

menuentry "#! 11 - waldorf 64bits - Persistence" {
	  linux (hd0,1)/live/vmlinuz boot=live config persistence
		    initrd (hd0,1)/live/initrd.img
}

What should I do ?
Thank you

Last edited by pranav (2014-11-22 16:23:04)

Offline

#13 2014-11-22 22:49:36

as_te_ri_x
Member
From: Portugal
Registered: 2014-06-04
Posts: 11

Re: #! CrunchBang waldorf liveUSB with persistence

pranav wrote:

SIr
when i select live menuentry everything works just fine but in persistence ,a black screen appears with a cross cursor and nothing else. when I go to tty1 (CTRL + ALT + F1) the command prompt is

root@kali

I have currently kali linux installed on HDD.
I think grub is loading os from my HDD [but how is it possible ?]
grub.cfg contents :

menuentry "#! 11 - waldorf 64bits - Persistence" {
	  linux (hd0,1)/live/vmlinuz boot=live config persistence
		    initrd (hd0,1)/live/initrd.img
}

What should I do ?
Thank you

Hello!

Actually I don't see how you get that tty... It looks like it's booting kali from HDD, right?

The only thing I can think of (but I found this very diffcult to happen) is some of your HDD partition is labeled persistence and you have a live-persisntece.conf in it...

By the way, you said live was working OK. Is the kernel and initrd booting from (hd0,1)?

Offline

#14 2014-11-25 08:31:51

winosdonotmarch
New Member
Registered: 2013-06-22
Posts: 6

Re: #! CrunchBang waldorf liveUSB with persistence

when i came across this post i thought i would see a light at the end of a tunnel ...

I am trying to get Waldorf replacing my Statler distro on my HP Elitebook 8440.
I have had several different attempts to get Waldorf installed onto my machine to no avail.

Unfortunately this approach explained in detail here does also not work for me. Whenever the usb stick is plugged in and i reboot my machine it hangs. I don't even get to the GRUB menu.
I don't really know what to do any more ...
Any help would be really appreciated ....
Thanks.

Offline

#15 2014-11-25 08:39:26

damo
#! gimpbanger
From: N51.5 W002.8 (mostly)
Registered: 2011-11-24
Posts: 5,434

Re: #! CrunchBang waldorf liveUSB with persistence

winosdonotmarch wrote:

...
I am trying to get Waldorf replacing my Statler distro on my HP Elitebook 8440.
I have had several different attempts to get Waldorf installed onto my machine to no avail.
...

So are you trying to install Waldorf, or are you trying to create a usb with persistence?

(If you are having problems trying to install, then it would be best to post in Help & Support, with some more details of your setup and exactly what you have done or tried so far)


BunsenLabs Group on deviantArt
damo's gallery on deviantArt
Openbox themes
Forum Moderator smile

Offline

#16 2014-11-25 08:58:48

winosdonotmarch
New Member
Registered: 2013-06-22
Posts: 6

Re: #! CrunchBang waldorf liveUSB with persistence

hmmh ...

I have followed exactly the instructions layed out here. As there are 3 menu entries ( persistence, Live, and Install) i think i could install Waldorf as well. Correct me if i am wrong.
What puzzles me is that i don't get into the GRUB menu when booting.

Offline

#17 2014-11-25 18:20:09

damo
#! gimpbanger
From: N51.5 W002.8 (mostly)
Registered: 2011-11-24
Posts: 5,434

Re: #! CrunchBang waldorf liveUSB with persistence

winosdonotmarch wrote:

hmmh ...

I have followed exactly the instructions layed out here. As there are 3 menu entries ( persistence, Live, and Install) i think i could install Waldorf as well. Correct me if i am wrong.
What puzzles me is that i don't get into the GRUB menu when booting.

Have you tried just doing a regular install of Waldorf? It might be best to make sure that goes OK, because if that process is the problem then it is pointless trying to sort out a persistence option at this stage, IMO, because that just confuses things.

Last edited by damo (2014-11-25 18:21:57)


BunsenLabs Group on deviantArt
damo's gallery on deviantArt
Openbox themes
Forum Moderator smile

Offline

#18 2014-11-25 18:50:05

pranav
New Member
Registered: 2014-11-22
Posts: 2

Re: #! CrunchBang waldorf liveUSB with persistence

as_te_ri_x wrote:

Hello!

Actually I don't see how you get that tty... It looks like it's booting kali from HDD, right?

The only thing I can think of (but I found this very diffcult to happen) is some of your HDD partition is labeled persistence and you have a live-persisntece.conf in it...

By the way, you said live was working OK. Is the kernel and initrd booting from (hd0,1)?

Sorry for late reply ...
Yes,I burned the iso in first partition of my pendrive,so initrd is booting from there.
What exactly (hd0) mean , Is it my first hard disk or hard disk on which grub is installed?
I will try going through all the steps again...and try removing HDD too
And let you know if it works.
Thank you

Offline

#19 2014-11-25 23:02:06

as_te_ri_x
Member
From: Portugal
Registered: 2014-06-04
Posts: 11

Re: #! CrunchBang waldorf liveUSB with persistence

damo wrote:
winosdonotmarch wrote:

hmmh ...

I have followed exactly the instructions layed out here. As there are 3 menu entries ( persistence, Live, and Install) i think i could install Waldorf as well. Correct me if i am wrong.
What puzzles me is that i don't get into the GRUB menu when booting.

Have you tried just doing a regular install of Waldorf? It might be best to make sure that goes OK, because if that process is the problem then it is pointless trying to sort out a persistence option at this stage, IMO, because that just confuses things.

Hello!

I agree with damo, you should check if you can do a regular install on your system.
BTW you're sure your computer boots from USB, right?

Note 1: As a side note, I also have a USB thumbdrive I can't get GRUB onto... Don't know why, it won't install GRUB, thus it wont boot.

Note 2: A couple of days, my old PC booted from USB and installed correctly Linux Mint MATE 32 bits (with GRUB booting ISO on the thumbdrive) and after that the PC just refused to boot from USB again!! No matter what thumbdrive I boot with... Can't explain...

Offline

#20 2014-11-25 23:05:59

as_te_ri_x
Member
From: Portugal
Registered: 2014-06-04
Posts: 11

Re: #! CrunchBang waldorf liveUSB with persistence

pranav wrote:
as_te_ri_x wrote:

Hello!

Actually I don't see how you get that tty... It looks like it's booting kali from HDD, right?

The only thing I can think of (but I found this very diffcult to happen) is some of your HDD partition is labeled persistence and you have a live-persisntece.conf in it...

By the way, you said live was working OK. Is the kernel and initrd booting from (hd0,1)?

Sorry for late reply ...
Yes,I burned the iso in first partition of my pendrive,so initrd is booting from there.
What exactly (hd0) mean , Is it my first hard disk or hard disk on which grub is installed?
I will try going through all the steps again...and try removing HDD too
And let you know if it works.
Thank you

Hello pranav

From Arch wiki:
Device naming has changed between GRUB Legacy and GRUB. Partitions are numbered from 1 instead of 0 while drives are still numbered from 0, and prefixed with partition-table type. For example, /dev/sda1 would be referred to as
(hd0,msdos1) (for MBR) or
(hd0,gpt1) (for GPT).

So hd0 is the first harddrive, usually the one you are booting from.

Offline

#21 2015-08-22 07:40:51

leNoah
New Member
Registered: 2015-08-13
Posts: 5

Re: #! CrunchBang waldorf liveUSB with persistence

Hi, I recently asked how to set up a usb with persistence, and got referred to this post. However, during the first step, It asks me about start and end sectors which, as I'm fairly new to linux, I don't understand. You don't mention it as far as I can see and I can't find anything on Google.
What should I do?
Thanks


leNoah
          I am a Bu5H being of inteligens
          So inteligent I can't spell inteligent
proud to be mush_rooom

Offline

#22 2015-08-22 10:06:59

Head_on_a_Stick
CatMod
From: A world of pure imagination
Registered: 2014-01-21
Posts: 4,797

Re: #! CrunchBang waldorf liveUSB with persistence

leNoah wrote:

during the first step, It asks me about start and end sectors [...] You don't mention it as far as I can see and I can't find anything on Google.
What should I do?

OP wrote:

[enter] - accept the start of the first partition (zero)
+3GB - size of the partition
[...]
[enter] - accept the start of the second partition (usually safe)
[enter] - accept the ending of the second partition (usually the last one of the drive)

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat

Debian Logo