All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] Enhancement of /proc/partitions output (2.5.1-pre5)
@ 2001-12-01 11:22 Andries.Brouwer
  0 siblings, 0 replies; 13+ messages in thread
From: Andries.Brouwer @ 2001-12-01 11:22 UTC (permalink / raw)
  To: aia21, torvalds; +Cc: linux-kernel

    From: Anton Altaparmakov <aia21@cus.cam.ac.uk>

    Linus,

    Please consider below patch which adds the starting sector and number of
    sectors to /proc/partitions.

    It works fine here and I find having this information output can be very
    useful (especially when the values in the kernel don't match the values
    output by fdisk for example).

Of course this breaks all programs that use /proc/partitions,
like fdisk and mount. Every system that uses mount-by-label will be broken.

Andries

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: [PATCH] Enhancement of /proc/partitions output (2.5.1-pre5)
@ 2001-12-02  3:28 Andries.Brouwer
  0 siblings, 0 replies; 13+ messages in thread
From: Andries.Brouwer @ 2001-12-02  3:28 UTC (permalink / raw)
  To: Andries.Brouwer, aia21; +Cc: adilger, linux-kernel, torvalds

    From: Anton Altaparmakov <aia21@cam.ac.uk>

    btw. You sent a patch to fsdevel some time ago converting parts of the 
    kernel to use bytes instead of 1024 byte blocks. Have you got an 
    updated/more complete version of that?

Yes. This summer I constructed the first dozen patches or so of
a path that would step by step change the present situation into one
without the `arrays', and with proper partition handling (namely not
buried down in the drivers), and with sizes as 64-bit byte amounts etc.
You can still find them on ftp.kernel.org.
Part of this was applied to 2.4.

Now that 2.5 has opened, I started (an hour ago) moving this stuff to 2.5.
(But will be abroad next week.)


    >    And I agree with Andreas the partition type would be useful
    >     in the display, too.
    >
    >I don't.
    >
    >This type is irrelevant. It would be very bad to make it available.
    >People might start using it, and that can only cause problems.
    >Moreover, usually there is no type, and in the future that I plan
    >there will never be a type. If there is a type, *fdisk will tell you.

    I am afraid I disagree. - Type is important when a partitioned device is 
    being worked on. LDM for example needs to know the types in order to make 
    sure not to take over a non-dynamic disk by mistake / to know that it is a 
    dynamic disk.

You illustrate what I say. It is vary bad to make types available,
since they do not exist. And ignorant people might start using them.

There are lots of partitioning systems in common use. And there is
no reason why LDM or MD RAID can sit on top of a DOS partition only.
Consequently, any dependence on types here is a bug.
Moreover, DOS type partitioning is dying. It cannot describe partitions
larger than 1 or 2 TB.

    .. I.e. where several different partitions have to be combined
    in various ways to give new devices? What are your thoughts
    on this? And do you have or are you aware of any code for
    these more advanced uses of partitioned devices?

No - but things will improve fully automatically. The MD code is
terrible (seen from a kdev_t point of view) and requires a lot of
restructuring.

Andries

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: [PATCH] Enhancement of /proc/partitions output (2.5.1-pre5)
@ 2001-12-01 22:43 Andries.Brouwer
  2001-12-02  2:13 ` Anton Altaparmakov
  0 siblings, 1 reply; 13+ messages in thread
From: Andries.Brouwer @ 2001-12-01 22:43 UTC (permalink / raw)
  To: Andries.Brouwer, aia21; +Cc: adilger, linux-kernel, torvalds

    From: Anton Altaparmakov <aia21@cam.ac.uk>

    > It will still break things.

    Sure. I anticipated it would break things but then again it is
    2.5.1-pre5 and not 2.4.x.

True. But this is the reporting side of the block device stuff.
And all is going to be changed. It is better to wait until the
new situation has been established.

    >Adding such stuff to the kernel would be especially unfortunate if,
    >as I did in my version of the block layer, the unit becomes byte
    >instead of sector. We would have to change again.

    So you are going to change it anyway at some point?

Who am I? I have plans, but other people may have other plans,
and it is not me who decides.

    We could just make the changes at the same time in that case?
    If it is in bytes even better. Just give start byte and length, 

But why not do it in user space?

# ./blockdev --report /dev/hda?
RO    RA   SSZ   BSZ   StartSec     Size    Device
rw     8   512  1024   16450560          2  /dev/hda1
rw     8   512  1024          0          0  /dev/hda2
rw     8   512  1024          0          0  /dev/hda3
rw     8   512  1024         63   16450497  /dev/hda4
rw     8   512  4096   16450623    4096512  /dev/hda5
rw     8   512  4096   20547198   13108977  /dev/hda6
rw     8   512  1024   33656238      80262  /dev/hda7
rw     8   512  1024     481950    4209030  /dev/hda8
rw     8   512  1024      64260     417690  /dev/hda9

(util-linux-2.11n)

    And I agree with Andreas the partition type would be useful
    in the display, too.

I don't.

This type is irrelevant. It would be very bad to make it available.
People might start using it, and that can only cause problems.
Moreover, usually there is no type, and in the future that I plan
there will never be a type. If there is a type, *fdisk will tell you.

[We all have plans, and some of these will actually be implemented.
In util-linux I already distribute for quite some time code that will
do partition setup. That means that no partition code is required
in the kernel. If 2.5 adds an initrd or so to the kernel, so that
Linux boots in its own ramdisk, then all partition reading code
can be thrown out of the kernel. That is one of my goals.
User space comes and tells the kernel: on device /dev/hda,
let hda7 be the interval of length 80262 sectors, starting at
sector 33656238. It is possible today, but not many people
use it. The plan is to make that the only way to get partitions.]

    If it really is only a list of available devices why show the size in 
    blocks at all?

History. It happened to be implemented like that.
There were some reasons, but not very strong ones.

Andries

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: [PATCH] Enhancement of /proc/partitions output (2.5.1-pre5)
@ 2001-12-01 11:47 Andries.Brouwer
  2001-12-01 16:07 ` Anton Altaparmakov
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Andries.Brouwer @ 2001-12-01 11:47 UTC (permalink / raw)
  To: adilger, aia21; +Cc: linux-kernel, torvalds

    From: Andreas Dilger <adilger@turbolabs.com>

    > Please consider below patch which adds the starting sector and number of
    > sectors to /proc/partitions.

    Please do not accept as-is.  This breaks the format of /proc/partitions
    terribly, and all of the code that looks at it (fsck, mount, etc).

Indeed.

    Rather add the start_sect and nr_sects parameters _after_ the name
    parameter, and it will be "mostly" ok.

No. It will still break things.

    While we are at it, how about adding the partition type to the output?

The present /proc/partitions has minimal content.
Its only function is to report to user space which block devices
are known to the kernel. User space is unable to figure that out
on its own without an unreasonable amount of probing.

But once you know what devices exist, it is very easy for user space
to report all desired properties of these devices.
Do you want starting sector and size of /dev/hde4?

# hdparm -g /dev/hde4

/dev/hde4:
 geometry     = 70780/16/63, sectors = 1670760, start = 69673905

Adding such stuff to the kernel would be especially unfortunate if,
as I did in my version of the block layer, the unit becomes byte
instead of sector. We would have to change again.


Andries

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: [PATCH] Enhancement of /proc/partitions output (2.5.1-pre5)
@ 2001-12-01  8:30 RaúlNúñez de Arenas Coronado
  2001-12-01  8:47 ` Marcus Meissner
  2001-12-01 16:10 ` Anton Altaparmakov
  0 siblings, 2 replies; 13+ messages in thread
From: RaúlNúñez de Arenas Coronado @ 2001-12-01  8:30 UTC (permalink / raw)
  To: aia21, torvalds; +Cc: linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 394 bytes --]

    Hello Anton :)

>Please consider below patch which adds the starting sector and number of
>sectors to /proc/partitions.

    This is a *great* idea. I was wondering why this information is
not included by default :)))

    I have a somewhat 'special' partition scheme and that information
is vital for me. Thanks a lot for the patch. I hope that Marcello
accepts it for 2.4.17...

    Raúl

^ permalink raw reply	[flat|nested] 13+ messages in thread
* [PATCH] Enhancement of /proc/partitions output (2.5.1-pre5)
@ 2001-12-01  7:08 Anton Altaparmakov
  2001-12-01  8:39 ` Andreas Dilger
  0 siblings, 1 reply; 13+ messages in thread
From: Anton Altaparmakov @ 2001-12-01  7:08 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel

Linus,

Please consider below patch which adds the starting sector and number of
sectors to /proc/partitions.

It works fine here and I find having this information output can be very
useful (especially when the values in the kernel don't match the values
output by fdisk for example).

Best regards,

	Anton
-- 
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Linux NTFS maintainer / WWW: http://linux-ntfs.sf.net/
ICQ: 8561279 / WWW: http://www-stu.christs.cam.ac.uk/~aia21/


diff -u -urN linux-2.5.1-pre5-vanilla/drivers/block/genhd.c l251p5/drivers/block/genhd.c
--- linux-2.5.1-pre5-vanilla/drivers/block/genhd.c	Sat Dec  1 06:09:57 2001
+++ l251p5/drivers/block/genhd.c	Sat Dec  1 03:57:57 2001
@@ -149,7 +149,8 @@
 	char buf[64];
 	int len, n;
 
-	len = sprintf(page, "major minor  #blocks  name\n\n");
+	len = sprintf(page, "major minor   #blocks  start_sect   nr_sects  "
+			"name\n\n");
 	read_lock(&gendisk_lock);
 	for (gp = gendisk_head; gp; gp = gp->next) {
 		for (n = 0; n < (gp->nr_real << gp->minor_shift); n++) {
@@ -157,8 +158,10 @@
 				continue;
 
 			len += snprintf(page + len, 63,
-					"%4d  %4d %10d %s\n",
+					"%4d  %4d %10d  %10lu %10lu  %s\n",
 					gp->major, n, gp->sizes[n],
+					gp->part[n].start_sect,
+					gp->part[n].nr_sects,
 					disk_name(gp, n, buf));
 			if (len < offset)
 				offset -= len, len = 0;


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

end of thread, other threads:[~2001-12-03 23:46 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-12-01 11:22 [PATCH] Enhancement of /proc/partitions output (2.5.1-pre5) Andries.Brouwer
  -- strict thread matches above, loose matches on Subject: below --
2001-12-02  3:28 Andries.Brouwer
2001-12-01 22:43 Andries.Brouwer
2001-12-02  2:13 ` Anton Altaparmakov
2001-12-01 11:47 Andries.Brouwer
2001-12-01 16:07 ` Anton Altaparmakov
2001-12-01 20:51 ` Marcel J.E. Mol
2001-12-03 16:30 ` Bill Davidsen
2001-12-01  8:30 RaúlNúñez de Arenas Coronado
2001-12-01  8:47 ` Marcus Meissner
2001-12-01 16:10 ` Anton Altaparmakov
2001-12-01  7:08 Anton Altaparmakov
2001-12-01  8:39 ` Andreas Dilger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.