Printable Version of Topic
Click here to view this topic in its original format |
Scientific Linux Forum.org > How-to's / manuals / instructional manuals ONLY > How To Put a LiveCD/DVD To USB |
Posted by: AndrewSerk Feb 26 2012, 12:57 AM | ||||||||||||||||||||||||
How To Put a LiveCD/DVD To USB In this how to I will describe 4 methods that I use to put a livecd/dvd to USB. All of these methods will delete/destroy any data that is on your USB stick! 1. Using dd (IMMO this is the simplest, most reliable and my favorite) 2. By mounting a cd/dvd in a loop and copying the contents and installing grub 3. Using livecd-iso-to-disk (This method also works for install DVD's) 4. Using liveusb-creator The USB stick I will be using throughout this how to has a device location of /dev/sdc . It is very important that you determine the correct location of your USB stick and change /dev/sdc to the device location of your USB stick in each of the commands in this how to. Do not just copy past the commands in this how to as that could result in the wiping/overwriting/erasing of your hard drive/s. YOU HAVE BEEN WARNED! ![]() HOW TO DETERMINE THE DEVICE LOCATION OF YOUR USB STICK: There are several ways to determine the device location of your USB stick. I will describe a few here. Use the method that you are comfortable with: To determine the location of your USB stick from the command line use one of the following: The lsblk command returns a easy to read summery of the installed drives, there size, there device location and there mount locations if mounted, etc.
Fdisk is also able to list lots of disk info but requires root privileges:
The command blkid will list disk info along with the UUID number.
To determine the location of your USB stick using the disk utility palimpsest: Go Applications >> System Tools >> Disk Utility On the left hand side of the disk utility window there is a list of storage devices, locate the one that represents your USB stick and click on it. This will display the info for your USB stick on the right hand side of the disk utility window. The device location of the USB stick is displayed on the top right hand side of the disk utility window. Look for the line resembling “ Device: /dev/sdc “ . From this computer the USB device is located at /dev/sdc. Yours may be different and you will have to adjust the commands accordingly by replacing /dev/sdc with the location of your USB stick as shown by the info following the line “Device: in the disk utility window. Failing to do so may result in you wiping/overwriting/erasing your hard drive/s. 1. THE DD METHOD: This method works on just about all the available livecd/dvds. I have found this method to be the most reliable method. I have used this method with many different distros including SL, Debian, Fedora, Centos, opensuse, Ubuntu ect. Insert the USB stick, determine the device location using one of the above methods Unmount any mounted partitions that are mounted from the USB stick. (This can be achieved by right mouse clicking on the mounted partition/s on your desktop and selecting umount or opening the disk utility, clicking on your usb stick on the left hand side. Then click on the mounted partition on the right hand side and then click the unmount button. Or use the umount command from the command line) The nest step is to wipe the USB stick with the following command (make sure to change /dev/sdc to your usb stick's device location for all of the following commands):
Now to put the SL-62-i383-2012-02-16-LiveCD.iso to the usb stick. (Change path-to-iso to your real path to the iso file. ie. Something like /home/sluser/Downloads/SL-62-i383-2012-02-16-LiveCD.iso):
When the above command is finished you will have a bootable liveusb stick. 2. THE LOOP MOUNT, COPY AND INSTALL GRUB METHOD This method allows for multiple partitions, allowing you to have 2 or more operating systems on one usb stick or use one partition for storage and one for the operating system. I am using a 4gb USB stick. Insert the USB stick, determine the device location using one of the above methods Unmount any mounted partitions that are mounted from the USB stick. Using the disk utility, format the usb stick create a partition with the label “SL62” with the size equal to half the USB stick. create a second partition with the label “Data” the size being the other half of the USB stick. Mount the partition SL62 to the mount point /media/SL62 (you can just unplug and plugin the usb stick and it should mount both partitions for you in /media) Create a mount point for the iso:
Mount the livecd.iso and copy the data to the usb stick:
Install Grub on the USB stick:
Create a grub.conf file:
and add the following stanza to the grub.conf file:
and click save and close. Unmount/eject the USB stick. You now have a bootable usb stick with a data partition. Alternatively you could use the second partition for a second OS. 3. THE LIVECD-ISO-TO-DISK METHOD: I use this method to put a install dvd to usb for computers without cd/dvd drives. With this method you can put livecd/dvds to usb as well. Insert the USB stick, determine the device location using one of the above methods Unmount any mounted partitions that are mounted from the USB stick
Follow the onscreen instructions. For more info on this method see: http://www.livecd.ethz.ch/usbdisk.html#livecd-iso-to-disk 4. THE LIVEUSB-CREATOR METHOD: This method is also pretty easy and has built in functions to download a cd/dvd for you or use a iso that you have locally. Insert the USB stick, determine the device location using one of the above methods
Choose the target device, browse for a local iso or select one to download. Select persistent storage size if desired (this function does not always work) Click the Create Live USB button and follow the instructions in the box. For more info on this method see: http://www.livecd.ethz.ch/usbdisk.html https://fedorahosted.org/liveusb-creator/ Happy USB-ing ![]() |
Posted by: joutlan Feb 26 2012, 04:13 PM |
Thanks Andrew, nice contri ! ![]() |
Posted by: log69 Feb 26 2012, 05:26 PM | ||||
Great HowTo! One remark: instead of the dd command, I always use pv, so it prints a nice progress bar:
Also I found out that if I use dd with the sync flag to push out the blocks, then I get a 45% increase in speed. So I always use this method:
|
Posted by: log69 Feb 26 2012, 08:31 PM | ||
Another thing, just for the record if any non-expert user comes around: For me the only way to put the install DVD on my USB pendrive is to create an ext2 or 3 FS on the device without any partitions at all, and then use livecd-iso-to-disk to put the image on it. So in a couple of steps it looks like this:
Also, I use Ext instead of VFat here because the install DVD image is bigger than 4 GB which is the limit of the Fat32 FS. So that's the only way for me to be able to boot up the installer DVD from a USB drive. I didn't have any problem with the LiveCD or LiveDVD versions though. |
Posted by: AndrewSerk Mar 3 2012, 02:39 PM | ||||
Hi log69, That is why I use the directives " --format --reset-mbr" with the livecd-iso-to-disk command. If you use those directives you should not have to run a separate command to format, ect. Hope this helps, |
Posted by: log69 Mar 3 2012, 06:42 PM | ||
Hi Andrew, You are absolutely right. I don't know how I overcame those options you specified above, but now I tested your way and it definitely works just great! It reformatted an already setup partitions on my pendrive and made everything as needed. So thanks for the correction! ![]() |
Posted by: feedmebits Mar 3 2012, 09:54 PM |
Never tried some of the ones mentioned here. I always use unetbootin and liveusb-creator. Never had any problems with them. Will try them out sometime ![]() |
Posted by: log69 Mar 3 2012, 10:20 PM | ||
Both of them work for LiveCD and LiveDVDs, but they don't work for me for the installers. |
Posted by: Nathan Mar 4 2012, 04:25 PM |
I always use dd. No idea why so many places list it as a 'dangerous' method, if you just follow the steps provided you won't ever run into any problems with wiping your entire hard drive or whatever. |
Posted by: feedmebits Mar 5 2012, 10:25 AM | ||||
Now that you mention that I never was able to install even when making a bootable usble from the norma install iso. I did try DDing once like how they have it in the redhat docs, but never gat that to work. Will try it another time again |
Posted by: log69 Mar 5 2012, 11:41 AM | ||
It does work though with method 3 described in the first post. |
Posted by: feedmebits Mar 5 2012, 12:02 PM |
Will try it out as soon as I have time and let you know |
Posted by: feedmebits Mar 5 2012, 07:28 PM |
Works great! thanks! ![]() |
Posted by: raul_l Apr 25 2012, 11:03 AM | ||||
Thank you for the instructions. I have a laptop with no optical drive and used method 3 to install from Install-DVD. As long as the USB device is connected I can boot to SL. However, if I remove the USB device I can't boot and get the error
I think the problem is that grub gets installed onto the USB device, which is an older laptop hard drive mounted in an external hdd enclosure. During installation this is what my partitioning setup looks like:
In the next step I have to choose where to install the boot loader. If I choose /dev/sdb instead of /dev/sda (which is the usb device) the system won't boot (because then what's currently sdb becomes sda). How to solve this? As I understand the usb device is detected first and gets the label sda1. Perhaps there's some way to make the internal hdd be detected first? I have no such problems with my desktop computer which has an optical drive. |
Posted by: AndrewSerk Apr 25 2012, 02:02 PM | ||
Hi raul_l, If looks like you have a window install on your internal hd. Is that correct? If correct you may want to try to install grub at the beginning of sdb3 " / " . Then use a chainloader to boot windows. If you find you still need help, copy/past what each of these commands return and I or someone else will try to help.
Hope this helps |
Posted by: raul_l Apr 25 2012, 05:10 PM | ||||||||||||||||
If I install grub to sdb3 I get the same error
without the USB hdd and if the USB device is connected I see the Install-DVD welcome menu. If I choose "Boot from local drive" I get
SL doesn't boot now but using the rescue mode I get bash-4.1# lsblk
bash-4.1# df
bash-4.1# cat /mnt/sysimage/boot/grub/grub.conf
If the bootloader is installed to sda1 (with USB hdd connected, see earlier post) I get [raul@x220 ~]$ lsblk
[raul@x220 ~]$ df
[raul@x220 ~]$ su -c 'cat /boot/grub/grub.conf'
I also have Windows 7 installed if that's what you meant (else I don't know the term "window install"). But I don't think that would complicate anything. On my desktop computer I have windows, ubuntu and SL running with no problems. |
Posted by: AndrewSerk Apr 25 2012, 06:15 PM | ||||||
Looks like you need to edit grub.conf to use your internal drive after removing your usb drive, from:
To:
You may need to change the above to get windows to boot to:
Hope this helps, |
Posted by: raul_l Apr 25 2012, 09:07 PM | ||
I tried that, didn't work. I also tried to fix the MBR using Boot-Repair from Ubuntu live-usb https://help.ubuntu.com/community/Boot-Repair. That allowed me to boot directly into Windows so at least something boots without the usb drive. However, if I set the option "Partition booted by the MBR: sda3 (Scientific Linux release 6.2)" in Boot-Repair I get
I wonder if there are any tools on SL live-dvd that could fix grub? I would put the live-dvd onto my 3.7 gb usb stick (not hdd) and there shouldn't be any trouble with partitioning as above. If all else fails I will purchase a larger usb stick for the Install-DVD. |
Posted by: raul_l Apr 25 2012, 09:34 PM |
It worked! I followed the instructions from http://www.sorgonet.com/linux/grubrestore/ and restored grub using the Live-DVD. Now both Windows and SL boot normally. |
Posted by: AndrewSerk Apr 25 2012, 10:43 PM |
Glad you were able to get things going! ![]() |
Posted by: neocronomican May 2 2012, 03:08 PM |
Is there any look like The 3rd method (LIVECD-ISO-TO-DISK METHOD) run in Windows 7 system? I have 2 dvd installer and want to make SL 5.8 installer from USB (my server doesnt have dvd drive).... |
Posted by: AndrewSerk May 2 2012, 07:59 PM | ||
Hi neocronomican and welcome to SLF, I don't know of a livecd-iso-to-disk version for Windows but I am not very familiar with Windows. You may be able to boot a livecd and run it from there. Andrew |
Posted by: neocronomican May 3 2012, 06:24 PM | ||
Hi Andrew, thanks for you respond... I have try ISO2USB tools, SL install process work smoothly but it fails when after first reboot (after install process done)... The problem because GRUB always install in /dev/sdb (USB Flashdisk), there is no option to install GRUB in /dev/sda... I am need Grub because I will you dual OS.. Do you know another tools(on windows) to make SL USB Installer? |
Posted by: tux99 May 3 2012, 06:59 PM |
I'm not sure if this is what you are looking for: http://www.pendrivelinux.com/ |
Posted by: AndrewSerk May 3 2012, 07:01 PM |
Hi neocronomican, You could boot the install DVD in rescue mode or from a livecd and use the "grub-install" script to install grub where you want it. Here is a link to a CentOS guide for re-installation of grub, the process is the same for SL: http://wiki.centos.org/TipsAndTricks/ReinstallGRUB Hope this helps, |
Posted by: neocronomican May 4 2012, 05:03 PM | ||||
Have you try that tools dude? Please share me if you have success story using that tools...
okey i will try it latte Andrew, thankyou |
Posted by: neocronomican May 5 2012, 06:02 PM |
UPDATE SUCCESS!!! Hi Andrew, your tips to recover GRUB Success Perfectly, So If you want to create Scientific Linux USB-Installer, you need : 1. Use at least flashdisk 8GB with FAT32 2. download ISO2USB (http://iso2usb.sourceforge.net/) 3. download all of Scientific Linux CD ISO (NOT DVD), there is 9 CD. This is the process that I have done : 1. Create the SL-USB-installer use ISO2USB (Diskimage = CD1, Addtional File = /folder/that/you/save/CD2-CD9/iso) 2. Reboot your system and choose first booting from SL-USB-Installer 3. Install you Scientific Linux. - When there is some media installer question just answer sourceinstaller = Hardisk, then Partion Contain Image is (/dev/sdb1) 4. After Installation Done reboot your system (first boot still form SL-USB Installer) 5. Recovery GRUB - after installation finish, you cant boot using your fresh Scientific Linux, there is a problem if you use SL USB-Installer as source, then by default GRUB always install in SL USB-Installer drive (/dev/sdb1)... So we need to fix your GRUB. - to fix GRUB, you should boot from you SL-USB Installer again and then do Andrew tricks http://wiki.centos.org/TipsAndTricks/ReinstallGRUB - in my system, my fresh install Scientific Linux is on /dev/sda and SL-USB Installer on /dev/sdb... So to fix the GRUB in rescue terminal I write "grub-install /dev/sda1" - after you done fix GRUB to /dev/sda, reboot your system and boot from your fresh Scientific Linux drive. 6. Reboot and Boot From Your Fresh Scientific Linux Drive * If your GRUB stuck because GRUB cant find hd(1,0) then in GRUB MENU just edit your GRUB in from hd(1,0) --> hd(0,0)... and continue boot process. ** If this condition (*) happen, after you login to system as root, please edit /etc/grub.conf and change all of hd(1,0) to hd (0.0)... In this test I use : 1. ISO2USB v 0.7 2. Scientific Linux 5.7 CD1-9 ISO X86_64 3. Kingstone 8GB Flashdisk |
Posted by: AndrewSerk May 6 2012, 04:50 AM |
Hi neocronomican, Glad it worked and thanks for posting your observations. ![]() Andrew |
Posted by: peterlscott Jan 30 2014, 08:24 PM |
Andrew, these are excellent instructions. The "dd" method worked well for me when there was a single CD or DVD, such as for SL's Live CD iso. But a normal install of SL-6.x has two DVDs. Do I need a second usb stick? Or is it possible to put both DVD1 and DVD2 isos on a single stick? Any suggestions? My DRW is not working. Thanks so much, -- Peter |
Posted by: World Domination Studios Aug 16 2017, 04:30 PM |
Linux Live USB Creator hasn't been updated for many years, and it doesn't have the install parameters for any version of SL more recent than 6.2 This guide should be updated to suggest a similar but more up-to-date tool for any Windows users who wish to create LiveUSB sticks, or any kind of bootable Linux stick. Advice on which ISO files to use, or which ones work with which USB-creation methods, would also be helpful. |