Allegro.cc - Online Community

Allegro.cc Forums » Off-Topic Ordeals » Linux :: LiveUSB :: Gentoo :: Success! \o/

This thread is locked; no one can reply to it. rss feed Print
Linux :: LiveUSB :: Gentoo :: Success! \o/
bamccaig
Member #7,536
July 2006
avatar

To make a long story short, I decided to attempt for the first time to install a live Linux system on my USB thumb drive. It's handy to have and, let's face it, just plain cool. I've been meaning to do it for a while. Anyway, in deciding which distribution to install, I was originally thinking Fedora because I have the most experience with it, but instead opted for Gentoo. ;) I wasn't really concerned with a desktop environment or anything. All I needed was enough to get Linux running and hopefully all of the tools I would need to rescue a typical Linux (and hopefully also Windows) system if something goes badly.

I followed the Gentoo LiveUSB guide, which seems a little dated, but still very applicable. It was pretty easy considering my intermediate experience with Linux. I didn't have a Gentoo installation working yet (I have a minimal Gentoo install running in VirtualBox in Windows, but that hardly counts). Instead, I went ahead from Fedora. The only notable difference seemed to be the location of mbr.bin, which find eventually found at '/usr/lib/syslinux/mbr.bin' instead of Gentoo's expected '/usr/share/syslinux/mbr.bin'.

My only gripe was that the guide doesn't seem to mention the need to download the LiveCD ISO until you get to the point where you mount it (that or I skipped that bubble). Essentially it left me waiting an hour while the download completed before I could proceed (it wasn't a complete surprise, but a heads up would have been nice so I knew which ISO I needed, etc.; I didn't think of it and didn't think to read ahead). On the bright side, while waiting for that to download, I began refreshing my memory on master boot records and decided to try pulling the newly created partition table off of my USB thumb drive for hex inspection. ;D A few attempts at `dd ... | tail ... | head ... | hexdump ...' eventually led me to success, providing me with a small boost in self accomplishment.

Much to my satisfaction, the mbr.bin that I had found worked and my LiveUSB booted right up first try. I skipped any kernel preferences/parameters and just went with the default boot options. Happily it seemed to work fine. And much to my surprise, the system by default booted into an Xfce desktop. :D It wasn't necessary, but I'm sure it might come in handy eventually. It does allow me to use it as a stand-alone portable desktop, which is one of th things I did want, though didn't expect when I chose Gentoo. I'm currently posting this from the LiveUSB (albeit, the font + display settings make it kind of hard to read).

I'm quite satisfied. If only I could figure out the display options to make it look right on my relatively large widescreen display (without limiting it's effectiveness on random machines I try it on) I would be completely happy with the desktop side of it. The mouse sensitivity is quite high (unless that's just a side effect of the display options), but it's probably easily configurable and livable nonetheless.

Mmmmz, Gentoo.

BAF
Member #2,981
December 2002
avatar

Now do the cooler thing, and install OS X.

I just installed it on my new Dell Mini 10v, works great. Got the mini for $228 after 15% off coupon (it was a previously ordered new unit from the dell outlet - so it's new and cheap).

blargmob
Member #8,356
February 2007
avatar

!?

Where do you get a copy of an Apple OS?

...does it start with a T and end with a orrent?

---
"No amount of prayer would have produced the computers you use to spread your nonsense." Arthur Kalliokoski

BAF
Member #2,981
December 2002
avatar

Amazon.com, apple.com, an Apple store... maybe Best Buy, etc etc. I personally repurposed the copy that came with my MacBook Pro. I'm sure someone will be in to complain about it being against the EULA, but then again, so is installing it on non-Apple hardware, so I'm in breach anyway, and I get to save $140.

bamccaig
Member #7,536
July 2006
avatar

Unfortunately, the root password apparently isn't blank, as Gentoo guides seem to believe the case should be. I was going to just chroot into the LiveUSB file system and set it that way from Fedora, but little did I realize the file system isn't just a raw structure. It seems to be a compressed and probably read-only system that I can't just modify so easily (unsurprising since it's based on a LiveCD ISO). Most of the bulk seems to be in '/image.squashfs' on the ISO so I'm thinking if I can figure out how to mount that I might be able to make some changes, like to the root password. Maybe I can also add some widescreen resolutions to xorg.conf, which would be really handy since most of the monitors I use these days are widescreen. I'm not entirely sure what squashfs is yet.

BAF
Member #2,981
December 2002
avatar

mount /image.squashfs /mnt/blah -t squashfs -o loop

bamccaig
Member #7,536
July 2006
avatar

Yeah, I figured that out pretty quick. Unfortunately, it isn't that easy as the file system is apparently read-only (Note: Fedora automatically mounted the USB thumb drive's only partition at '/media/disk').

[root@rufus ~]# ls -la /mnt/usb/
total 8
drwxr-xr-x 2 root root 4096 2009-08-03 17:28 .
drwxr-xr-x 4 root root 4096 2009-08-03 17:28 ..
[root@rufus ~]# mount -o loop -t squashfs /media/disk/image.squashfs /mnt/usb
[root@rufus ~]# ls -la /mnt/usb
total 4
drwxr-xr-x 19 2608 2608   219 2008-07-06 18:21 .
drwxr-xr-x  4 root root  4096 2009-08-03 17:28 ..
drwxr-xr-x  2 root root  1319 2008-07-06 18:17 bin
drwxr-xr-x  2 root root    22 2008-07-06 18:21 boot
drwxr-xr-x 10 root root 15074 2008-06-11 13:47 dev
drwxr-xr-x 76 root root  2717 2008-07-06 18:21 etc
drwxr-xr-x  4 2608 2608    51 2008-02-05 17:57 home
drwxr-xr-x 11 root root  3017 2008-07-06 18:21 lib
drwxr-xr-x  2 root root    37 2008-06-30 14:52 media
drwxr-xr-x  4 root root    52 2008-06-11 13:46 mnt
drwxr-xr-x  3 root root    45 2008-06-30 14:54 opt
drwxr-xr-x  2 root root     3 2008-06-11 13:44 proc
drwx------  4 root root    94 2008-07-06 18:21 root
drwxr-xr-x  2 root root  3199 2008-07-06 18:17 sbin
drwxr-xr-x  6 2608 2608    81 2008-02-05 17:57 .svn
drwxr-xr-x  2 root root    22 2008-06-11 13:44 sys
drwxrwxrwt  2 root root     3 2008-07-06 18:21 tmp
drwxr-xr-x 15 root root   281 2008-07-06 18:21 usr
drwxr-xr-x 12 root root   117 2008-07-06 18:21 var
[root@rufus ~]# chroot /mnt/usb
grep: /proc/cmdline: No such file or directory
rufus / # passwd
New UNIX password: 
Retype new UNIX password: 
passwd: Authentication token lock busy
rufus / # 

One source suggested remounting read/write with...

rufus / # mount -o remount,rw /
can't create lock file /etc/mtab~4432: Read-only file system (use -n flag to override)
rufus / # 

..., but as you can see it isn't that simple (should I override with -n? Edit: 1). :P I even tried backing out and trying again with the rw option (a bit of a guess because I'm not overly familiar with mount), but that didn't work either...

rufus / # exit
exit
[root@rufus ~]# umount /mnt/usb
[root@rufus ~]# mount -o loop,rw -t squashfs /media/disk/image.squashfs /mnt/usb
[root@rufus ~]# chroot /mnt/usb
grep: /proc/cmdline: No such file or directory
rufus / # passwd
New UNIX password: 
Retype new UNIX password: 
passwd: Authentication token lock busy
rufus / # 

:'(

** EDIT **

1 Lot of good that did me.

rufus / # mount -n -o remount,rw /
rufus / # passwd
New UNIX password: 
Retype new UNIX password: 
passwd: Authentication token lock busy
rufus / # 

** EDIT **

Now I'm beginning to think I should create a "Linux :: LiveUSB :: Gentoo :: Failure... /o\" thread and link to it from here.

Maybe the squashfs drivers only support read-only access? I suppose I could copy the files to a new directory, make the necessary changes, and then make a new squashfs from the result. :-/

** EDIT **

It seemed to work for the most part to create a new squashfs archive. Unfortunately, I must have messed up the permissions because I got a ton of non-fatal errors when booting and was unable to login as the default gentoo user. I'm guessing I need to specify the '--preserve=all' option to cp. For some reason, the root password still didn't match and I was still unable to login. Fortunately though, and I didn't notice this before, when I switch to a virtual terminal I'm automatically logged in as root so if worst comes to worst I can probably just rely on that behavior to get root access (although it also somewhat makes the LiveUSB system an easy way for others to break into my own systems when they have local access, even if they came unprepared).

Evert
Member #794
November 2000
avatar

I'm guessing you did try just pressing <enter> when told to enter a password, and didn't assume there was a password just because the system asked for one?

Otherwise, if you can get into the system using another terminal (which sounds a bit weird to me, but ok), can't you just reset the password there?

Don Freeman
Member #5,110
October 2004
avatar

I don't think Gentoo would be a wise choice for a USB drive. All of the writing that will take place during the compile/merge of a package will reduce it's life faster than a different distro I would imagine. USB drives are not like normal hard drives. They are not really meant for that kind of abuse. Just for storing info, or to help transfer files from one computer to another.

On another note, with the price of USB drives so cheap now, I wonder if the gaming industry will start to sell read-only versions of USB drives that have the game built in. It could still have the copy protection stuff built in, but it could be even more "secure" because they could burn special data that would not let the program be ran without the USB drive in. At least it can't get scratched up...

--
"Everyone tells me I should forget about you, you don’t deserve me. They’re right, you don’t deserve me, but I deserve you."
"It’s so simple to be wise. Just think of something stupid to say and then don’t say it."

Samuel Henderson
Member #3,757
August 2003
avatar

On another note, with the price of USB drives so cheap now, I wonder if the gaming industry will start to sell read-only versions of USB drives that have the game built in. It could still have the copy protection stuff built in, but it could be even more "secure" because they could burn special data that would not let the program be ran without the USB drive in. At least it can't get scratched up...

That is an interesting rumination. I'm guessing that no matter how you do it (at present anyways) putting a game on a USB thumbdrive is still going to be more expensive than just pressing/burning it into blank CD's or DVD's that cost pennies or less to manufacture.

However, if the reduction in piracy leads to increased sales that offset the increased manufacturing cost (or even if the difference was small enough that the publisher could either eat the cost or increase the game price slightly) then I guess that the industry may take this approach.

I think the industry is slowly going toward a medialess distribution model though.

=================================================
Paul whoknows: Why is this thread still open?
Onewing: Because it is a pthread: a thread for me to pee on.

Thomas Harte
Member #33
April 2000
avatar

I can't remember whether it was Apple or Microsoft, but one of the companies that plans to distribute a new version of their OS this year was rumoured to be considering doing so on flash media rather than or in addition to optical disk.

Also from the realm of the rumours, Apple's inclusion of an SD card slot on the latest laptops is a conscious effort to transition away from optical media drives (which are large and consume a lot of power). The point being that Apple sat for many years with no SD card slot while the chuck-everything-we-have-at-it manufacturers included one, but subsequently relented — explicitly NOT that they've done something no-one else is doing. Because they patently haven't.

bamccaig
Member #7,536
July 2006
avatar

I think I was right about the '--preserve=all', but it didn't change much as I was still unsuccessful in changing the image in a meaningful way.

Evert said:

I'm guessing you did try just pressing <enter> when told to enter a password, and didn't assume there was a password just because the system asked for one?

Of course I tried just pressing <Enter>. ;) The password is certainly not an empty string. That or logging in as root is just disabled...

Evert said:

Otherwise, if you can get into the system using another terminal (which sounds a bit weird to me, but ok), can't you just reset the password there?

I should be able to (though I seem to recall that not working too), but the file system is based on a LiveCD and therefore read-only. It uses a tmpfs for changes while running, but AFAIK they are all lost when you turn the computer off (though nothing should stop you from mounting storage devices).

I don't think Gentoo would be a wise choice for a USB drive. All of the writing that will take place during the compile/merge of a package will reduce it's life faster than a different distro I would imagine. USB drives are not like normal hard drives. They are not really meant for that kind of abuse.

Since it's based on a LiveCD I don't even think it supports writing to the USB file system by default (though I'm sure I could mount it again, even if it required a separate partition). Still though, I think I would be more likely to make any desired changes on a host system and then rebuild the image. I could probably do limited building on the tmpfs if I really had to, so long as I have sufficient memory for it, but I probably wouldn't bother.

ReyBrujo
Moderator
January 2001
avatar

Ubuntu chooses a random password for root when installing it, and never tells it to you. However, if you want to change it you had to open a root terminal (which your initial user who had administrators privileges without being root, for example) and just type passwd to choose a new password. Eventually they gave the first account root privileges, including sudoing to change the root password.

--
RB
光子「あたしただ…奪う側に回ろうと思っただけよ」
Mitsuko's last words, Battle Royale

Go to: