PDA

View Full Version : Live USB Questions


cairne
19th January 2010, 07:25 PM
Hello All!

I have a few questions regarding running a live version of Fedora from a USB stick. I currently have a 2gb stick and looking at going to an 8gb. I was wondering how the persistant overlay works exactly, I have been reading arounda and maybe I missed the newbie guide to using it. Does it apply to when I install packages onto my stick? Like if I want to install some packages and remove other packages will that be kept on the stick?

Also I was wondering what does the host machine see when you use a live usb stick? Is anything written onto the host machine? Does it track cookies or internet information? Or is the live usb completly automous?

Thanks,

Cairne

GoinEasy9
19th January 2010, 07:29 PM
Many answers in this link:
http://fedoraproject.org/wiki/FedoraLiveCD/USBHowTo

cairne
19th January 2010, 07:38 PM

Thanks, I had read that, still a little fuzzy on how the persitant overlay works. Is it possible to actually install a full version of Fedora onto a 2gig usb stick? or would a bigger stick be better, also I read that this can cause the stick to burn out quicker, is that true?

GoinEasy9
19th January 2010, 08:14 PM
Persistence is stored on USB stick, not to hard drive. Some folks use ext2 as file system format because it does not journal like ext3 does. I use ext2 format for USB sticks.

cairne
19th January 2010, 08:25 PM
What about the host machine, what does it experience. For instance if I ran a live version on a work computer would the system admins even know it happened. Would internet or program activity still show up in router logs?

GoinEasy9
19th January 2010, 08:34 PM
Depends, I wouldn't try it without asking your IT guys. The USB stick will be recognized as new hardware. IF your box accepts the new hardware (most terminals have a rom that is set to reject it), then, whatever your terminal is doing will show up in their logs. At least that's the way it should work, if they set up their intranet securely. It's really amazing how many networks aren't set up securely. But don't take that chance, especially if you want to keep your job.

cairne
19th January 2010, 08:37 PM
I wasn't planning on doing anything, just was the only example I could come up with. Just really curious of the interaction with the live and the host machine. Makes me want to learn to be able to tear apart the code and see exactly what goes on.

GoinEasy9
19th January 2010, 10:05 PM
Checking out the code is a great way to learn. I haven't programmed in years, but still like looking over the code.

cairne
29th January 2010, 05:36 PM
I erased my F10 usb stick that was working fine to make a f12 stick and i've tried 3 live images and can not get it to work :( Just get the message Boot Error

GoinEasy9
29th January 2010, 05:55 PM
You must be psychic, I was just thinking about making a Live USB stick today. Once I get to it, I'll let you know how I made out.

cairne
29th January 2010, 06:01 PM
Hahaha, great minds think alike. I think I might be maybe setting my persitant storage to high, tried setting it at 500 mb. Liveusb runs fine says complete and does a check of the image but still no luck.

apirdy
1st February 2010, 03:32 AM
Carine,
I have some questions as well that I was hoping maybe you found out about in some of your research. I want to know exactly how the overlay works... is it a sparse file? if so is there a full filesystem inside of it? Can that filesystem inside be formatted differently (ie ext(2,3,4) etc?). Does it always gain in size (if I download something and then delete it do I get that memory back?)? Also if it is a sparse file what happens when it fills up? Does it corrupt itself? Do you know if this depends on the type of file system inside of the sparse file?

Thank you for any help that you might be able to provide, even if you could just give some links that you have found helpful, or somewhere where I could find the source that makes all of this work, so that I could look into it myself that would be wonderful.
Thanks,

xander

ispanico
26th March 2010, 08:47 AM
hello,


i am trying to install fedora 12 with liveusb creator on a 16Gb memory flash,
I got always the same problem: I put the persistence overlay at different settings and each time, operative system starts and works almost fine but I always get no more than 3Gb space for /
so I can't update the system to all I need.

Do you have any idea why?

JEO
26th March 2010, 10:21 AM
It is because the live usb is created simply by copying a live cd image into a usb stick. This image is highly compressed and when uncompressed you get about a 3GB filesystem. It doesn't matter how big your overlay file is you can't increase this limit unless you either 1) make your own live cd (dvd) and increase the filesystem size, 2) install directly to a usb device (not a live install).

ispanico
27th March 2010, 04:29 PM
Thank you, for the explanation but then I don't understand exactly what's the overlay option in the software...?
which one is the easiest way of the 2 options you suggest?
in particular how do I install a fedora version directly into the flash memory? and will the pc bootstrap from there?

thanks for the help

JEO
27th March 2010, 05:45 PM
The overlay option creates an overlay file that is a table of differences between the original filesystem and the current filesystem. With a 3GB filesystem the maximum overlay file that would make sense is 3GB. As for your other two questions, which is easiest? Option 2 probably. I do not have a huge usb flash drive to try that on sorry. Of course for option 2 you should format the drive as ext2, 3, or 4. I have used option 1 in the past to create my own live cd. Will the PC bootstrap? Depends on the BIOS in your pc. Not all BIOSes are the same in ability to boot USB flash drives.

ispanico
27th March 2010, 06:52 PM
For the overlay then it means that if I format the flash memory with a different file system, on that has a bigger capacity, then the overlay should work and increase the / partition up to the required capacity.
Is this correct?
which file system then would you suggest?

for option no 2, so far the bios of the laptop let me bootstrap from the flash, FC12 is starting from there, therefore it should work isn't it?

for the first option then, how can i create my own live cd and adjust the file system

well thanks a lot

JEO
27th March 2010, 07:10 PM
I personally do not know the maximum workable size of the overlay file. I know that if the overlay resides on fat32 it can't be over 4GB.

For option 2, see this link on how to create your own live cd:

http://fedoraproject.org/wiki/FedoraLiveCD/LiveCDHowTo

ispanico
27th March 2010, 07:32 PM
hello,

so I read all the instruction. I didn't find how to change my file system capacity.
Is it enough to format to F 16?

JEO
27th March 2010, 08:32 PM
I see a line in the file /usr/share/spin-kickstarts/fedora-live-base.ks, assuming its 3072 megabytes (3GB) perhaps changing this number will work.

part / --size 3072 --fstype ext4

rockdoctor
27th March 2010, 11:30 PM
From what I've been able to determine, the overlay file on a Fedora Live USB stick is some type of writable device-mapper snapshot. It doesn't behave the way I expect a "real" filesystem to behave, where I can mount it and work with it. On an Ubuntu Live USB stick, the filesystem is an aufs overlay - a real filesystem. One limitation of the Fedora (and presumably Ubuntu) persistent files; you can't (easily; I'm sure there's a way to do it) upgrade the kernel. With a large (>4GB) USB stick, I'd try to do a normal install - anaconda thinks my 4GB stick is too small

ispanico
28th March 2010, 07:21 PM
Hello,

I am sure that 4Gb is not enough, I see on the version I have now that gave me no more than 3Gb for the / that
at the beginning without any further installation I have about 1Gb more space on /, then I tried to put all the things I need for work and fun and I had no space, I believe 4Gb is not enough. that is why I bough a 16Gb flash memory but then I found this trouble or misunderstanding with the overlay.

I will try to do my own live image changing the file system capacity as suggested by JEO and I will post the result.
Unfortunately I am not expert and therefore it takes time and stupid question like where or how can I take the packages for the livecd-fedora-desktop.ks ?
I mean it is explained how to create the live disc from a configuration file but how do i get the packages or access to the file mention: /usr/share/spin-kickstarts/fedora-live-base.ks
Is it correct that once kickstart is installed I can access the configuration file for the livecd-fedora-desktop.ks and there I can change the capacity of the file system?


I hope it will work!

apirdy
1st April 2010, 02:52 AM
@ispanico - I would say that the second option is by far the easiest, and that there are existing tools to make it even easier. It will definitely work as well, whereas the first suggestion would be a lot of work (and JEO feel free to correct me, and I apologize for speaking for you) and was speculation. A full installation is not ideal though either, it may reduce the life of the drive by writing frequently (since normal hard-drives don't have this problem).

After running across a post detailing how one user (DZ*) set up full installs on live-usb media, I pm'd him asking for more specific instructions. I have decided to post that exchange here in case it will be useful to others:

Hello,
I just ran across your post @ http://forums.fedoraforum.org/showthread.php?t=225095. I was wondering if you could detail more specifically what you did to prevent writing to the media often, and prevent wearing out your disk (ie. how do you put tmp and logs into a ram drive, and what flags did you add to boot options and how). [...]
Thank you very much for any help you can give me.
-Xander

You could install on a flash just as if it was a hard drive. Nothing really specific to the fact that it is a USB stick. Just be careful during the install. If the stick is /dev/sdc watch not to put grub on /dev/sda. You could remove the hard drive to be safe.

So it doesn't matter how it is formatted. The stick will be reformatted (I use ext4) during the install.

I use the following modifications, they seem to speed up performance considerably.

1. assuming ext4,
tune2fs -o journal_data_writeback /dev/xxx
(/dev/xxx is the root partition on unmounted stick)
then add data=writeback to "/" mount options in /etc/fstab

2. Add noatime,commit=60 to "/" mount options in /etc/fstab

3. Put tmp into RAM: Add to /etc/fstab:
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0

4. add elevator=noop to kernel boot options
(in /boot/grub/menu.lst)

I also resized the swap partition to 0 and added that space to the root partition, by using gparted (unmount first), then mounted the stick and removed the swap entry from fstab. I did this because I use encrypted home and I don't want unencrypted stuff to end up in swap. Although it's possible to set up encrypted swap, I thought I can live without having swap at all.

There are downsides to both though and some I have only heard of and am not positive of. Apparently the live installs are better at recognizing and dynamically initializing hardware at start (I have only heard this), which means that if you want something to work both at home and at work and the library you would be better off going with live. Also specific to fedora live, there is a corruption (I am not positive that this is the correct word) problem when the overlay fills up, it will cease to boot, and all the data is unrecoverable (there is a workaround to boot into the live, but you will loose all persistence). This is not true for all live distros, but ones that base their persistence on COW tables it is, whereas ones that are based on aufs, seem to be much more stable in at least this regard. If you want to see this for yourself simply dd from /dev/zero until the device is full. Ubuntu live will work afterward, and you can just delete the huge file, whereas the fedora persistence overlay will be unrecoverable.

Sorry for such a long post,
Alexander

rockdoctor
3rd April 2010, 03:42 PM
how do I install a fedora version directly into the flash memory? and will the pc bootstrap from there?
To install to the flasm memory, just select that device as the installation target.
As far as your computer booting from that flash memory, YMMV.

Darr247
16th April 2010, 06:16 PM
I erased my F10 usb stick that was working fine to make a f12 stick and i've tried 3 live images and can not get it to work :( Just get the message Boot Error



Use QEMU to simulate booting... e.g.


# mount
to see where the USB stick mounted from (assuming autofs is installed/used... then)

# umount /dev/sdf1 (to unmount it, if it was /dev/sdf1, then)

# qemu -hda /dev/sdf -m 256 -vga std (match the /dev/sd? part to the USB stick)




If it will not work like that, then the problem is probably the stick was not made bootable correctly. Near the end of the LiveUSB wiki (http://fedoraproject.org/wiki/FedoraLiveCD/USBHowTo) (section titled Errors and Solutions), there are things to try according to which exact error message you get.

If it does work like that, but still won't actually boot the computer, the problem is almost certainly that the computer is not correctly configured to boot from USB devices.

The "correct configuration" is different for nearly every different motherboard. I have 4 computers that will boot from USB and each one requires a different setting in the BIOS to be tweaked... even the 2 that are both ASUS motherboards have different settings in the BIOS from each other.

ispanico
11th June 2010, 05:55 PM
Dear all,

after some time I have tried the option to directly install the fedora version on the memory flash.
I have tried to install FC13 KDE and everything went fine on the installation.
Since I have seen there is a version called FC13 LXDE SPIN that looks done on purpose for the laptop, I have tried to do the direct installation on a second memory flash of 16Gb of this version.

In this case I had this problem: during the installation a sign saying that "daemon is inhibit" appeared.
The installation looked good at the end the only concern is that I could not log in, it looked like it did not recognize the user or the password. So I tried a second time to do the installation and now it works.
I have to confess that this version looks fine, is lighter and elegant as well but I got problem with the wireless: the device is recognized and it looks like the antenna find the net but it can't connect (even when it says it is connect it the network doesn't work). Let me say that form the boot cd the network works fine.

Ciao

fnkj
17th September 2010, 04:21 AM
does it matter if I use x86_64 or i386 for my usb? I intend to use it for desktops and laptops at my job and use a 16GB corsair voyager

GoinEasy9
17th September 2010, 04:28 AM
@fnkj
It all depends if all the machines you're going to use it on are 64 bit. I find it easier to use 32 bit, since I don't know if I'll have to use it on someones older computer.

fnkj
17th September 2010, 04:47 AM
Ok principally I service 32-bit laptops with the occasional 32-bit desktop...so does this mean I pick the x86_64?

GoinEasy9
17th September 2010, 05:18 AM
No, for 32 bit, the i686.