LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-18-2006, 10:34 AM   #1
giulioudo
LQ Newbie
 
Registered: Jan 2006
Posts: 3

Rep: Reputation: 0
flash disk copy


Hi
I need to copy a bootable 2GB flash disk on witch I installed mandriva 2006, on another 2GB flash disk and the copy has to be bootable.
What I have done up to now is a non bootable copy.
Who can help me?
Thanks
 
Old 01-18-2006, 11:06 AM   #2
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,987

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
If the two flash drives are the same size you can use the dd command to make an exact sector by sector copy of the one flash drive on the other:

# dd if=/dev/sd* of=/dev/sd#

You must be root to run dd. The * should correspond to the device file for your initial flash drive, typically /dev/sda, and # should correspond to the device file of your second flash drive that you want to copy to, typically /dev/sdb. The numbering/lettering on your flash drives' device files will depend on the order in which you put them in the usb ports on most distros. Also, if you have any sata drives, they take up sdx numbering, i.e. the first sata drive is /dev/sda, so that will shift the first flash drive to /dev/sdb.

CAUTION: It is imperative that you get the device files right for your flash drives when using the above command. If your not sure how to do this, post back before trying to run the command.

At any rate, the dd command will work and the second flash drive will be bootable, just like the first.

Last edited by kilgoretrout; 01-18-2006 at 11:11 AM.
 
Old 01-18-2006, 02:33 PM   #3
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
Moved: This thread is more suitable in Linux-General and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 01-24-2006, 09:16 AM   #4
giulioudo
LQ Newbie
 
Registered: Jan 2006
Posts: 3

Original Poster
Rep: Reputation: 0
On my pc the flash disk is mapped on /dev/sdb1.
I insert the source flash disk in a Card Reader/Writer USB 2.0
connect the Card Reader/Writer USB 2.0 to a usb port on my pc
I type dd if=/dev/sdb1 of=/mycopy
when the dd command ends I take off the source flash disk and insert the destination flash disk (same geometry)
I tipe dd if=/mycopy of=/dev/sdb1
Anythig goes well, but the destination flash disk is not bootable yet.
Any suggestions ?
thanks
 
Old 01-24-2006, 12:32 PM   #5
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,987

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
Don't not use /dev/sdb1; use /dev/sdb instead.

Reason:

To boot anything you need a bootloader, a small program that resides on the master boot record(mbr) and communicates with systyem bios during boot.The mbr is just the first sector of the drive and 512 bytes in size on every hard drive. The partition table also resides on the mbr. The mbr is generally not accessable(i.e. it's not part of your partition) which is why copying over all the files from one drive to the other with normal commands won't work - they can't copy the mbr so you will have no bootloader on the second drive and thus, no booting.

The dd command operates at a very low level and makes a block by block exact copy of the drive but you have to tell it what to do properly. If you use /dev/sdb1, dd will just copy over sdb1 without the mbr; if you use /dev/sdb instead, dd will copy over every sector, including the mbr with its bootloader.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Make an exact copy of a compact flash card Pimple Linux - General 8 02-01-2006 11:37 AM
use dd to copy a disk ubuntu-norm Linux - Software 1 07-28-2005 02:43 PM
Exact Copy of Compact Flash Card Onyx^ Linux - Software 1 09-01-2004 04:30 AM
copy linux installation from old disk to new disk rmanocha Linux - Software 4 07-20-2004 06:21 AM
Disk copy bfloeagle Linux - Hardware 4 11-16-2002 05:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:29 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