LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 05-21-2009, 10:22 AM   #1
Completely Clueless
Member
 
Registered: Mar 2008
Location: Marbella, Spain
Distribution: Many and various...
Posts: 899

Rep: Reputation: 70
Question Hidden data between MBR and first partition?


Hi all,

There's an option box to check in the Clonezilla backup disk to save what is described as the "hidden data between MBR and first partition?" At the risk of appearing ignorant (not something that's ever bothered me here) what exactly is the nature of this so-called "hidden data" and how much space does it take up?

tia,

cc.
 
Old 05-22-2009, 12:10 AM   #2
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Rep: Reputation: 137Reputation: 137
Quote:
Originally Posted by Completely Clueless View Post
Hi all,

There's an option box to check in the Clonezilla backup disk to save what is described as the "hidden data between MBR and first partition?" At the risk of appearing ignorant (not something that's ever bothered me here) what exactly is the nature of this so-called "hidden data" and how much space does it take up?

tia,

cc.
In some sense the unit HDD are "built" from is cylinder.
On each disk (or using fdisk command) you can see how many cylinders disk has.

MBR is sector 0 in cylinder 0.
Any partition is start (and end) on the cylinder boundary.
So, even if your first partition started in the cylinder 1,
all but sector 0 if the cylinder 0 are lost. Or hidden.
if your first partition started from say cylinder 10, then all data in the cylinders 1-9 will be lost/hidden too
 
Old 05-22-2009, 12:35 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,119

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
To be more specific, there are 62 sectors between the MBR and the first partition. Yes, that's a "track" worth, not a cylinder worth on modern disks, but sector 63 is considered the start of cylinder 1. And for a "classic DOS-style" partition table, the first partition needs to start here for historical reasons.
lilo has saved data into the sector(s) following the MBR for ages - grub also often uses them now (any boot virus worth the name would also use these sectors).
 
Old 05-22-2009, 05:26 AM   #4
Completely Clueless
Member
 
Registered: Mar 2008
Location: Marbella, Spain
Distribution: Many and various...
Posts: 899

Original Poster
Rep: Reputation: 70
Lightbulb

Quote:
Originally Posted by syg00 View Post
To be more specific, there are 62 sectors between the MBR and the first partition. Yes, that's a "track" worth, not a cylinder worth on modern disks, but sector 63 is considered the start of cylinder 1.
So is this first "track" known as "track 0"? In Acronis, there's a puzzling option which refers to saving the data in "track 0" so that refers to the first 62 sectors which obviously includes the MBR in sector 1?

Another thing: I believe there's the so-called 'magic number' (x0055 if I recall correctly) which signifies the end of the MBR. Is there a similar signature for the start of the first partition or is its start position simply 'taken for granted' by the O/S?
 
Old 05-22-2009, 07:19 AM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
I have wondered myself if this area was used by some copy protection schemes. In Linux & XP, you can pretty much bank that the first partition will start on sector 63 (512 bytes * 53). You can use this to mount the first partition of an drive image backup:
losetup -fs imagefile.img -o $((512*53))
And this may come in handy if you accidently ruined your MBR partition table.

My toshiba laptop starts the first partition at 2046 for some reason. I don't know if this is Toshiba's doing or has to do with Vista.

Also keep in mind that there are other partition schemes. You might want to look up MBR in Wikipedia if you want to further your knowledge.
 
Old 05-22-2009, 07:50 AM   #6
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
The area in the first 63 sectors can be used for other boot code, also. For example, I think GRUB puts stage 1.5 and 2 in the area after the MBR. In any case, you do not need to back up areas outside the partitions.

I don't think partitions start or end with any signatures or "magic numbers". The partition table tells the system where they are.

And what is the purpose of the MBR "signature" (0x55AA)? I have no clue.
 
Old 05-22-2009, 08:31 AM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,119

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
The signature indicated a valid disk. Earlier versions of [cs]fdisk would refuse to open a disk that lacked these bytes. Maybe the DOS fdisk as well, I don't know.

These bytes exist in the first sector of (each) logical partition as well BTW.
 
