LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Virtualization and Cloud (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/)
-   -   Virtual to Bootable USB (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/virtual-to-bootable-usb-938921/)

EXcatog 04-09-2012 11:58 AM

Virtual to Bootable USB
 
Hey Folks, first post here.

I am looking to build up a really small distro of linux with all the tools and whatnot that I use, and then use that on a persistant bootable USB. I really wanted a basic distro to build off of so I selected SliTaz. I downloaded the .iso file, and fired it up with VirtualBox. I used the SliTaz utility it came with to install it down to my virtual hard disk. I then used tazpkg manager and did some compiling of my own to build it to my liking. I did this as a fun project to familiarize myself with Linux a bit more and for use at work. After building it up, I really wanted to boot this from my USB thumbdrive. I tried to be clever and am running into some issues haha.

So essentially what I did was fire up my virtual machine using a slax iso file, I passed-through a physical USB stick I use for storage, and did a gzipped DD of the (the virtual disk) /dev/hda device to my thumbstick. I then fired up my Arch distro on another machine, plugged in the thumbstick with my .dd.gz iso and my target thumbstick which was zero'd out. gunzipped the image, DD'd the image to the thumbstick and double checked it with an fdisk -l, all the partitions took, great! I then restarted my box and selected USB as the boot device, the SliTaz boot loader came up, AWESOME!

Then tragedy :( I got a kernel panic, and it happens consitently. It seems to be pretty common and the best I can figure it has something to do with grub.conf and the disk. Now my disk is SD* as it is a USB stick now. IS this the issue? I am pretty new to kernel/grub/booty/configurey type of issues. Alot of the stuff from google didn't seem to quite fit my scenario, as it is pretty unusual I am sure.

Anyways, any tips, ideas, thoughts, suggestions, etc, would be GREATLY appreciated! Thanks so much everyone!

EDIT - Can't forget the error!

Code:

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
PID: 1 comm: swapper Not tainted 2.6.30.6-slitaz #1
Call Trace:
"Why you failed and can't understand type data"


TobiSGD 04-09-2012 12:01 PM

Slitaz comes already with a tool to achieve what you want, tazusb. Have a look at the man-page for more information.

jefro 04-09-2012 03:32 PM

"a persistant bootable USB"

The problem with a persistant usb is that you can never change some of the files. You simply want to install slitaz to a usb just as if it were a normal hard drive. Be careful or use a tool (maybe like tazusb) or dd a usb/hybrid iso image to some flash drive.

TobiSGD 04-09-2012 03:49 PM

Quote:

Originally Posted by jefro (Post 4648677)
The problem with a persistant usb is that you can never change some of the files.

That is the advantage of the tazusb tool. Normally you just install Slitaz to your harddisk and customize it (or just start it from a CD/USB/network and customize it). Then you use tazusb to create a persistent install on the USB drive. This install will be loaded to RAM when booting and running from there. Since Slitaz is so small this works fine even on older machines. If you make changes to the running system you can easily use tazusb again to write the changes back to the USB drive. For files that you want to keep you can also use an extra partition on that USB drive that will be mounted to /home, so that you can have larger files that are not loaded into RAM.

jefro 04-09-2012 07:12 PM

There may be more than one way to skin a cat. The OP is welcome to explore any method.

Generally persistent installs have a difficult time updating kernel's. This is why I believe the vm is failing. If you feel that the tazusb.exe is the way to go then I can say I might try it someday.

Why don't you just install it to the usb flash as a normal install?

Or use the Slitaz method? http://www.syslinux.org/wiki/index.p...HARD_DISK_MODE

http://www.slitaz.org/en/get/#stable


Now that I see the title of this post I wonder if we both aren't on the wrong track too. The more I read it I think we missed his issue.

EXcatog 04-16-2012 09:45 AM

Hey! Thanks everyone for the responses! I am doing this as a foray to just better understand *nix in general, forming up my own uses for it and making it portable and learning booting behaviors and procedures in the process. I have taken all of your suggestions, or will be rather, and to an extent. I am using the tazusb binary from the distro, to install Slitaz onto a USB storage device. I will then use Tazusb to write a rootfs.gz of my filesystem with all of it's compiled and installed programs I added to it, etc etc. I will then copy that rootfs.gz over the one that Slitaz puts on the target thumbdrive when you do the iso2usb install of Slitaz to a thumbdrive. I imagine this would work? Thanks for all the posts guys, sorry for the delay though! Work and life eat up alot of time for me!

Any other thoughts/suggestions are great! This might seem out of the norm and or not best practice or whatever to get what I want, but I just want to tinker around to better learn about all the different distros and flavors of *nix.

Always learning :)

TL;DR, I created a virtual machine using Slitaz, compiled and installed a bunch of binaries I use for work. Now am trying to get that virtual machine as is, including compiled data, settings, etc etc, persistent and bootable from a thumbdrive.

WizadNoNext 04-16-2012 03:04 PM

EXcatog: Yes we did missed issue:
Quote:

Originally Posted by EXcatog
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

It means not less, not more then: I cannot find stated device. In this case it is very wrong. To my knowledge there is no device with major:minor 0:0. Whatever. You need to put FS UUID (File System Universal Unique ID) instead of hard-stated device.
So instead of
Code:

root=/dev/hda1
or something similar, you need to put FS UUID like
Code:

root=UUID=abcdef01-1234-5678-....
to /boot/brug/brub.cfg
You would get FS UUID with tools like tune2fs
Code:

tune2fs -l /dev/hda1 | UUID
if you are using different FileSystem, then ask somebody or RTFM about your FS.


All times are GMT -5. The time now is 06:32 AM.