You are not logged in.
WARNING! Could be some typos... 
Edit - Sure 'nuf! fixed some typos already. It's easier to create live-rw after booting.
1) Create at least one partition on your USB drive with your favorite partition editor (fdisk, cfdisk gparted...)
2) Format the partition
3) Copy files onto the drive.
4) Install GRUB
My USB drive is /dev/sdc.
I used fdisk
I put an ext3 filesystem on /dev/sdc1
$ sudo su
# fdisk /dev/sdc
<Create at least one partition>
# mkfs.ext3 /dev/sdc1
# mkdir sdc1
# mount /dev/sdc1 sdc1/
# mkdir loopmount sdc1/usbcrunch
# mount -o loop crunchbang-10-20110105-openbox-amd64.iso loopmount
# cp -a loopmount/live/* sdc1/usbcrunch/Install GRUB
# grub-install --force --no-floppy --root-directory=sdc1/ /dev/sdcFind your USB drive UUID
ls -al /dev/disk/by-uuidOR
blkidMy blkid
# blkid
/dev/sdc1: UUID="ecd3f766-bdaf-440e-ae98-8b2221924e04" SEC_TYPE="ext2" TYPE="ext3"Copy the UUID (not the quotes) for your USB drive. My UUID is ecd3f766-bdaf-440e-ae98-8b2221924e04
Create a grub.cfg using YOUR UUID for these 2 variables:
set uuid_grub_boot=
set uuid_os_root=
# nano sdc1/boot/grub/grub.cfgmenuentry "CrunchBang Statler USB" {
set uuid_grub_boot=ecd3f766-bdaf-440e-ae98-8b2221924e04 #Enter the UUID of your boot partition (this is where grub and your kernel reside)
set uuid_os_root=ecd3f766-bdaf-440e-ae98-8b2221924e04 #Enter the UUID of the partition containing the root partition of your Arch Linux installation.
#(Note: this may be the same as your boot partition)
search --no-floppy --fs-uuid $uuid_os_root --set=root #Here we set the grub "root" variable by locating the uuid of the root partition identified above
search --no-floppy --fs-uuid $uuid_grub_boot --set=grub_boot #Here we set a custom variable grub_boot by locating the uuid of the boot partition identified above
#Here's the magic. We test to see if the boot and root partitions have the same UUID. If they do we append /boot to the $grub_boot variable. For ex. (hd0,1) becomes (hd0,1)/boot.
if [ $uuid_grub_boot == $uuid_os_root ] ; then
set grub_boot=$grub_boot/boot
fi
# $grub_boot now points to the correct location, so the following will properly find the kernel and initrd
linux ($grub_boot)/usbcrunch/vmlinuz1 boot=live live-media-path=/usbcrunch splash gfxpayload=1024x768x32 config quiet ip=frommedia persistent noprompt keyboard-layouts=en
initrd ($grub_boot)/usbcrunch/initrd1.img
}That should do it.
umount sdc1
rebootOnce you're booted you'll need to create the live-rw file as user crunchbang but only the first time.
$ dd if=/dev/null of=live-rw bs=512M seek=1
$ /sbin/mkfs.ext2 -F live-rw
$ sudo su
# mount -o remount,rw /live/image
# mv /home/crunchbang/live-rw /live/image
# rebootAfter the reboot your changes will be saved between boots.
Notes:
If you're booted to #! live when you make your USB persistent drive you can perform the /sbin/mkfs.ext2 -F live-rw portion from the live disc.
Credits:
grub.cfg blatantly stolen from Arch wiki.
Last edited by ugh (2011-01-15 13:05:41)
Toshiba laptop - 1.86GHz x 2
3 G RAM
Crunchbang Statler upgraded to Sid
2.6.XX-X.dmz.X-liquorix-amd64
Offline
I have not gone through this step by step, but it looks all good. Thanks for putting it together! 
Offline
No problem.
It should be possible to boot the .iso image itself directly using grub2 as well. Then you wouldn't even need to extract the .iso contents. Haven't had a chance to play with that just yet.....
Toshiba laptop - 1.86GHz x 2
3 G RAM
Crunchbang Statler upgraded to Sid
2.6.XX-X.dmz.X-liquorix-amd64
Offline
Genius! It works perfectly. Thank you so much!
Offline
Nice how to! But isn't this overkill?
A persistent USB Statler install is possible with the normal debian installer. At least with the text installer (gui installer doesn't seem to detect usb drives). That's how I made mine. No hassle with partitioning and casper-rw.
Offline
very cool, indeed. thanks for posting this.
is it possible to install the changed peristent system to any computer with all changes?
eee701 user & other lap/desktops
Offline
http://crunchbanglinux.org/forums/topic … rsistence/
Nice how to! But isn't this overkill?
Thanks. Overkill? :shrug: I didn't think so - it took < 5 minutes to set the USB drive up this way.
A persistent USB Statler install is possible with the normal debian installer. At least with the text installer (gui installer doesn't seem to detect usb drives). That's how I made mine. No hassle with partitioning and casper-rw.
Never tried it before. Does the text installer install GRUB and extract the .iso contents in the same way?
Toshiba laptop - 1.86GHz x 2
3 G RAM
Crunchbang Statler upgraded to Sid
2.6.XX-X.dmz.X-liquorix-amd64
Offline
http://crunchbanglinux.org/forums/topic … rsistence/
GuruX wrote:Nice how to! But isn't this overkill?
Thanks. Overkill? :shrug: I didn't think so - it took < 5 minutes to set the USB drive up this way.
A persistent USB Statler install is possible with the normal debian installer. At least with the text installer (gui installer doesn't seem to detect usb drives). That's how I made mine. No hassle with partitioning and casper-rw.
Never tried it before. Does the text installer install GRUB and extract the .iso contents in the same way?
Ok, 5 minutes isn't a lot to jabber about.
Yeah, the text installer should do all that, it's just like a normal install, except to USB instead of hdd/ssd.
Offline
I was not able to locate the text mode installer and now I understand why.
I thought I was overlooking it the whole time but crunchbang-10-20110105-openbox-amd64.iso was the first #! image I had ever booted. 
On that note, the text mode installer may set this up this style of live installation perfectly - (I have not tried it) but at least part of the reason for this method is also to avoid having to boot the live operating system from anything other than the intended USB drive. Many systems simply don't have CD drives and unless you have more than one USB drive how else would you boot in a simple fashion?
As for booting Statler.iso directly via GRUB2 - that I could not get working. The kernel boots but the live filesystem is never found (a known issue w/ Debian live discs). A nice blogpost from Michael Prokop explains it (and the solution) well enough. Also on the bright side, patches were already commited to debian-live so #! built w/ live-boot >=2.0.14-1 (in sid right now) would presumably support memdisc ISO emulation.
Last edited by ugh (2011-01-23 17:49:25)
Toshiba laptop - 1.86GHz x 2
3 G RAM
Crunchbang Statler upgraded to Sid
2.6.XX-X.dmz.X-liquorix-amd64
Offline
Are there any work arounds for the newer version of grub which doesnt use grub.cfg?
Well actually GRUB2 uses grub.cfg. GRUB Legacy uses menu.lst. From the GNU GRUB manual
GRUB 2 is a rewrite of GRUB (see History), although it shares many characteristics with the previous version, now known as GRUB Legacy. Users of GRUB Legacy may need some guidance to find their way around this new version.
The configuration file has a new name (grub.cfg rather than menu.lst or grub.conf),
This method works with either version of GRUB - you just need a proper grub.cfg OR menu.lst
Toshiba laptop - 1.86GHz x 2
3 G RAM
Crunchbang Statler upgraded to Sid
2.6.XX-X.dmz.X-liquorix-amd64
Offline
Nice how to! But isn't this overkill?
A persistent USB Statler install is possible with the normal debian installer. At least with the text installer (gui installer doesn't seem to detect usb drives). That's how I made mine. No hassle with partitioning and casper-rw.
Agreed, a newcomer to #! or linux in general may be reluctant to enter commands they don't understand. A persistent live system can also be created simply with GParted and Unetbootin. It might attract a few extra users.
Offline
Yes you could run those "make a USB stick" programs, or just run through the regular crunchbang install, selecting an external partition as the install location.
And end up trashing your existing installation, because these programs jerk around with MBRs and so on.
Also, for anything more complex, like installing on GPT partitions, and especially getting anything to play with macbooks, EFI, and so on, you need to do it by hand.
The documentation for all this stuff is either non-existent, or encyclopedic (who has time to read the grub manuals, let alone try and make sense of them), and the internet is worthless - full of forum posts that are almost your config, but never quite, and when there is a match the posts conclude with something incredibly frustrating like "got it working now, thanks for all the fish". Or worse, a howto is actually wrong - For example, I've just spend a couple of hours getting persistence to work, I based my setup on an article at "pendrivelinux" that said the persitent fs should be in "casper-rw". And that's just the latest little wrangle.
Anyway, useful info in this post (actually I arrived at live-rw by looking at the scripts/live in initrd), I'll add my own stuff when I've got it working.
Specifically I avoid grub like the plague, and have built a USB drive using only GPT partitions, using the syslinux gpt MBR and setting a legacy BIOS bootable flag on the linux live partition which is then running syslinux of course.
On the same drive I have a Mac OS Lion install/maintenance partition, and another EFI partition that I hope to be able to use to boot crunchbang live on a macbook, without using BIOS compatibility mode (which doesn't support USB) - though that's looking like a stretch at the moment.
Last edited by jackbang (2011-09-05 06:11:40)
Offline
Thanks Ugh!
I've used pendrivelinux in the past, and I love learning from posts like this!
Statler-Openbox on an Acer Extensa 4420. Its good to be back.
Offline
Glad a few individuals have found this useful anyway. Perhaps I should have mentioned a few more advantages of setting your USB drive up in this fashion.
1) You can add as many different OS's as you want, just create a new GRUB menu entry for each.
2) No need to waste an entire drive for a single image by using dd to write the file to drive.
3) You can upgrade the version of #! simply by copying over the new filesystem, initrd and kernel.
4) No need to burn a CD or DVD just to boot the .iso image and create a bootable USB key.
5) You could use the same method to boot the image from a hard drive.
As for unetbootin - it's great when it works but I've had mixed luck with that tool - too often it simply fails completely OR it claims to have been successful but the drive doesn't boot.
Toshiba laptop - 1.86GHz x 2
3 G RAM
Crunchbang Statler upgraded to Sid
2.6.XX-X.dmz.X-liquorix-amd64
Offline
Glad a few individuals have found this useful anyway.
Hey ugh,
i have used your method explained in ot and i got some errors setting up grub (like everyone has
)
i executed your code-sniped to install grub, but badly, it hungs up, no output is given and the terminal has a running thread, there is no significant I/O from/to the USB-Stick and a grub-folder with 204 files was created.
i killed the process (after running for half an hour...) and created the config like you described.
restart and bam, grub command-line... i dont know anything about grub and how to set it up, so please help me there.
Thanks in advance
Kostronor
Offline
LiLi usb creator http://www.linuxliveusb.com/ can also make a live crunchbang persistence usb...
very cool to use it via usb... 
Last edited by pbfu (2012-03-09 21:48:30)
Offline
LiLi usb creator http://www.linuxliveusb.com/ can also make a live crunchbang persistence usb...
very cool to use it via usb...
Thanks for the hint, i am testing it at the moment and it seems to work!
Offline
^ LiLi's persistence mode is indeed works well, though I'd like to recommend not to do dist-upgrades (for example after switching from stable to testing or unstable) or kernel-updates on the USB stick - that being said, it might go well sometimes 
Offline
Hey ugh,
i have used your method explained in ot and i got some errors setting up grub (like everyone has)
I didn't notice that anyone else had troubles with GRUB. 
Not sure what to tell you, the command works as expected here on Debian.
Glad you found an alternative solution in LinuxLive USB Creator but.....it's a Windows only tool. 
Toshiba laptop - 1.86GHz x 2
3 G RAM
Crunchbang Statler upgraded to Sid
2.6.XX-X.dmz.X-liquorix-amd64
Offline
A few questions:
- Can I use it as regular USB? After these steps I insert it into running Windows machine and it always wants to format it and refuses to work otherwise. Pendrive usb creator (windows-only tool) does that, I wonder if it's possible to do from Linux.
- Is there any difference from regular live-cd/usb for installation process (from usb to hard drive)?
Offline
Writes to the USB will be m-u-c-h s-l-o-w-e-r, but you were probably already aware of this. Regardless of how much/little memory your PC has, don't put a swap partition on the Live USB unless you want to feel like you're on Vista.
while ( ! ( succeed = try() ) );
We've earned a reputation as a nice, friendly community; please help us keep it that way.
Offline
A few questions:
- Can I use it as regular USB? After these steps I insert it into running Windows machine and it always wants to format it and refuses to work otherwise. Pendrive usb creator (windows-only tool) does that, I wonder if it's possible to do from Linux.
- Is there any difference from regular live-cd/usb for installation process (from usb to hard drive)?
Windows cannot natively read ext3/ext4 filesystems so it will suggest a format every time. There have been some implementations of ext3/4 drivers for the Windows platform but I'm not familiar with them.
When inserted into a Linux OS it will of course be possible to mount and write to the USB drive.
Alternative: Create at least 2 partitions on the USB drive. Format the second partition as FAT32 or NTFS which can be read by Windows and Linux alike.
-------
The installation should be the same as when ran from a CD since you are booting the same image, just from a different medium.
Toshiba laptop - 1.86GHz x 2
3 G RAM
Crunchbang Statler upgraded to Sid
2.6.XX-X.dmz.X-liquorix-amd64
Offline
Alternative: Create at least 2 partitions on the USB drive. Format the second partition as FAT32 or NTFS which can be read by Windows and Linux alike.
I did try do so, but Windows still wanted to format whatever partition he found(not sure which one he discovered, but showed only 1).
And yeah.. With Linux OS it's always simple 
Too bad I'm bound to having windows installation, cuz of my country's sh*tty educational system ;(
Anyways, I'll stick to YUMI for now. Thanks for help 
Offline
Alternative: Create at least 2 partitions on the USB drive. Format the second partition as FAT32 or NTFS which can be read by Windows and Linux alike.
I did try do so, but Windows still wanted to format whatever partition he found(not sure which one he discovered, but showed only 1).
And yeah.. With Linux OS it's always simple
Too bad I'm bound to having windows installation, cuz of my country's sh*tty educational system ;(Anyways, I'll stick to YUMI for now. Thanks for help
Delete the whole usb key with GParted *Remember to backup your files* - then with GParted create the drive you want windows to see as NTFS first!!!
Then create the drive ext3/ext4 you want to use as Linux persistence.
This should work - I have tested on XP and Windows 7 and they only see one drive from USB keys - and apparently it's the first drive that you have made on the usb key it will see.
If windows want to format the drive if you have tried to use Fat32 insted of NTFS - remember to format with NTFS, as exfat can't be read in linux out of the box. *Of what I have experience*
Bottom line - just use NTFS from the start in GParted.
I wanted myself to have 2 drives - and the one drive I wanted to be used on both Linux and Windows, so NTFS was the thing that made it work.
If done correctly Windows will only see and have access to one drive that is storage *NTFS* and won't ask to format - And Linux will see and have access to both the drives 
Last edited by No-Thing (2013-05-11 22:20:46)
With love and gratitude - No-Thing But Divine
I am an orphan, alone; nevertheless I am found everywhere. I am one, but opposed to myself. I am youth and an old man at one and the same time. In woods and mountains I roam, but I am hidden in the innermost soul of man. I am mortal for everyone, yet I am not touched by the cycle of the aeons.
Offline
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.