Old 05-22-2009, 09:31 AM   #8
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by syg00 View Post
These bytes exist in the first sector of (each) logical partition as well BTW.
Right!! Because an extended partition--and each logical partition--are part of a linked list in which each one has a partition table. In a sense, each logical partition is structured as a disk.
 
Old 05-23-2009, 06:54 AM   #9
Completely Clueless
Member
 
Registered: Mar 2008
Location: Marbella, Spain
Distribution: Many and various...
Posts: 899

Original Poster
Rep: Reputation: 70
Quote:
Originally Posted by pixellany View Post
Right!! Because an extended partition--and each logical partition--are part of a linked list in which each one has a partition table. In a sense, each logical partition is structured as a disk.
Indeed. And likewise, there's a /boot/grub directory in every Linux partition that uses Grub, each with its own menu.lst file! My main desktop runs 5 different distros and unfortunately, the Grub auto config routine of the latest install all too often incorrectly re-writes/augments the prior-existing menu.lst entries, giving rise to boot menu nightmares.

I've also had it so when I change the "default 0" to "default 7" to boot from sda8 instead of sda1, Grub ignores it and still boots the first partition regardless. Anyone else had this?
 
Old 05-23-2009, 07:04 AM   #10
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,119

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Quote:
Originally Posted by Completely Clueless View Post
Indeed. And likewise, there's a /boot/grub directory in every Linux partition that uses Grub, each with its own menu.lst file! My main desktop runs 5 different distros and unfortunately, the Grub auto config routine of the latest install all too often incorrectly re-writes/augments the prior-existing menu.lst entries, giving rise to boot menu nightmares.
Maybe you should set up a "master" system, and only install grub on the later systems to the root partition - then chainload them all.
Or use something like gag which does the same thing.
Quote:
I've also had it so when I change the "default 0" to "default 7" to boot from sda8 instead of sda1, Grub ignores it and still boots the first partition regardless. Anyone else had this?
This has nothing to do with the partitions, merely the entries in the boot menu (count the "title" lines).
 
Old 05-23-2009, 08:33 AM   #11
Completely Clueless
Member
 
Registered: Mar 2008
Location: Marbella, Spain
Distribution: Many and various...
Posts: 899

Original Poster
Rep: Reputation: 70
Well I'm posting my menu.lst file herewith. Let's face it: we can all use a laugh now and again. If anyone has a longer and/or more confusing one, I'd like to see it. Perhaps we could start a competition!


Code:
# menu.lst - See: grub(8), info grub, update-grub(8)
#            grub-install(8), grub-floppy(8),
#            grub-md5-crypt, /usr/share/doc/grub
#            and /usr/share/doc/grub-legacy-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not change this entry to 'saved' or your
# array will desync and will not let you boot your system.
default		0

## Graphical boot menu location
gfxmenu=/boot/gfxmenu/default.message

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout		10

# Pretty colours
color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line)  and entries protected by the
# command 'lock'
# e.g. password topsecret
#      password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title		Windows 95/98/NT/2000
# root		(hd0,0)
# makeactive
# chainloader	+1
#
# title		Linux
# root		(hd0,1)
# kernel	/vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
##      kopt_2_6_8=root=/dev/hdc1 ro
##      kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=/dev/sda1 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,0)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
##      alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
##      lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
##      lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
##      altoptions=(single-user) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
##      howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
##      memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

title		Linux Mint x64 Edition, kernel 2.6.27-7-generic
root		(hd0,0)
kernel		/boot/vmlinuz-2.6.27-7-generic root=/dev/sda1 ro quiet splash 
initrd		/boot/initrd.img-2.6.27-7-generic
quiet

title		Linux Mint x64 Edition, kernel 2.6.27-7-generic (recovery mode)
root		(hd0,0)
kernel		/boot/vmlinuz-2.6.27-7-generic root=/dev/sda1 ro single
initrd		/boot/initrd.img-2.6.27-7-generic

title		Linux Mint x64 Edition, memtest86+
root		(hd0,0)
kernel		/boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title		Other operating systems:
root


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/sda5.
title		Debian GNU/Linux, kernel 2.6.26-1-amd64 (on /dev/sda5)
root		(hd0,4)
kernel		/boot/vmlinuz-2.6.26-1-amd64 root=/dev/sda5 ro quiet 
initrd		/boot/initrd.img-2.6.26-1-amd64
savedefault
boot


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/sda5.
title		Debian GNU/Linux, kernel 2.6.26-1-amd64 (single-user mode) (on /dev/sda5)
root		(hd0,4)
kernel		/boot/vmlinuz-2.6.26-1-amd64 root=/dev/sda5 ro single 
initrd		/boot/initrd.img-2.6.26-1-amd64
savedefault
boot


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/sda6.
title		Slackware Linux (Slackware 12.2.0) (on /dev/sda6)
root		(hd0,5)
kernel		/boot/vmlinuz-generic-2.6.27.7 root=/dev/sda6 
savedefault
boot


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/sda6.
title		Slackware Linux (Slackware 12.2.0) (on /dev/sda6)
root		(hd0,5)
kernel		/boot/vmlinuz-generic-smp-2.6.27.7-smp root=/dev/sda6 
savedefault
boot


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/sda6.
title		Slackware Linux (Slackware 12.2.0) (on /dev/sda6)
root		(hd0,5)
kernel		/boot/vmlinuz-huge-2.6.27.7 root=/dev/sda6 
savedefault
boot


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/sda6.
title		Slackware Linux (Slackware 12.2.0) (on /dev/sda6)
root		(hd0,5)
kernel		/boot/vmlinuz-huge-smp-2.6.27.7-smp root=/dev/sda6 
savedefault
boot


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/sda7.
title		MEPIS at sda7, newest kernel (on /dev/sda7)
root		(hd0,6)
kernel		/boot/vmlinuz root=/dev/sda7 nomce quiet splash vga=791 
initrd		/boot/initrd.img
savedefault
boot


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/sda7.
title		MEPIS at sda7, kernel 2.6.27-1-mepis-smp (on /dev/sda7)
root		(hd0,6)
kernel		/boot/vmlinuz-2.6.27-1-mepis-smp root=/dev/sda7 nomce quiet splash vga=791 
initrd		/boot/initrd.img-2.6.27-1-mepis-smp
savedefault
boot


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/sda7.
title		PClinuxOS on sda1 (on /dev/sda7)
root		(hd0,6)
kernel		/boot/vmlinuz BOOT_IMAGE=linux root=UUID=ade8b470-f9a1-4063-b93f-7dd4b6fec99f acpi=on resume=UUID=c25c21be-57df-42ad-9aaf-f4636247c3e3 splash=silent vga=788 
initrd		(hd0,0)/boot/initrd.img
savedefault
boot


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/sda7.
title		MEMTEST (on /dev/sda7)
root		(hd0,6)
kernel		/boot/memtest86+.bin  
savedefault
boot


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/sda8.
title		Linux Mint x64 Edition, kernel 2.6.27-7-generic (on /dev/sda8)
root		(hd0,7)
kernel		/boot/vmlinuz-2.6.27-7-generic root=/dev/sda8 ro quiet splash 
initrd		/boot/initrd.img-2.6.27-7-generic
savedefault
boot


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/sda8.
title		Linux Mint x64 Edition, kernel 2.6.27-7-generic (recovery mode) (on /dev/sda8)
root		(hd0,7)
kernel		/boot/vmlinuz-2.6.27-7-generic root=/dev/sda8 ro single 
initrd		/boot/initrd.img-2.6.27-7-generic
savedefault
boot


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/sda8.
title		Linux Mint x64 Edition, memtest86+ (on /dev/sda8)
root		(hd0,7)
kernel		/boot/memtest86+.bin  
savedefault
boot
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Compaq hidden partition help crimsonkil Linux - Newbie 2 02-09-2007 08:31 PM
a hidden linux partition adilturbo Linux - General 8 11-21-2006 07:23 PM
hidden dos partition svar Linux - General 2 09-19-2003 08:06 AM
Problems with php 4.2.1 form-data and hidden variables coea77 Programming 1 10-10-2002 03:24 AM
Hidden Partition Reno Linux - Software 2 05-04-2001 01:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 08:58 PM.

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