* SCSI DVD-RAM partitions
@ 2005-07-09 12:32 Thomas Heinz
2005-07-12 2:37 ` Christoph Hellwig
0 siblings, 1 reply; 5+ messages in thread
From: Thomas Heinz @ 2005-07-09 12:32 UTC (permalink / raw)
To: linux-kernel
Hi
My SCSI DVD-RAM is available as /dev/sr1. fdisk -l /dev/sr1 shows
for a certain medium:
Note: sector size is 2048 (not 512)
Disk /dev/sr1: 2496 MB, 2496430080 bytes
255 heads, 63 sectors/track, 75 cylinders
Units = cylinders of 16065 * 2048 = 32901120 bytes
Device Boot Start End Blocks Id System
/dev/sr1p1 * 1 75 2409624 b W95 FAT32
Note that /dev/sr1p1 does not exist. Neither does /dev/sdX.
Mounting /dev/sr1 does not work. However, I was able to mount the
partition with the following "trick":
# losetup -o 129024 /dev/loop0 /dev/sr1
# mount /dev/loop0 /mnt
Is it possible to make the DVD-RAM partitions available as device
nodes (or at least directly mountable without the losetup hack)?
One solution would be to make the device available as /dev/sdX and
/dev/srX. Is that possible?
Thanks for your help. If this is a known issue, I would appreciate
a pointer on that topic.
Here is some more information about my system:
Linux version 2.6.11-gentoo-r9 (root@localhost) (gcc version
3.3.5-20050130 (Gentoo Hardened 3.3.5.20050130-r1, ssp-3.3.5.20050130-1,
pie-8.7.7.1))
Host: scsi0 Channel: 00 Id: 04 Lun: 00
Vendor: MATSHITA Model: PD-2 LF-D100 Rev: A113
Type: CD-ROM ANSI SCSI revision: 02
Regards,
Thomas
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: SCSI DVD-RAM partitions
2005-07-09 12:32 SCSI DVD-RAM partitions Thomas Heinz
@ 2005-07-12 2:37 ` Christoph Hellwig
2005-07-12 8:23 ` Thomas Heinz
0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2005-07-12 2:37 UTC (permalink / raw)
To: Thomas Heinz; +Cc: linux-kernel
On Sat, Jul 09, 2005 at 02:32:47PM +0200, Thomas Heinz wrote:
> Is it possible to make the DVD-RAM partitions available as device
> nodes (or at least directly mountable without the losetup hack)?
> One solution would be to make the device available as /dev/sdX and
> /dev/srX. Is that possible?
While adding support for partitions on sr is trivial it has a huge
drawback: it's chaning the dev_t space by using up device numbers
for partitions, so /dev/sr0 ff will have different device numbers
with that change applied. I have an old patch that's supposed to
enable support for partitioned scsi removable devices at
http://rechner.lst.de/~hch/hacks/sr-parts.diff, I'm not sure it
actually ever worked (but you should get the basic idea from it)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: SCSI DVD-RAM partitions
2005-07-12 2:37 ` Christoph Hellwig
@ 2005-07-12 8:23 ` Thomas Heinz
2005-07-31 14:01 ` Christoph Hellwig
0 siblings, 1 reply; 5+ messages in thread
From: Thomas Heinz @ 2005-07-12 8:23 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-kernel
Hi Christoph
You wrote:
> While adding support for partitions on sr is trivial it has a huge
> drawback: it's chaning the dev_t space by using up device numbers
> for partitions, so /dev/sr0 ff will have different device numbers
> with that change applied. I have an old patch that's supposed to
> enable support for partitioned scsi removable devices at
> http://rechner.lst.de/~hch/hacks/sr-parts.diff, I'm not sure it
> actually ever worked (but you should get the basic idea from it)
Ok, thanks for your valuable input. In fact, I thought about making
the device available both as /dev/srX and /dev/sdX at the same time
in order to support partitions. In my case it would even suffice to
make it available as /dev/sdX instead of /dev/srX.
Since I have no expert knowledge about this topic, I would be
interested in the general attitude towards "partitions on SCSI
DVD-RAM media / SCSI removable devices":
- Are partitions intentionally not supported? If so, why?
- Does it usually work but not with my specific DVD-RAM model?
If so, why?
- Do you think that this should be fixed?
Please note that personally, I can live with the "losetup hack"
since it is easy enough to write a program which encapsulates
partition mounting. However, there might be people which would
prefer plugging in a (possibly pre-)partitioned medium and
having the partitions work out of the box in the expected way.
Regards,
Thomas
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: SCSI DVD-RAM partitions
2005-07-12 8:23 ` Thomas Heinz
@ 2005-07-31 14:01 ` Christoph Hellwig
2005-08-05 17:02 ` Thomas Heinz
0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2005-07-31 14:01 UTC (permalink / raw)
To: Thomas Heinz; +Cc: linux-kernel
On Tue, Jul 12, 2005 at 10:23:17AM +0200, Thomas Heinz wrote:
> Hi Christoph
>
> You wrote:
> >While adding support for partitions on sr is trivial it has a huge
> >drawback: it's chaning the dev_t space by using up device numbers
> >for partitions, so /dev/sr0 ff will have different device numbers
> >with that change applied. I have an old patch that's supposed to
> >enable support for partitioned scsi removable devices at
> >http://rechner.lst.de/~hch/hacks/sr-parts.diff, I'm not sure it
> >actually ever worked (but you should get the basic idea from it)
>
> Ok, thanks for your valuable input. In fact, I thought about making
> the device available both as /dev/srX and /dev/sdX at the same time
> in order to support partitions. In my case it would even suffice to
> make it available as /dev/sdX instead of /dev/srX.
That doesn't make sense because sd is a very different driver from sd.
Besides that aliasing different dev_ts to the same underlying blockdevice
can't work, it's cause all sorts of aliasing problems.
> Since I have no expert knowledge about this topic, I would be
> interested in the general attitude towards "partitions on SCSI
> DVD-RAM media / SCSI removable devices":
> - Are partitions intentionally not supported? If so, why?
Historical coincidence.
> - Does it usually work but not with my specific DVD-RAM model?
> If so, why?
> - Do you think that this should be fixed?
There's no nice way to fix it unfortunately.
> Please note that personally, I can live with the "losetup hack"
> since it is easy enough to write a program which encapsulates
> partition mounting. However, there might be people which would
> prefer plugging in a (possibly pre-)partitioned medium and
> having the partitions work out of the box in the expected way.
It would probably be better to use device-mapper than the loop device.
I think there's already userland partition parsing code for dm, and
having a simple command line tool to do that, and maybe even automatically
run through udev and creating /dev/sr<num>p<partition> devices would
be very nice to have as an almost invisible workaround.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: SCSI DVD-RAM partitions
2005-07-31 14:01 ` Christoph Hellwig
@ 2005-08-05 17:02 ` Thomas Heinz
0 siblings, 0 replies; 5+ messages in thread
From: Thomas Heinz @ 2005-08-05 17:02 UTC (permalink / raw)
To: Christoph Hellwig, linux-kernel
Hi Christoph
You wrote:
>>Ok, thanks for your valuable input. In fact, I thought about making
>>the device available both as /dev/srX and /dev/sdX at the same time
>>in order to support partitions. In my case it would even suffice to
>>make it available as /dev/sdX instead of /dev/srX.
>
> That doesn't make sense because sd is a very different driver from sd.
> Besides that aliasing different dev_ts to the same underlying blockdevice
> can't work, it's cause all sorts of aliasing problems.
Ok.
> It would probably be better to use device-mapper than the loop device.
> I think there's already userland partition parsing code for dm, and
> having a simple command line tool to do that, and maybe even automatically
> run through udev and creating /dev/sr<num>p<partition> devices would
> be very nice to have as an almost invisible workaround.
Ok, that sounds reasonable. I have not yet searched for the partition
parsing code for dm but it should not be too hard to write this on
one's own. However, it is not clear to me whether this would work
automatically, i.e. insert dvd-ram medium -> udev event is triggered ->
device nodes are created via dmsetup.
Will there some (udev) event be triggered once a dvd-ram medium is
inserted?
Moreover, some event would have to be triggered if the dvd-ram medium
is removed in order to delete the device nodes.
Regards,
Thomas
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2005-08-05 17:02 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-09 12:32 SCSI DVD-RAM partitions Thomas Heinz
2005-07-12 2:37 ` Christoph Hellwig
2005-07-12 8:23 ` Thomas Heinz
2005-07-31 14:01 ` Christoph Hellwig
2005-08-05 17:02 ` Thomas Heinz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox