SEARCH

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

You are not logged in.

#1 2011-01-15 02:26:42

ugh
Member
Registered: 2011-01-10
Posts: 29

#! Statler from USB - with persistence

WARNING! Could be some typos...  roll

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/sdc

Find your USB drive UUID

ls -al /dev/disk/by-uuid

OR

blkid

My 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.cfg
menuentry "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
reboot

Once 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
# reboot

After 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

Help fund CrunchBang, donate to the project!

#2 2011-01-15 07:00:25

corenominal
WRONG
From: Lincoln, UK
Registered: 2008-11-20
Posts: 5,054
Website

Re: #! Statler from USB - with persistence

I have not gone through this step by step, but it looks all good. Thanks for putting it together! smile

Offline

#3 2011-01-15 15:52:32

ugh
Member
Registered: 2011-01-10
Posts: 29

Re: #! Statler from USB - with persistence

No problem. smile 

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

#4 2011-01-18 10:45:40

brunomalone
Member
Registered: 2009-10-20
Posts: 22

Re: #! Statler from USB - with persistence

Genius! It works perfectly. Thank you so much!

Offline

#5 2011-01-18 10:50:27

GuruX
#! Die Hard
Registered: 2009-01-18
Posts: 527

Re: #! Statler from USB - with persistence

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

#6 2011-01-18 12:26:16

saneks
#! Die Hard
Registered: 2009-10-01
Posts: 983

Re: #! Statler from USB - with persistence

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

#7 2011-01-18 13:33:56

ugh
Member
Registered: 2011-01-10
Posts: 29

Re: #! Statler from USB - with persistence

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?


Toshiba laptop - 1.86GHz x 2
3 G RAM
Crunchbang Statler upgraded to Sid
2.6.XX-X.dmz.X-liquorix-amd64

Offline

#8 2011-01-18 16:27:00

GuruX
#! Die Hard
Registered: 2009-01-18
Posts: 527

Re: #! Statler from USB - with persistence

ugh wrote:

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

#9 2011-01-23 17:47:57

ugh
Member
Registered: 2011-01-10
Posts: 29

Re: #! Statler from USB - with persistence

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.  smile

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

#10 2011-03-09 19:04:38

madmaze
New Member
Registered: 2010-12-17
Posts: 6
Website

Re: #! Statler from USB - with persistence

Are there any work arounds for the newer version of grub which doesnt use grub.cfg?

Offline

#11 2011-03-09 21:12:14

ugh
Member
Registered: 2011-01-10
Posts: 29

Re: #! Statler from USB - with persistence

madmaze wrote:

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

#12 2011-03-10 13:51:47

Falk
Member
Registered: 2011-02-05
Posts: 26

Re: #! Statler from USB - with persistence

GuruX wrote:

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

#13 2011-09-05 04:59:04

jackbang
#! CrunchBanger
Registered: 2009-05-28
Posts: 244

Re: #! Statler from USB - with persistence

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

#14 2011-09-06 03:25:07

lewispm
#! Member
From: Collierville, TN
Registered: 2009-07-29
Posts: 87

Re: #! Statler from USB - with persistence

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

#15 2011-09-07 16:05:14

ugh
Member
Registered: 2011-01-10
Posts: 29

Re: #! Statler from USB - with persistence

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

#16 2012-03-08 23:41:19

Kostronor
New Member
Registered: 2012-03-08
Posts: 2

Re: #! Statler from USB - with persistence

ugh wrote:

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 big_smile )
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

#17 2012-03-09 21:46:55

pbfu
Member
Registered: 2011-11-01
Posts: 11

Re: #! Statler from USB - with persistence

LiLi usb creator http://www.linuxliveusb.com/ can also make a live crunchbang persistence usb...
very cool to use it via usb... big_smile

Last edited by pbfu (2012-03-09 21:48:30)

Offline

#18 2012-03-10 18:03:34

Kostronor
New Member
Registered: 2012-03-08
Posts: 2

Re: #! Statler from USB - with persistence

pbfu wrote:

LiLi usb creator http://www.linuxliveusb.com/ can also make a live crunchbang persistence usb...
very cool to use it via usb... big_smile

Thanks for the hint, i am testing it at the moment and it seems to work!

Offline

#19 2012-03-10 20:05:34

machinebacon
#! unstable
Registered: 2009-07-02
Posts: 6,586

Re: #! Statler from USB - with persistence

^ 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 smile

Offline

#20 2012-03-11 14:56:35

ugh
Member
Registered: 2011-01-10
Posts: 29

Re: #! Statler from USB - with persistence

Kostronor wrote:

Hey ugh,
i have used your method explained in ot and i got some errors setting up grub (like everyone has big_smile )

I didn't notice that anyone else had troubles with GRUB.  wink
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. sad


Toshiba laptop - 1.86GHz x 2
3 G RAM
Crunchbang Statler upgraded to Sid
2.6.XX-X.dmz.X-liquorix-amd64

Offline

#21 2012-03-14 11:13:00

foxy
Member
Registered: 2011-11-29
Posts: 22

Re: #! Statler from USB - with persistence

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

#22 2012-03-14 14:10:42

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 11,496

Re: #! Statler from USB - with persistence

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.


Yes; as a matter of fact, I am a cop.  Why do you ask? cool
I'm a moderator here.  How are we doing?  Feedback is encouraged.

Offline

#23 2012-03-14 21:20:25

ugh
Member
Registered: 2011-01-10
Posts: 29

Re: #! Statler from USB - with persistence

foxy wrote:

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

#24 2012-03-15 08:08:38

foxy
Member
Registered: 2011-11-29
Posts: 22

Re: #! Statler from USB - with persistence

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 smile
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 smile

Offline

Be excellent to each other!

#25 2012-09-30 18:24:29

No-Thing
Member
From: Denmark
Registered: 2012-09-11
Posts: 43

Re: #! Statler from USB - with persistence

foxy wrote:

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 smile
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 smile

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 smile

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

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.

Debian Logo