public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* fdisk: What do plus signs after "Blocks" mean?
@ 2005-07-12 16:35 Konstantin Kudin
  2005-07-12 17:37 ` DervishD
  0 siblings, 1 reply; 13+ messages in thread
From: Konstantin Kudin @ 2005-07-12 16:35 UTC (permalink / raw)
  To: linux-kernel

 Hi there,

 Fdisk on my machine displays the output shown below. Many partitions
have pluses after "Blocks". The issue is that during installation on
the existing linux setup WinXP screwed up the partition table, and
these pluses were very difficult to recreate. Basically, if I remove
hda9, and then try to recreate it in fdisk, it loses the plus sign and
does not look as before. Also, sometimes fdisk creates a partition with
"+", and sometimes it does not.

 Since I did not want to take any chances, I used Knoppix to read a
similar partition table from /dev/hdb using "sfdisk -dx", and then
copied it to /dev/hda by using "sfdisk -fx". If I do not force sfdisk
by using "-f", it complains that there are some inconsistencies.

 Can anyone enlighten me what the pluses mean? Also, if a partition
loses pluses after "Blocks", would that destroy a RAID array?

 Thanks!
 Konstantin



#################
fdisk -l /dev/hda

Disk /dev/hda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1           3       24066    7  HPFS/NTFS
/dev/hda2               4       19457   156264255    5  Extended
/dev/hda5               4         264     2096451   82  Linux swap
/dev/hda6             265        2176    15358108+  fd  Linux raid
autodetect
/dev/hda7            2177        4088    15358108+   7  HPFS/NTFS
/dev/hda8            4089        7912    30716248+  fd  Linux raid
autodetect
/dev/hda9            7913       19457    92735212+  fd  Linux raid
autodetect



		
____________________________________________________
Sell on Yahoo! Auctions – no fees. Bid on great items.  
http://auctions.yahoo.com/

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: fdisk: What do plus signs after "Blocks" mean?
  2005-07-12 16:35 fdisk: What do plus signs after "Blocks" mean? Konstantin Kudin
@ 2005-07-12 17:37 ` DervishD
  2005-07-12 20:19   ` Horst von Brand
  0 siblings, 1 reply; 13+ messages in thread
From: DervishD @ 2005-07-12 17:37 UTC (permalink / raw)
  To: Konstantin Kudin; +Cc: linux-kernel

    Hi Konstantin :)

 * Konstantin Kudin <konstantin_kudin@yahoo.com> dixit:
>  Can anyone enlighten me what the pluses mean?

    It is commented in the README.fdisk file in util-linux
distribution: the '+' flag means that the partition has an odd number
of sectors. That means that you can waste a sector at the end of the
partition, and it's very common for the first partition in the disk
if it ends on a cylinder boundary and cylinders have an even number
of sectors, due to the MBR.

    Harmless.

> Also, if a partition loses pluses after "Blocks", would that
> destroy a RAID array?

    I don't have any idea :? To reproduce a '+' in a partition, you
probably have to specify partition size in sectors (or kilobytes,
whatever fits you better) and make it odd, honoring exactly the
number of sectors that partition had (before the parttable was
destroyed by our dear friend XP).

    It's a good idea to have a copy of the partition table around, if
it is not simple (the one you had is NOT simple).

    Hope that helps.

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
http://www.pleyades.net & http://www.gotesdelluna.net
It's my PC and I'll cry if I want to...

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: fdisk: What do plus signs after "Blocks" mean?
  2005-07-12 17:37 ` DervishD
@ 2005-07-12 20:19   ` Horst von Brand
  2005-07-12 20:48     ` Konstantin Kudin
  2005-07-13 12:13     ` DervishD
  0 siblings, 2 replies; 13+ messages in thread
From: Horst von Brand @ 2005-07-12 20:19 UTC (permalink / raw)
  To: Konstantin Kudin, linux-kernel

DervishD <lkml@dervishd.net> wrote:

[...]

>     It's a good idea to have a copy of the partition table around, if
> it is not simple (the one you had is NOT simple).

Be careful. What you'll get out of backing up the partition table is /only/
the primary partitions, the others are handled by a weird russian doll of
partitions-inside-partitions. AFAIR, the details were in the LILO docu.
-- 
Dr. Horst H. von Brand                   User #22616 counter.li.org
Departamento de Informatica                     Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria              +56 32 654239
Casilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: fdisk: What do plus signs after "Blocks" mean?
  2005-07-12 20:19   ` Horst von Brand
@ 2005-07-12 20:48     ` Konstantin Kudin
  2005-07-13 10:24       ` Jan Engelhardt
  2005-07-13 12:14       ` DervishD
  2005-07-13 12:13     ` DervishD
  1 sibling, 2 replies; 13+ messages in thread
From: Konstantin Kudin @ 2005-07-12 20:48 UTC (permalink / raw)
  To: Horst von Brand, lkml, linux-kernel



--- Horst von Brand <vonbrand@inf.utfsm.cl> wrote:

 Guys, thanks a lot for the explanations!

 Actually, it seems like one can backup information on ALL partitions
by using the command "sfdisk -dx /dev/hdX". Supposedly, it reads not
only primary but also extended partitions. "sfdisk -x /dev/hdX" should
be then able to write whatever is known back to the disk.

 Konstantin



> DervishD <lkml@dervishd.net> wrote:
> 
> [...]
> 
> >     It's a good idea to have a copy of the partition table around,
> if
> > it is not simple (the one you had is NOT simple).
> 
> Be careful. What you'll get out of backing up the partition table is
> /only/
> the primary partitions, the others are handled by a weird russian
> doll of
> partitions-inside-partitions. AFAIR, the details were in the LILO
> docu.
> -- 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: fdisk: What do plus signs after "Blocks" mean?
  2005-07-12 20:48     ` Konstantin Kudin
@ 2005-07-13 10:24       ` Jan Engelhardt
  2005-07-14 13:50         ` kernel
  2005-07-13 12:14       ` DervishD
  1 sibling, 1 reply; 13+ messages in thread
From: Jan Engelhardt @ 2005-07-13 10:24 UTC (permalink / raw)
  To: Konstantin Kudin; +Cc: Horst von Brand, lkml, linux-kernel


> Guys, thanks a lot for the explanations!
>
> Actually, it seems like one can backup information on ALL partitions
>by using the command "sfdisk -dx /dev/hdX". Supposedly, it reads not
>only primary but also extended partitions. "sfdisk -x /dev/hdX" should
>be then able to write whatever is known back to the disk.

MBR size is 448 bytes, the rest is "the partition table", with space for four 
entries. If one wants more, then s/he creates a [primary] partition, tagging 
it "extended", and the "extended partiton table" is within that primary 
partition. So yes, by dd'ing /dev/hdX, you get everything. Including "lost 
sectors" if you dd it back to a bigger HD.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: fdisk: What do plus signs after "Blocks" mean?
  2005-07-12 20:19   ` Horst von Brand
  2005-07-12 20:48     ` Konstantin Kudin
@ 2005-07-13 12:13     ` DervishD
  1 sibling, 0 replies; 13+ messages in thread
From: DervishD @ 2005-07-13 12:13 UTC (permalink / raw)
  To: Horst von Brand; +Cc: Konstantin Kudin, linux-kernel

    Hi Horst :)

 * Horst von Brand <vonbrand@inf.utfsm.cl> dixit:
> DervishD <lkml@dervishd.net> wrote:
> >     It's a good idea to have a copy of the partition table around, if
> > it is not simple (the one you had is NOT simple).
> Be careful. What you'll get out of backing up the partition table is /only/
> the primary partitions, the others are handled by a weird russian doll of
> partitions-inside-partitions. AFAIR, the details were in the LILO docu.

    Note that I didn't suggest to backup or have a copy of the MBR,
but of the partition table, the FULL partition table (that includes
the secondary partitions and the like. Once a disk is fully
partitioned, a couple of 'dd' commands do the trick even for
extended partitions.

    It's a mess, anyway :( 

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
http://www.pleyades.net & http://www.gotesdelluna.net
It's my PC and I'll cry if I want to...

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: fdisk: What do plus signs after "Blocks" mean?
  2005-07-12 20:48     ` Konstantin Kudin
  2005-07-13 10:24       ` Jan Engelhardt
@ 2005-07-13 12:14       ` DervishD
  1 sibling, 0 replies; 13+ messages in thread
From: DervishD @ 2005-07-13 12:14 UTC (permalink / raw)
  To: Konstantin Kudin; +Cc: Horst von Brand, linux-kernel

    Hi Konstantin :)

 * Konstantin Kudin <konstantin_kudin@yahoo.com> dixit:
>  Actually, it seems like one can backup information on ALL partitions
> by using the command "sfdisk -dx /dev/hdX". Supposedly, it reads not
> only primary but also extended partitions. "sfdisk -x /dev/hdX" should
> be then able to write whatever is known back to the disk.

    Cool! A long time has passed since I used sfdisk, but I used it
for manually re-reading partition tables and the like :)

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
http://www.pleyades.net & http://www.gotesdelluna.net
It's my PC and I'll cry if I want to...

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: fdisk: What do plus signs after "Blocks" mean?
  2005-07-13 10:24       ` Jan Engelhardt
@ 2005-07-14 13:50         ` kernel
  2005-07-14 16:23           ` DervishD
  2005-07-14 18:08           ` Jan Engelhardt
  0 siblings, 2 replies; 13+ messages in thread
From: kernel @ 2005-07-14 13:50 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: Konstantin Kudin, Horst von Brand, lkml, linux-kernel

I always thought;

First 446 bytes are boot code and all
Next 64 bytes are for 4 partition records, 16 bytes each
Last 2 bytes are signature 

?

-fd


On Wed, 2005-07-13 at 06:24, Jan Engelhardt wrote:
> > Guys, thanks a lot for the explanations!
> >
> > Actually, it seems like one can backup information on ALL partitions
> >by using the command "sfdisk -dx /dev/hdX". Supposedly, it reads not
> >only primary but also extended partitions. "sfdisk -x /dev/hdX" should
> >be then able to write whatever is known back to the disk.
> 
> MBR size is 448 bytes, the rest is "the partition table", with space for four 
> entries. If one wants more, then s/he creates a [primary] partition, tagging 
> it "extended", and the "extended partiton table" is within that primary 
> partition. So yes, by dd'ing /dev/hdX, you get everything. Including "lost 
> sectors" if you dd it back to a bigger HD.
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: fdisk: What do plus signs after "Blocks" mean?
  2005-07-14 13:50         ` kernel
@ 2005-07-14 16:23           ` DervishD
  2005-07-14 18:08           ` Jan Engelhardt
  1 sibling, 0 replies; 13+ messages in thread
From: DervishD @ 2005-07-14 16:23 UTC (permalink / raw)
  To: kernel; +Cc: Jan Engelhardt, Konstantin Kudin, Horst von Brand, linux-kernel

   Hi kernel.

 * kernel <kernel@crazytrain.com> dixit:
> First 446 bytes are boot code and all
> Next 64 bytes are for 4 partition records, 16 bytes each
> Last 2 bytes are signature 

    And that's right, but only for the MBR. If you set up an extended
partition in the MBR, the partition table for that extended partition
is on the boot record of the extended partition. If you just backup
the MBR, you only backup the *declaration* of the extended partition
(where it starts, where it ends, etc.) but NOT the partition table of
the extended partition (that is, the partitions within the extended
partition). For storing that you have to backup the first sector of
the extended partition itself. And you have to do it recursively if
you want to backup any partition setup, no matter how strange.

    I hope I've made this clear, is a bit difficult to explain
without a couple of diagrams O:)

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
http://www.pleyades.net & http://www.gotesdelluna.net
It's my PC and I'll cry if I want to...

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: fdisk: What do plus signs after "Blocks" mean?
  2005-07-14 13:50         ` kernel
  2005-07-14 16:23           ` DervishD
@ 2005-07-14 18:08           ` Jan Engelhardt
  1 sibling, 0 replies; 13+ messages in thread
From: Jan Engelhardt @ 2005-07-14 18:08 UTC (permalink / raw)
  To: kernel; +Cc: Konstantin Kudin, Horst von Brand, lkml, linux-kernel

>I always thought;
>
>First 446 bytes are boot code and all

Right, of course. Otherwise it won't sum up to 512 bytes.



Jan Engelhardt
-- 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Problem with usb-storage and /dev/sd?
       [not found] <mailman.1123702259.29404.linux-kernel2news@redhat.com>
@ 2005-08-10 23:00 ` Pete Zaitcev
  2005-08-11  7:29   ` DervishD
  0 siblings, 1 reply; 13+ messages in thread
From: Pete Zaitcev @ 2005-08-10 23:00 UTC (permalink / raw)
  To: DervishD; +Cc: linux-kernel, zaitcev

On Wed, 10 Aug 2005 21:22:43 +0200, DervishD <lkml@dervishd.net> wrote:

>     I'm not using hotplug currently so... how can I make the USB
> subsystem to assign always the same /dev/sd? entry to my USB Mass
> storage devices? [...]

You cannot. Just mount by label or something... Better yet, install
something like Fedora Core 4, which uses HAL, and forget about it.
The fstab-sync takes care of the rest.

-- Pete

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Problem with usb-storage and /dev/sd?
  2005-08-10 23:00 ` Problem with usb-storage and /dev/sd? Pete Zaitcev
@ 2005-08-11  7:29   ` DervishD
  2005-08-11 22:53     ` Horst von Brand
  0 siblings, 1 reply; 13+ messages in thread
From: DervishD @ 2005-08-11  7:29 UTC (permalink / raw)
  To: Pete Zaitcev; +Cc: linux-kernel

    Hi Pete :)

 * Pete Zaitcev <zaitcev@redhat.com> dixit:
> On Wed, 10 Aug 2005 21:22:43 +0200, DervishD <lkml@dervishd.net> wrote:
> >     I'm not using hotplug currently so... how can I make the USB
> > subsystem to assign always the same /dev/sd? entry to my USB Mass
> > storage devices? [...]
> You cannot. Just mount by label or something...

    Mounting by label won't work, the problem is the /dev entry,
which changes every time.

> Better yet, install something like Fedora Core 4, which uses HAL,
> and forget about it. The fstab-sync takes care of the rest.

    Oh no, thanks, I've already used Fedora and it only reinforced my
feeling about distros: I prefer my do-it-yourself box ;)

    Thanks :)))

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
http://www.pleyades.net & http://www.gotesdelluna.net
It's my PC and I'll cry if I want to...

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Problem with usb-storage and /dev/sd?
  2005-08-11  7:29   ` DervishD
@ 2005-08-11 22:53     ` Horst von Brand
  0 siblings, 0 replies; 13+ messages in thread
From: Horst von Brand @ 2005-08-11 22:53 UTC (permalink / raw)
  To: Pete Zaitcev, linux-kernel

DervishD <lkml@dervishd.net> wrote:
>  * Pete Zaitcev <zaitcev@redhat.com> dixit:
> > On Wed, 10 Aug 2005 21:22:43 +0200, DervishD <lkml@dervishd.net> wrote:
> > >     I'm not using hotplug currently so... how can I make the USB
> > > subsystem to assign always the same /dev/sd? entry to my USB Mass
> > > storage devices? [...]
> > You cannot. Just mount by label or something...

>     Mounting by label won't work, the problem is the /dev entry,
> which changes every time.

That's why you should mount by label...

> > Better yet, install something like Fedora Core 4, which uses HAL,
> > and forget about it. The fstab-sync takes care of the rest.
> 
>     Oh no, thanks, I've already used Fedora and it only reinforced my
> feeling about distros: I prefer my do-it-yourself box ;)

In Fedora rawhide it just works. I can't see how the knot you are tying
yourself into by diy is any better...
-- 
Dr. Horst H. von Brand                   User #22616 counter.li.org
Departamento de Informatica                     Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria              +56 32 654239
Casilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2005-08-11 22:54 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-12 16:35 fdisk: What do plus signs after "Blocks" mean? Konstantin Kudin
2005-07-12 17:37 ` DervishD
2005-07-12 20:19   ` Horst von Brand
2005-07-12 20:48     ` Konstantin Kudin
2005-07-13 10:24       ` Jan Engelhardt
2005-07-14 13:50         ` kernel
2005-07-14 16:23           ` DervishD
2005-07-14 18:08           ` Jan Engelhardt
2005-07-13 12:14       ` DervishD
2005-07-13 12:13     ` DervishD
     [not found] <mailman.1123702259.29404.linux-kernel2news@redhat.com>
2005-08-10 23:00 ` Problem with usb-storage and /dev/sd? Pete Zaitcev
2005-08-11  7:29   ` DervishD
2005-08-11 22:53     ` Horst von Brand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox