LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 02-23-2009, 02:18 AM   #1
edenCC
Member
 
Registered: May 2006
Location: China
Distribution: Debian
Posts: 198
Blog Entries: 1

Rep: Reputation: 32
howto dump partition table that larger than 2TB?


Hi, List;

As we know that, when a disk is *normal*, it's easy to backup its partition tables by sfdisk:

/sbin/sfdisk -d /dev/sdX > sdX.partion-table

when the partition is larger than 2TB, sfdisk cannot work properly, so how can I backup the partition table this time?
Is there anyone tried this?

Thanks & regards
joseph
 
Old 02-23-2009, 05:47 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
The partition table is only 64 bytes....if fdisk or sfdisk can't read the partition table for large partitions, you can always copy the partition table using dd. The will not get all the extended/logical partitions, however.

Main partition table (for the first hard disk):
dd if=/dev/sda of=PT.bak bs=1 skip=446 count=64

Extended and logical (if extended is sda4):
dd if=/dev/sda4 of=PT_ext.bak bs=1 skip=446 count=64
dd if=/dev/sda5 of=PT_L1.bak bs=1 skip=446 count=64
dd if=/dev/sda6 of=PT_L2.bak bs=1 skip=446 count=64
.
.
repeat as required.
This gives you the linked list for all the logical partitions

Hmmmmmm---someone must have written a script to automate this??
 
Old 02-23-2009, 10:25 AM   #3
CJS
Member
 
Registered: May 2008
Location: California, USA
Distribution: Ubuntu 8.10
Posts: 247

Rep: Reputation: 49
Quote:
Originally Posted by pixellany View Post
Main partition table (for the first hard disk):
dd if=/dev/sda of=PT.bak bs=1 skip=446 count=64

Extended and logical (if extended is sda4):
dd if=/dev/sda4 of=PT_ext.bak bs=1 skip=446 count=64
dd if=/dev/sda5 of=PT_L1.bak bs=1 skip=446 count=64
dd if=/dev/sda6 of=PT_L2.bak bs=1 skip=446 count=64
The partition table in each of the EBRs (Extended Boot Records) is not found at the beginning of the logical partition, so the commands above will not quite work. The EBRs are generally located 63 sectors before the start of the logical partitions, but that is not a hard rule, and there are many exceptions depending on how the extended partition is set up (including whether the logical partitions are in physical order or not). The bottom line is a MS-DOS partition table uses a 4 byte LBA word for the sector position of the partitions, so that means you are limited to a drive size of 2 TB:
Code:
4 bytes = 32 bits = 2^32 sectors = 4,294,967,296 sectors * (512 bytes/sector) = 2 TB
So if the drive is larger than 2 TB, one should not be using a standard MS-DOS partition table to begin with; you would have to use GPT or some other format that supports larger drives.
 
Old 02-23-2009, 11:28 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
OOOOOOOPS!!!!

I was in a hurry, and I could swear it worked when I tried it.

do fdisk /dev/sda, and then enter the "u" option to display by sector. Use those sector numbers with the dd command----You'll see a 63-sector gap in front of every logical partition. The "EBR" is in the sector after the end of each logical.

Me be more careful next time......
 
  


Reply

Tags
table



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
Core dump is larger than file space left on disk? goodkodiak Linux - Software 2 01-24-2009 12:06 AM
LXer: Linux Storage: Creating a Partition Size Larger than 2TB LXer Syndicated Linux News 0 11-06-2007 07:00 PM
Larger than 2TB volumes aforsyth1 Linux - Software 4 03-23-2005 07:05 AM
Dump filesystem table fransemail Linux - Software 6 08-18-2004 01:43 PM
file system size larger than fysical size:superblock or partition table corrupt klizon Linux - General 0 06-18-2004 04:18 PM

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

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