LinuxQuestions.org
Visit Jeremy's Blog.
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 03-27-2006, 06:22 AM   #1
insigniya
LQ Newbie
 
Registered: Mar 2006
Location: india
Distribution: Fedora
Posts: 5

Rep: Reputation: 0
how to save disk formatting data


when we format the hard-disk the information, regarding which sectors is where,gets stored on the disk(probably on the outer edge). this data is used to map the physical address to the actual position on the disk.
how to save this information in a file using linux?
 
Old 03-27-2006, 07:08 AM   #2
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,309

Rep: Reputation: 139Reputation: 139
The partition info is stored in the partition table of the hard drive mbr(master boot record) which is the first sector of every hard drive and 512 bytes in size. Here's a nice article on how to back up and restore the mbr:

http://wiki.linuxquestions.org/wiki/Using_Toms_floppy
 
Old 03-27-2006, 07:16 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
You are referring to partition tables. The first 512 byte sector contains the following:
master boot record: 446bytes of boot code
primary partition table: 64 bytes ( 4 entries, 16 bytes each)
"signature": 2 bytes (55aa hex)

If the disk has more than 4 partitions, then one of the primary entries will describe an "extended" partition. The partition tables for "logical partitions" ---which are tied to the extended partition---are elsewhere on the drive.

Here is a useful link:
http://www.ata-atapi.com/hiwtab.htm

To copy data like this, use the low-level routine--"dd" For example, to copy the first 512 byte sector described above:

dd if=/dev/hda of=<filename> bs=512 count=1 (assumes that your drive is hda)
 
Old 03-27-2006, 07:33 AM   #4
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 54
Cool

Quote:
Originally Posted by insigniya
when we format the hard-disk the information, regarding which sectors is where,gets stored on the disk(probably on the outer edge). this data is used to map the physical address to the actual position on the disk.
how to save this information in a file using linux?
fdisk -l > filename

for example:

fdisk -l > disk.info # creates output of fdisk report in file named disk.info
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
floppy only reads first disk, if new disk is inserted data from first disk is shown. lakosked Debian 3 02-18-2006 08:44 PM
Trying to save data using Ubuntu Distro Lefneer311 Linux - Newbie 15 11-27-2005 07:07 AM
*Please* help me save my data (test disk stuff) Dark Carnival Linux - General 1 02-12-2005 05:22 PM
How to save data in Bookmarks ? acrors Red Hat 2 08-19-2004 10:10 PM
ethereal save data to a file mssucks General 0 01-29-2002 02:04 PM


All times are GMT -5. The time now is 10:02 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration