LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
LinkBack Search this Thread
Old 01-02-2012, 12:38 PM   #1
dogpatch
Member
 
Registered: Nov 2005
Location: Central America
Distribution: Mepis
Posts: 159
Blog Entries: 1

Rep: Reputation: 18
Goal: Bootable Linux flash drive.


I have downloaded and used SimplyMEPIS-CD_8.0.15-rel_32.iso to burn a LiveCD, which works well for booting to Mepis from almost any computer. Yes, i am aware that this is not the latest Mepis and will soon not be supported; this part does not concern me at present. But i need a portable way to carry Linux with me, boot Linux from Windows-oriented cyber cafes, and save emails, bookmarks, webpages, etc, on the road.

So i used my cd to install Mepis onto an 8 Gig USB flash drive, which the installation process formatted with a 7G ext3 partition and a 1G swap partition. After installing Mepis, i followed the instructions for installing the grub bootloader. (This step seemed to take an extremely long time to complete, if that signifies anything.) After a long wait, the installation process reported that grub was installed OK, and i could now reboot to my flash. When i tried to do so, however, i only saw the initial word "GRUB" on my monitor, after which the system froze with no further boot steps. I can access the data on my flash if i boot to Linux from some other device.

My next step was to boot from the LiveCD again and look at the MEPIS 8.0 USER'S MANUAL, where i found (under '4.2: Special situations'), a section entitled 'Without a CD' which says, in part, "On a second computer, boot to the LiveCD and create a bootable MEPIS Linux 8.0 flash drive using the MEPIS System Assistant", which i then tried to do. Under System=>MEPIS Settings, i did find a tab marked 'MEPIS System Assistant', but could see nothing within that utility for creating a bootable flash drive. (There was a tab for 'MEPIS USB Key' and another for 'Repair System Boot', but neither of these was able to make my flash bootable.) Re-installing multiple times likewise had no effect.

Part of the problem seems to be BIOS related. All the above was on my 10-year-old tower. When i tried to boot from a newer computer at a cyber cafe, i did get the grub menu, but grub was unable to load the kernel, or the kernel was unable to mount the flash drive.

Next, i navigated to www.mepis.org/docs/en/index.php/Onthego, and from there to other sites, including linuxquestions.org, looking for info. Unfortunately, i have not kept careful notes as to where i found what. I found some old forums that advised recompiling the kernel on the flash drive, but as none of the newer sites mentioned this, i thought this must be obsolete information. On one site, i found a page that advised specifying the device volume label (uuid) to both grub and fstab on the flash drive. This seemed to have little or no effect.

Next, i downloaded and ran a program called unetbootin-linux-565, which did something (??) to the mbr. Now the older computer still couldn't even get the grub menu, but the newer computer was able to launch grub, and grub was able to launch the kernel. And i did get a scanty sort of Linux system running, but it was not even close to a full Mepis OS. Both from various boot error messages, and from the incomplete system that finally loaded, i surmise that the kernel loaded, but could not find or mount its own flash drive as a read-write or even as a read-only filesystem, and so the complete os was missing. On other cyber cafe computers, i still get a failure to load the kernel, or even a kernel panic (i think this happens when i remove the initrd line from grub.)

Do i indeed have to recompile the flash drive's kernel? If so, what must i include, and where can i find the modules i need? How do i get around the apparent BIOS-related inconsistencies?

Might another distro be better at creating a bootable usb flash drive?

I have not (yet) tried LILO as a bootloader.

Here are my flash drive specs:

Manufacturer: ADATA
Serial #: 7a431ef7df5521
Class 0 ((Defined at Interface level))
Subclass 0
Protocol 0
USB Version 2.00
Vendor ID 0x125f (A-DATA Technology Co., Ltd.)
Product ID 0xc82a Revision 1.00
Speed 480 Mbit/s
Channels 0
Max. Packet Size 0

Thanks for any clues.
 
Old 01-02-2012, 05:19 PM   #2
jefro
Guru
 
Registered: Mar 2008
Posts: 10,246

Rep: Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255
You put a lot in this post. Can't answer it all exactly. You should not have to compile anything just yet. Since you can't get this deal to work on a newer system it may have never been built correctly. Also some flash drives are difficult. HP usb tool or flipbit may help.



There are basically two main ways to install a newish linux to a flash drive. One is to correctly follow the installer and put both grub and the install on the flash drive. Two is to use a live install if the distro supports it. See pendrivelinux.com for how-to's.

I usually use a virtual machine to install os's to flash drives just to be sure. There is a few tricks to using flash drives. Some installers use sdx numbers and not uuid numbers.
 
