LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-26-2011, 05:47 AM   #1
chamsky123
LQ Newbie
 
Registered: Jul 2008
Posts: 3

Rep: Reputation: 0
copy partition table ??


Hi guys ! I trying to copy the partition table of /dev/sdd into the new hard disk (/dev/sdi) ... How do I go about in doing that ??

Thanks !!!!


----------------

fdisk -l /dev/sdi

Disk /dev/sdi: 2000.3 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdi doesn't contain a valid partition table


----------------


fdisk -l /dev/sdd

Disk /dev/sdd: 2000.3 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdd1 1 249 2000000 82 Linux swap / Solaris
Partition 1 does not end on cylinder boundary.
/dev/sdd2 * 250 2432 17529856 fd Linux raid autodetect
/dev/sdd3 2432 243202 1933983744 fd Linux raid autodetect
 
Old 08-26-2011, 05:52 AM   #2
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
as root:
sfdisk --dump /dev/sdd | sfdump /dev/sdi

jlinkels
 
Old 08-26-2011, 04:46 PM   #3
rodrifra
Member
 
Registered: Mar 2007
Location: Spain
Distribution: Debian
Posts: 202

Rep: Reputation: 36
You could also use dd

dd if=/dev/sdd of=/dev/sdi bs=512 count=1
 
Old 08-26-2011, 07:44 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,140

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
The OP only wanted the partition table - copying the entire MBR could have (serious) unintended consequences. And is bad practice anyway IMHO.
@jlinkels answer is (far) better, although I prefer to direct the output to a file for checking prior to feeding back in.
 
Old 08-28-2011, 10:33 AM   #5
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,783

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
Plus, using dd to copy the first sector of the drive only includes the primary partition table. If there are any extended partitions on the drive, none of the logical partitions therein will be present on the destination drive.
 
  


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
what is dell utility partition on my harddisk partition table meant for sd|| Linux - Newbie 2 03-14-2010 09:13 AM
"No partition table or unknown signature on partition table" 10.1 install madcow007 Slackware 4 02-09-2009 11:04 AM
openSolaris hosed the partition table. Why? Changing primary to secondary partition? JZL240I-U Solaris / OpenSolaris 9 10-16-2008 10:48 AM
how to copy partition table from 1 hdd to another? turbokid Fedora 4 12-10-2004 03:04 PM
Slack 10: S-ATA = "No partition table or unknown signature on partition table"? dissolved soul Slackware - Installation 11 08-05-2004 02:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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