Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
01-05-2015, 09:47 AM
|
#1
|
LQ Guru
Registered: Dec 2007
Distribution: Centos
Posts: 5,286
|
Questions about bootable USB Linux
I made a few tries at creating a Centos 6.5 bootable USB stick. I have several questions about that.
I want it as a utility OS that I can boot in many different computers. I would very much want it to be an ordinary writable system, so whatever I change when I have it booted in one computer will still be there when booted in another computer.
1) Most of the instructions I've seen for bootable USB are for methods that make a .iso image of Linux bootable from USB. I tried a couple of those methods and failed. I probably could sort out what I did wrong, but I'm more fundamentally confused about why it is commonly done that way?? I understand the usage of a USB stick instead of an installer DVD, if you want to install to a hard drive without burning a DVD or in a target computer without a DVD. In that usage, obviously making a .iso image on a USB bootable is best. But online info seems to suggest a bootable USB .iso approach even for a utility OS; WHY?? A utility OS on a DVD needs to be a bootable .iso image, so you have no choice but to deal with the extra layers of difficulty in customizing your utility OS (another area I've never quite figured out). But in a USB utility OS, it seems like doing an ordinary install onto the USB would make more sense. Then you can add or remove programs in the ordinary way as you customize your utility system. That is the method I got closer to working in my recent attempts.
What pros/cons of those approaches (.iso on a USB vs. ordinary install on a USB)?
2) Unlike a normal install, a utility OS potentially sees different hardware each time it boots. I know typical liveCD configurations of Linux deal with that well, and I have never understood a lot of the details of how that works. In my recent attempt, the eth0 device of the USB based system worked in the computer where I did the original install, but not in the next computer I tried that in. Did the Centos 6.4 installer I used customize something to the specific hardware it was run on? If so, what can I do to un-customize that so the system figures out at boot time what drivers it needs and loads them?
3) It is horribly slow. Maybe the freebie 8GB usb stick I used is junk. Maybe the USB ports on the old motherboard I was using are junk. Maybe a USB boot is inherently slow. But if it is something I did wrong, or a reason an ordinary Linux install is worse than a bootable .iso, I'd like to understand.
Before knowing the usb would be that slow, I decided against downloading and burning Centos 6.5, because I had a Centos 6.4 install DVD handy. So I installed 6.4 from DVD onto USB. Yesterday I started a yum update running and it is still running.
4) The ethernet driver for my son's ASRock Z97M Pro4 LGA 1150 Intel Z97 Micro ATX Intel Motherboard
http://www.newegg.com/Product/Product.aspx?Item=N82E16813157521
He has Windows 7 on the hard drive and has no DVD. I could boot my Centos 6.4 usb in that computer, but it then could not see any ethernet port (works fine in windows). It is wired ethernet. I've never seen a problem like that before. How do I get the correct driver onto the usb stick (while the stick is back in my own computer) and/or get it to load when the stick boots in my son's computer?
5) Partitioning and/or BIOS boot issue. The freebie USB stick has a tiny adware read-only partition, which Windows sees as D: and Linux sees as sdc sometimes and sdb sometimes and the bios sees as "8.09". It has a writable 8GB area, that I repartitioned as a single ext3 partition. Before that, Windows saw it as E:. Before or after that change, Linux saw it as sdb or sda and the BIOS as "8.08". I'm a bit confused why Windows sees the adware before the main partition, while Linux and BIOS see it after. I'm a bit confused why the same Linux system sometimes sees it as sda,sdb with the hard drive sdc and sometimes as sdb,sdc with the hard drive as sda.
But the important question is why I can't boot it directly in my own computer and how many other computers that will apply to and whether partitioning it differently would fix that.
The bios boot menu in my son's computer gives me choices for USB 8.08 and USB 8.09 when that stick is present. Selecting USB 8.08 works.
The same stick in my computer shows in Linux boot logs as being BIOS identified as 8.08 and 8.09. But my bios boot menu has no such choices. It lists:
USB floppy
USB zip
USB CDROM
USB hard drive
Selecting any of those instead boots the main hard drive.
I copied the GRUB commands from grub.conf on the USB to be an extra choice in grub.conf in my main Linux system, so I can indirectly boot the USB stick there. But that is not a great condition for a utility OS.
Do I need a FAT partition to make an old Gigabyte BIOS boot the USB stick? Or some other partitioning? Or is that BIOS simply unable to boot a USB stick?
6) syslinux vs. grub vs. legacy grub?
The two different sets of instructions I tried for putting a Centos 6 live image (not the installer image) onto a usb, each seemed to be internally inconsistent regarding syslinux vs. grub vs. legacy grub. IIUC, a default install of Centos 6 uses legacy grub. I think (may be misremembering) a Centos 6 liveDVD uses syslinux. The documented manual steps I followed were each inconsistent (as if someone changed their mind about which would be used and only changed half the steps) and resulted in a broken split between two of the above methods.
Which of those three should I use for a non .iso usb install of Centos 6? Which should I use if I go back to trying a .iso live image? What are the pros/cons? Which has the most compatibility across whatever computers I might try the utility OS in?
Last edited by johnsfine; 01-05-2015 at 10:54 AM.
|
|
|
01-05-2015, 01:45 PM
|
#2
|
LQ Guru
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 11,388
|
Quote:
But online info seems to suggest a bootable USB .iso approach even for a utility OS; WHY??
|
I don't see why it would make a difference other than the simple convenience, a flash drive is smaller and more convenient to carry around and can be modified.
Quote:
But in a USB utility OS, it seems like doing an ordinary install onto the USB would make more sense. Then you can add or remove programs in the ordinary way as you customize your utility system.
|
You can do that with a Live CD on a flash drive with persistence. With persistence, you can modify and save changes, even have a separate partition for data. I don't use CentOS so I don't know if that option is available. An actual install has different configuration files specific to the computer it was installed on for various hardware while the LiveCD looks for and detects hardware on whichever computer it boots on. Someone with a lot more knowledge than I have will be needed to explain how that works.
Checking the device name for a flash drive while booted from an installed system on your hard drive will show it as sdb, sdc, depending on how many drives are attached. Booting the flash drive will show itself as sda or (hd0) in Grub.
Most Linux distributions use syslinux to boot Live CDs, whether from a CD, DVD or flash drive. You can boot them with Grub Legacy or Grub2, the methods and menu entries are just different.
If you are using a full install of CentOS on the flash drive, probably best to stay with the defaul Grub Legacy bootloader. I did install CentOS 6.5 which still used Grub Legacy but 7.0 has apparently switched to Grub2.
If you want CentOS on a flash drive to use on different computers, the best way to do that is as a LiveCD iso with persistence so probably investigating if/how to do that.
|
|
|
01-05-2015, 02:39 PM
|
#3
|
LQ Addict
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841
|
What is the output of Also is the e1000 driver included if not you can download it from intel
Last edited by EDDY1; 01-05-2015 at 02:48 PM.
|
|
|
01-05-2015, 03:03 PM
|
#4
|
LQ Guru
Registered: Dec 2007
Distribution: Centos
Posts: 5,286
Original Poster
|
Quote:
Originally Posted by yancek
You can do that with a Live CD on a flash drive with persistence. With persistence, you can modify and save changes, even have a separate partition for data. I don't use CentOS so I don't know if that option is available.
|
I also don't know if/how to get persistence with a liveCD or liveDVD version of Centos.
My next attempt at all this (on my other 8GB USB stick) was the Centos 7 liveCD installed via "Universal USB Installer":
http://www.pendrivelinux.com/univers...easy-as-1-2-3/
I didn't understand that web page and thought the fact that it unpacks the .ISO into the usb file system meant that it was then an update-able copy on Linux. But apparently not. It seems to repack everything into a squashfs stored as a file on the usb. I don't know the pros/cons of that vs. approaches that put the .iso file on the usb. Seems to work about the same. It operates much faster, but it was different in so many ways I can't guess which made it faster: different usb stick, different (faster) computer, Centos 7 instead of 6.4, minimal liveCD tiny install vs. default desktop install, squashfs read only install vs. ordinary install.
Next, I will test that Centos 7 in the first two computers to see which of the earlier issues it resolves. Then I guess I need to erase and redo that one, because I need to add packages and have no clue how to do that to the scheme Universal USB Installer sets up.
Quote:
Originally Posted by EDDY1
What is the output of
Also is the e1000 driver included if not you can download it from intel
|
I looked at that first thing and have some other questions about it. I would have posted the text, but had no network interface
On the Centos 7 usb I just made, I figured out how to enable the ethernet. It seems to be off by default (but with a valid driver loaded) after each boot (on computer 3). I expect it will be the same on computer 2 (where the Centos 6.4 doesn't even load a driver). If so, I will soon be able to post that lspci easily. Otherwise I will use a cruder method to grab it.
Last edited by johnsfine; 01-05-2015 at 03:09 PM.
|
|
|
01-05-2015, 05:06 PM
|
#5
|
LQ Guru
Registered: Dec 2007
Distribution: Centos
Posts: 5,286
Original Poster
|
Centos 7 (non persistent) liveUSB now booted in my son's computer, which answers one of my questions about lspci
Code:
00:00.0 Host bridge: Intel Corporation 4th Gen Core Processor DRAM Controller (rev 06)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor PCI Express x16 Controller (rev 06)
00:14.0 USB controller: Intel Corporation Device 8cb1
00:16.0 Communication controller: Intel Corporation Device 8cba
00:19.0 Ethernet controller: Intel Corporation Ethernet Connection (2) I218-V
00:1a.0 USB controller: Intel Corporation Device 8cad
00:1b.0 Audio device: Intel Corporation Device 8ca0
00:1c.0 PCI bridge: Intel Corporation Device 8c90 (rev d0)
00:1c.3 PCI bridge: Intel Corporation 82801 PCI Bridge (rev d0)
00:1d.0 USB controller: Intel Corporation Device 8ca6
00:1f.0 ISA bridge: Intel Corporation Device 8cc6
00:1f.2 SATA controller: Intel Corporation Device 8c82
00:1f.3 SMBus: Intel Corporation Device 8ca2
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Hawaii PRO [Radeon R9 290]
01:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Device aac8
03:00.0 PCI bridge: ASMedia Technology Inc. ASM1083/1085 PCIe to PCI Bridge (rev 03)
My lspci question was why the AMD video listed just a hex code, rather than something like "Hawaii PRO [Radeon R9 290]" and in that case what online resource to use to translate it. The why part seems to be answered as something is obsolete within Centos 6.4. I'd still like the how to translate answer generally. I don't really want to translate the aac8 AMD audio, but it makes a nice example. If I did want to translate that how would I?
This Centos 7 liveUSB (created as described earlier) boots up every time with network disabled. So I need to go to Settings (from the gnome user menu on the top right) and select network, and select the interface and click Add Profile and select IPv4 (which defaults to dhcp) and click Add. Then I have network access. I sure would prefer a liveUSB that uses DHCP by default (has network as soon as it boots).
I hope I find my own post months from now when I use another Centos 7 liveCD and network needs to be started. The above set of steps was far from obvious to me and I will certainly forget the answer, while being frustrated that I know I solved the problem before and remember only the problem, not the solution.
If I end up with Centos 6.5, there is still the question of the driver for the ethernet listed above, which was apparently there in Centos 7 and not in 6.4 and I don't yet have an easy way to test 6.5
|
|
|
01-05-2015, 05:36 PM
|
#6
|
LQ Guru
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 11,388
|
Quote:
I also don't know if/how to get persistence with a liveCD or liveDVD version of Centos.
|
Found the link below at the CentOS site. No date on it so I don't know how recent it is. Much easier with Knoppix or Ubuntu derivatives.
https://projects.centos.org/trac/livecd/wiki/ImageFlash
|
|
|
01-06-2015, 12:50 AM
|
#7
|
Member
Registered: Aug 2010
Location: Brisbane, Australia
Distribution: Gentoo, Slackware, PCLOS, Debian
Posts: 230
Rep:
|
You're coming at a complex problem without understanding the underlying issues. Assuming that you're more interested in a solution than in the many hours of study needed to rectify your own shortcomings, try this:
http://www.sysresccd.org/SystemRescueCd_Homepage
|
|
|
01-06-2015, 06:37 AM
|
#8
|
LQ Guru
Registered: Dec 2007
Distribution: Centos
Posts: 5,286
Original Poster
|
Quote:
Originally Posted by tekra
You're coming at a complex problem without understanding the underlying issues.
|
I think I understand more of the issues than you give me credit for. But the parts I don't understand have not been easy to find with google searches.
Quote:
Assuming that you're more interested in a solution than in the many hours of study
|
Actually I rather understand the parts of this I don't understand and be able to make informed choices on each aspect myself, even though I expect that will take many more hours of study.
That shouldn't mean I can't ask questions where I get stuck.
I looked there again. I had read that in the past. It seems to be just another example of someone having done what I would like to do, but not flexibly enough that I could use what they did, nor explained enough that I could adapt it.
|
|
|
01-06-2015, 08:23 AM
|
#9
|
LQ Guru
Registered: Dec 2007
Distribution: Centos
Posts: 5,286
Original Poster
|
More self reminders in case I try this again months later (and/or anyone else finds this thread and tries some of it):
1) root=LABEL= did not work. The Centos 7 installer insanely used the parameter root=sdc2 on the kernel line in the /boot/grub2/grub.cfg file. But the partition won't be sdc2 when booted. So I tried root=LABEL= with the correct label. That failed. The boot up seems to look in /dev/disk/by-label before that directory even exists, and then (after booting correctly) neither by-label nor by-partlabel include the USB partitions. But at the moment it needs to resolve root= /dev/disk/by-uuid does exist and contains the usb partitions. So I edited grub.cfg again and used root=UUID= with the correct UUID. Need to later redo that correctly, editing the correct file in /etc/grub.d but before the system was even bootable, it was easier (on a different system) to edit grub.cfg.
2) Next time don't turn off kdump when prompted to do so during the first boot!!! I have made this mistake before and forgotten. That choice in Centos install from liveCD does not work right (at least for me). It messes up the rest of the first boot. In this minimal system I don't want kdump, but I can remove it later. I'd like to someday get through a first boot of Centos without failures.
Edit: Fixing the right /etc/grub.d file as I planned above would be way beyond my skill level in grub2's scripting language. This is what I really hate about grub2. But the fix from root=sdWRONG to root=UUID= wasn't really needed. I don't know why anaconda didn't use UUID, but the kernel update (which automatically modifies grub.cfg) uses UUID. Since only I and kernel updates will ever edit this, I can safely make that fix directly in grub.cfg the first time during an install and never fix anything for it in /etc/grub.d
The other thing I hand edited into grub.cfg was something that I soon figured out is easy to edit into /etc/default/grub as well (so subsequent automatic changes to grub.cfg won't lose it).
Last edited by johnsfine; 01-08-2015 at 11:42 AM.
|
|
|
01-06-2015, 08:23 AM
|
#10
|
Member
Registered: Nov 2013
Posts: 206
Rep:
|
PenDriveLinux.com is a good USB creator resource. I'll link directly to a good product among the many: http://www.pendrivelinux.com/liveusb...e-usb-creator/ ; also, unetbootin is popular.
Note that the usb drive should be mounted for the utility to see it.
I personally tend to use MultiSystem for larger USB sticks containing multiple ISO's. I used to simply add grub2 to a usb stick and manually edit menu.cfg to boot various .iso files, but that became cumbersome since OS specific configs became hard to find.
Last edited by sudowtf; 01-07-2015 at 10:50 AM.
|
|
1 members found this post helpful.
|
01-06-2015, 08:30 AM
|
#11
|
LQ Newbie
Registered: Feb 2013
Location: somewhere in Ohio
Distribution: UE 3.5 and ZorinOS8. W7 for Media Center only
Posts: 8
Rep: 
|
I suggest using LiLi (Linux Loader) Google it. Not all distro's will allow persistance. The installer you use should indicate that. If ou don't get an option of size of persistance file it won't allow. There are several options on the "PenDrive" site. I like "LiLi" for the GUI. It will let you know if you can set up a pers. file. You wont need grub and all that. You have to make sure the computer you use for Utility has the proper boot sequence in bios to boot a DVD or USB. If not it will keep booting the specified (in bios) hard drive. There are some programs that allow you to boot inside Windows using a Virtual Box front. You click on the drive and use "boot inside windows" option.
http://www.linuxliveusb.com/
It's a pretty simple process, just make sure the boot sequence of your "host" allows USB/DVD priority.
And yes USB drives are slower.
Most Ubuntu OS's allow persistance.
As someone noted UniBootin (sp) in Linux is also a good Live USB creator.
Last edited by madhank65; 01-06-2015 at 08:44 AM.
Reason: more info
|
|
|
01-08-2015, 11:31 AM
|
#12
|
LQ Guru
Registered: Dec 2007
Distribution: Centos
Posts: 5,286
Original Poster
|
In case anyone else cares about this sort of thing:
On my 8GB USB stick holding an ordinary desktop install of Centos 6.4 took over two days to complete, which resulted in Centos 6.6
Moving that back to my son's computer, which has (that I asked about earlier)
Code:
00:19.0 Ethernet controller: Intel Corporation Ethernet Connection (2) I218-V
That Ethernet then worked (it had not worked in the original Centos 6.4 install).
Last edited by johnsfine; 01-08-2015 at 11:32 AM.
|
|
|
01-08-2015, 01:29 PM
|
#13
|
Member
Registered: Apr 2012
Distribution: Gentoo
Posts: 616
Rep: 
|
I had the same issue in past. I tried a lot of tools to create bootable USB with Gentoo, none of them fit my requirements.
So I realized I have to do it on my own. I needed a system with a lot of tools that usually not presented at standard isos. Or they was configured in a way I can't use them without re-configuring.
So what I did exactly:
1. Install the base system with a software that may be needed somewhere at internal HDD.
2. Rebuit kernel. Since it should be bootable at different hardware, I used genkernel to built kernel with a lot of modules.
As well I enabled initramfs (though I usually do not use it) and few kernel options related to USB boot (ehci, generic usb) to get it bootable from USB drive. As well I got an ability to boot it by root=LABEL.
3. For this kernel I used sources with aufs patches. At first, to get system size as small as possible (to be able to fit it to small pen drive). At second, to be able to save changes to drive if I would need it.
4. Once new kernel was built I tested it, and continued with squashfs/aufs.
5. Built squashfs filesystems for /home, /root, /usr and /lib.
6. Added init script that mounts these filesystems as loop devices, then moves their content to tmpfs (partially) to get the system more faster. As well this script rebuilds this filesystems to reflect changes, if appropriate boot option was enabled.
7. Tested my system at internal HDD and moved it to external drive with rsync (excluding non-squashed /home, /root, /usr and /lib). Adjusted /etc/fstab and grub.cfg at external drive. Added rootwait parameter to be sure USB drive ready to mounted.
At first boot it started up with minor issue: only ethernet didn't start at different hardware. Fixed it by removing /etc/udev/rules.d/70-persistent-net.rules file. To be sure this file will not be recreated, made chattr +i /etc/udev/rules.d
That's all. Now I have three systems (I rsynced internal system to one USB HDD and two USB sticks). Tested it on a lot of different hardware, the only issue I was faced once - incorrect screen resolution at one of laptops.
Though it isn't a step-by-step instruction, hope it might give some clue where to go.
|
|
1 members found this post helpful.
|
01-10-2015, 05:09 PM
|
#14
|
Member
Registered: Nov 2012
Posts: 85
Rep: 
|
[QUOTE=johnsfine;5295660]I made a few tries at creating a Centos 6.5 bootable USB stick. I have several questions about that. ...
===============================
OK - #6 in this thread mentions Knoppix.
Download Knoppix for burning to CD. (The smaller file)
Burn it to a CD and boot the CD.
Have Knoppix make the bootable USB.
Won't hurt to make a couple of dupes of each.
Carry one of both. Use whichever you can and it will be seldom that you cannot do something useful,
including use the WiFi. Typical failures will concern hardware meltdowns. ie... nobody gets in.
I run Slackware and I follow my own advice.
OH -yeah! Make the sure the USB is as high a speed as exists for USBs.
Norseman01
|
|
|
All times are GMT -5. The time now is 05:45 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|