Old 01-02-2012, 06:18 PM   #3
Roken
Member
 
Registered: Oct 2011
Location: Oldham, UK
Distribution: Arch, Debian, LFS (debian and LFS relegated to backups)
Posts: 251

Rep: Reputation: 40
In the past I've installed Linux to a VM in Virtualbox and then (still using a VM) used clonezilla to clone the VB installation to the flash drive, and with some success. Clonezilla does it's best to fix up grub for you when cloning, which helps, and the initial installation (and any subsequent updates) go along much faster in a VM than they do on a usb pen drive.

Having said that, it would help to know what kernel version you have installed to the pen. I forget the specifics, but some older kernels are missing some usb flags that are needed to successfully boot a pendrive that are fixed in later kernels.
 
Old 01-02-2012, 10:23 PM   #4
sgosnell
Member
 
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian
Posts: 296

Rep: Reputation: 57
You want to install grub on the flash drive, not on your HDD, for this to work. When you get to the grub installation step, it should let you choose where to install it. If you put it on your HDD, you can only boot with the flash drive attached. Put it on the flash drive itself, and then when you want to boot from it, press Esc when the computer starts the boot process, and you should be able to choose the flash drive. If that doesn't work, and it doesn't with every computer, you have to change the BIOS to allow booting from USB drives, and perhaps change the boot order to put it first. This shouldn't usually be necessary, but might be on some older computers.
 
Old 01-03-2012, 05:10 AM   #5
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
You mentioned older computer not booting from usb. Some will not and you need to use a bootloader on the hd or cd to chainload the usb on the older sets
 
Old 01-20-2012, 12:51 PM   #6
dogpatch
Member
 
Registered: Nov 2005
Location: Central America
Distribution: Mepis
Posts: 159
Blog Entries: 1

Original Poster
Rep: Reputation: 18
Sorry for the delay in responding further. Here is the latest on this thread:

I have indeed gotten Mepis 8.0 to boot from an 8 G flash drive, using AntiX to create the flash w/ a 2nd partition for persistent data. Both partitions are ext3. That's a nice 1st step.

What i would really like is to have Mepis (or another distro) on my flash drive which would boot and run just like on a hard drive. That is, the system would be installed on the flash in a read-write partition, probably ext3. This would allow me to not only save certain personal data files, but would allow me to download and insall packages, bookmarks, cookies, etc, and would allow me to configure the browser, mail client, etc. In a word, my entire system would fit into my blue jeans key pocket.

I have installed Mepis on another flash drive, with Grub on the flash drive. I can boot to the grub boot manager and select Mepis, but it still complains that it cannot access the usb drive. I assume this means that the kernel can't read its own root system. Which brings me back to my original question: Is the kernel missing some usb flags that i could install via a kernel compile? Or can i get around this by installing a different initrd image with the proper usb drivers?

I don't believe drive designation is an issue in my case. All the computers that i would be using have Windows installed on an IDE drive (hda), using the entire drive. All the BIOSs i've encountered will only recognize the first scsi drive (sda1) as a bootable drive. Or, at least, i could always make sure my flash drive is the first, i.e. sda1. Or, if needed, i could designate the flash drive to grub using the uuid.

I'm willing to do a kernel compile, if i could know which modules i need, and a refresher how-to on kernel compilation (it's been over 15 years since i've compiled a kernel).

Thanks again.
 
Old 01-20-2012, 01:22 PM   #7
snowpine
Senior Member
 
Registered: Feb 2009
Posts: 3,860

Rep: Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019
Hi Dogpatch, you are overthinking what actually is a very simple problem. Let's go back to your first post:

Quote:
Originally Posted by dogpatch View Post
So i used my cd to install Mepis onto an 8 Gig USB flash drive, which the installation process formatted with a 7G ext3 partition and a 1G swap partition. After installing Mepis, i followed the instructions for installing the grub bootloader. (This step seemed to take an extremely long time to complete, if that signifies anything.) After a long wait, the installation process reported that grub was installed OK, and i could now reboot to my flash. When i tried to do so, however, i only saw the initial word "GRUB" on my monitor, after which the system froze with no further boot steps. I can access the data on my flash if i boot to Linux from some other device.
At this point, you are almost there, you are so close! All you need to do is repair your GRUB so you can boot to your newly-installed Mepis system. GRUB is confusing but it is also very well documented. I assume Mepis uses GRUB and not the newer GRUB2 (actually 1.9something).

There are some helpful tips in the Debian Wiki: http://wiki.debian.org/GrubRecover
And also some easy automated utilities like: http://www.supergrubdisk.org/

The best thing if you would like help repairing your GRUB is to retrieve the file /boot/grub/menu.lst (you said you can access the files from another operating system, right?) and post the contents here. It is probably a really simple fix like changing '/dev/sdb1' to '/dev/sda1' or something like that. (And you are on the right track that using UUID is the preferred method to avoid this mix-up. )

Last edited by snowpine; 01-20-2012 at 01:27 PM.
 
Old 01-20-2012, 03:46 PM   #8
dogpatch
Member
 
Registered: Nov 2005
Location: Central America
Distribution: Mepis
Posts: 159
Blog Entries: 1

Original Poster
Rep: Reputation: 18
Quote:
Originally Posted by snowpine View Post
Hi Dogpatch, you are overthinking what actually is a very simple problem.
I wish that were true. Seems like it should be simple.

Since posting the original question, i have installed AntiX to that flash drive. Here is the menu.lst file that the install process created:

Code:
timeout 10
color cyan/blue white/blue
foreground ffffff
background 0639a1

gfxmenu /boot/grub/message

title antiX at sda1, kernel 2.6.32-1-mepis
root (hd1,0)
kernel /boot/vmlinuz-2.6.32-1-mepis root=/dev/sda1 nomce quiet nosplash vga=791 
initrd /boot/initrd.img-2.6.32-1-mepis
boot

title Microsoft Windows XP Professional at hda1
rootnoverify (hd0,0)
chainloader +1
This results in a grub error:
Code:
root(hd1,0)
Filesystem type unknown, partition type 0x7
kernel /boot/vmlinuz-2.6.32-1-mepis root=/dev/sda1 nomce quiet nosplash vga=791 
Error 17: Cannot mount selected partition
From previous experience, i knew that the boot disk is always mounted as hd0, so i changed that line in menu.lst thus:

Code:
root (hd0,0)
To my great surprise, this results in a bootable drive. When i had made the same change to menu.lst with the Mepis 8.0 system installed, i still had booting problems. I can't remember the details. Perhaps i will try to reinstall Mepis 8.0 at some point just to retry that.

OK, so now i can boot to AntiX in a read-write ext3 partition. Home free, right? Well, not quite. Now i have a different problem, in that i cannot access the internet from this boot session. I haven't a clue why not. The connection is not through a usb port. I can access everything OK when i boot the very same version of AntiX from a Live CD or a Live CD / Flash with persistent data in a separate partition.

Here's another twist. Now when i replace '/dev/sda1' with the uuid thus:
Code:
kernel /boot/vmlinuz-2.6.32-1-mepis root=uuid=aeeaf1f4-3baf-4102-b4d0-da0b2921ef57 nomce quiet nosplash vga=791
i get a mounting error

Code:
mount: mounting uuid=aeeaf1f4-3baf-4102-b4d0-da0b2921ef57 on /root failed. No such device
Back to the original question: the fact that the system boots using the AntiX kernel and initrd but not with the Mepis 8.0 kernel and initrd would seem to indicate a problem with one or both of these images under Mepis. Why i cannot access the internet card under AntiX booted from the flash drive is beyond me.
 
Old 01-20-2012, 03:53 PM   #9
snowpine
Senior Member
 
Registered: Feb 2009
Posts: 3,860

Rep: Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019
There are two drive designations that must both be correct, I have indicated them in bold:

Quote:
title antiX at sda1, kernel 2.6.32-1-mepis
root (hd1,0)
kernel /boot/vmlinuz-2.6.32-1-mepis root=/dev/sda1 nomce quiet nosplash vga=791
initrd /boot/initrd.img-2.6.32-1-mepis
boot
These must both match the actual setup of your drives.
 
Old 01-20-2012, 04:16 PM   #10
dogpatch
Member
 
Registered: Nov 2005
Location: Central America
Distribution: Mepis
Posts: 159
Blog Entries: 1

Original Poster
Rep: Reputation: 18
As inicated above, the root designation must be hd0

Code:
title antiX at sda1, kernel 2.6.32-1-mepis
root (hd0,0)
kernel /boot/vmlinuz-2.6.32-1-mepis root=/dev/sda1 nomce quiet nosplash vga=791 
initrd /boot/initrd.img-2.6.32-1-mepis
boot
My new, revised questions are:

1. Why does this work with AntiX but not Mepis? Seems like the Mepis kernel or initrd must be missing something. How can i fix Mepis?

2. Why can't i access the internet card while booted to my flash drive?
 
Old 01-21-2012, 01:00 PM   #11
dogpatch
Member
 
Registered: Nov 2005
Location: Central America
Distribution: Mepis
Posts: 159
Blog Entries: 1

Original Poster
Rep: Reputation: 18
I am posting this from a cyber cafe, having successfully booted to AnitX installed on my 8G flash drive! The grub entry that i am using is
Code:
title		antiX-M8.5, kernel 2.6.32-1-mepis
root		(hd0,0)
kernel	/boot/vmlinuz-2.6.32-1-mepis root=UUID=aeeaf1f4-3baf-4102-b4d0-da0b2921ef57 ro nosplash quiet 
initrd		/boot/initrd.img-2.6.32-1-mepis
I'm not really sure that the uuid was necessary, but just to be thorough, i also altered the first two entries in fstab with uuid's as follows:
Code:
# Pluggable devices are handled by uDev, they are not in fstab
#/dev/sda1 / ext3 defaults,noatime 1 1
UUID=aeeaf1f4-3baf-4102-b4d0-da0b2921ef57 / ext3 defaults,noatime 1 1
#/dev/sda2 swap swap sw,pri=1 0 0
UUID=13a19f09-d901-4761-ba33-454c39dd6a30 swap swap sw,pri=1 0 0
plus, i ran the Network Interface utility in a Roxterm window to configure the network card, which enabled me to go online (duh!). I suppose this means that i may have to do this every time i go to a cyber cafe with a different network configuration. Such is life. (How does the LiveCD and LiveCD/Flash manage to configure this automatically, but not the full installation?)

Here is the output of inxi, although it didn't teach me anything
Code:
System:    Host antiX1 Kernel 2.6.32-1-mepis i686 (32 bit) Distro antiX-M8.5-486 Marek Edelman 11 April 2010
CPU:       Single core Intel Pentium 4 (UP) cache 512 KB flags (sse sse2) bmips 5322.25 clocked at 2660.282 MHz 
Graphics:  Card Intel 82865G Integrated Graphics Controller X.Org 1.6.5 Res: 1280x1024@60.0hz 
           GLX Renderer Mesa DRI Intel 865G GEM 20091221 2009Q4 x86/MMX/SSE2 GLX Version 1.3 Mesa 7.7.1-DEVEL Direct Rendering Yes
Audio:     Card Intel 82801EB/ER (ICH5/ICH5R) AC'97 Audio Controller driver Intel ICH at ports 1000 1400 BusID: 00:1f.5
           Sound: Advanced Linux Sound Architecture Version 1.0.21
Network:   Card Broadcom NetXtreme BCM5782 Gigabit Ethernet driver tg3 v: 3.102 BusID: 05:02.0
Disks:     HDD Total Size: 49.2GB (6.8% used) 1: /dev/hda Maxtor 6E040L0 41.1GB 
           2: USB /dev/sda USB_Flash_Drive 8.1GB 
Partition: ID:/ size: 6.4G used: 3.2G (52%) fs: ext3 ID:swap-1 size: 1.10GB used: 0.00GB (0%) fs: swap 
Info:      Processes 76 Uptime 9 min Memory 46.1/494.3MB Runlevel 5 Client Shell inxi 1.4.9
I may still try to get Mepis running on my flash drive, but for now, i guess i will call this thread (tentatively) solved.
 
Old 01-23-2012, 05:04 PM   #12
dogpatch
Member
 
Registered: Nov 2005
Location: Central America
Distribution: Mepis
Posts: 159
Blog Entries: 1

Original Poster
Rep: Reputation: 18
Is there a button for 'Unsolved'?

I spoke too soon. The usb flash drive was good for exactly one boot. Apparently, the shutdown process was not flushing the buffers for the drive, and subsequent boots were unsuccessful, requiring e2fsck to fix the drive. After 3 such cycles, the drive is now apparently fubar, and i'll have to start over from scratch, having lost alot of data and alot of time. Does the running system see the flash drive as a different filesystem than grub and the init processes? How do i make sure the real filesystem is shutdown by shutdown? Or do i just go back to Windows?

Seems like this should have been a simple matter. Any thoughts would be welcome.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Making bootable USB flash drive to install Linux tron_thomas Linux - General 35 07-11-2011 11:19 PM
Which Flash drive works best when creating bootable linux images? dv502 Linux - Hardware 5 07-30-2010 03:47 PM
unable to boot from bootable Linux flash drive on eeepc 1008HA RohitBhosale Linux - Newbie 6 02-25-2010 05:21 PM
Clone Linux Bootable USB Flash Drive hpnoobs Linux - Newbie 3 09-17-2008 09:38 PM
bootable live Linux on USB flash drive james2b Linux - General 3 03-03-2008 02:08 AM


All times are GMT -5. The time now is 01:59 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration