LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-16-2008, 04:21 PM   #1
hpnoobs
LQ Newbie
 
Registered: Sep 2008
Posts: 2

Rep: Reputation: 0
Clone Linux Bootable USB Flash Drive


I have just created a SLES 10 SP2 bootable USB flash drive. However, I still need to clone it to another flash drive of the same size. I have tried using both:

dd if=/dev/sda of=/dev/sdb bs=32768 count=262144
dd if=/dev/sda of=/dev/sdb bs=32768

Although the clone does seem to have at least some of the original files, I am unable to ascertain if everything is being copied. The clone definitely does not function as a bootable live linux device. It only makes it half way through the boot process before giving the following error:

Attached scsi generic sg0 type0 not found -- exiting to /bin/sh

How do I make other USB flash drives bootable using the exact same image of the first? Thank you in advance.

~hpnoob
 
Old 09-16-2008, 04:24 PM   #2
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
Try copying all files the normal way (cp -a) then install the bootloader.

Also inspect the initrd image - the scripts may be identifying the USB gizmo via UUID or something.
 
Old 09-17-2008, 02:17 PM   #3
hpnoobs
LQ Newbie
 
Registered: Sep 2008
Posts: 2

Original Poster
Rep: Reputation: 0
Here is a bump...still need help with this. =)
 
Old 09-17-2008, 09:38 PM   #4
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
OK, do something like this:

1. fdisk /dev/your_usb_stick
Now partition your USB stick and format the partition

2. copy files:
mount /dev/your_usb_stick /mnt
cp -a /path/to/your/other/installation/* /mnt/.

3. install the bootloader (assuming it's GRUB):
echo "(hd1) /dev/sdc" > mydev.map (or sdb or whatever the device name is for your TARGET USB stick)
umount /mnt (unmount the USB stick that will have its bootloader written)
./grub --batch --device-map=./mydev.map <<EOF >grub.log
setup (hd1) (hd1,0)
quit
EOF

That tells grub to install to (hd1) and to look for the grub files on (hd1,0). In this example, 'mydev.map' says (hd1) is /dev/sdc. The map file you use to install GRUB does not have to be the same as the map file used when GRUB boots.

That copied USB stick should boot now (if everything went well). Keep an eye on the boot information for clues on what went wrong if it doesn't boot.

If you get the same bad results as with 'dd' then there is something going on with the boot sequence and we'll have to look at things in more detail.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
bootable USB flash drive with FEDORA core3 abhi9 Linux - Newbie 1 07-02-2008 04:36 AM
bootable live Linux on USB flash drive james2b Linux - General 3 03-03-2008 02:08 AM
Linux on 2GB (or 4GB) external USB Flash Drive (Stick) [Bootable / Expandable] phi DamnSmallLinux 3 04-17-2007 01:27 AM
How to create bootable USB flash drive EStester Linux - Enterprise 7 05-19-2005 06:35 PM
Install MandrakeLinux with bootable USB Flash Drive lothario Mandriva 1 12-10-2004 09:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:21 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration