EFS volume descriptors
On an EFS CDROM, there's a volume descriptor at block 0. On an EFS partition, there's a superblock at block 1. I'd like my all-new code to handle both cases, so I'm wondering what's at block 0 of an EFS partition. Is it something that I can reliably check to see if I'm mounting a partition or CD?
Mike
Signature · 1 line
7734.79 7103.32
Have a look at /usr/include/sys/dvh.h on an IRIX system for enlightenment.
Later,
David S. Miller
[email protected]
Quoted 2 lines · David S. Miller
Have a look at
/usr/include/sys/dvh.hon an IRIX system for enlightenment.
I took a look there before (and again as well), but it didn't leave me feeling confident about partitions. Everything in there seems to talk about the first block of the device, which I took to be /dev/sda rather than /dev/sda1 (say). When people are mounting the CDROM, they'll be mounting the ``whole'' device, so block 0 is full of voldesc goodness; what's in block 0 of an EFS partition? A dummy voldesc?
Mike
Signature · 1 line
10073.24 9299.81
Mike Shaver wrote:
| On an EFS CDROM, there's a volume descriptor at block 0. On an EFS | partition, there's a superblock at block 1. I'd like my all-new code to | handle both cases, so I'm wondering what's at block 0 of an EFS | partition. Is it something that I can reliably check to see if I'm | mounting a partition or CD?
Nothing is at block 0 of the filesystem. Historically, back to v6 unix, there were things like badblock tables there, so many filesystems for unix have simply not used block 0. efs does not use it.
Dave Olson, Silicon Graphics
http://reality.sgi.com/olson [email protected]
Quoted 3 lines · Dave Olson
Nothing is at block 0 of the filesystem. Historically, back to v6 unix, there were things like badblock tables there, so many filesystems for unix have simply not used block 0. efs does not use it.
Drat. So do I need the user to tell me if it's an EFS CD vs. an EFS partition, so that I know to use the voldesc or not? I guess I could register a second fstype ("efscd" or some such) and make the user use that.
Mike
Signature · 1 line
108334.35 92988.48
Mike Shaver wrote:
| Dave Olson wrote:
| > Nothing is at block 0 of the filesystem. Historically, back to v6
| > unix, there were things like badblock tables there, so many filesystems
| > for unix have simply not used block 0. efs does not use it.
|
| Drat. So do I need the user to tell me if it's an EFS CD vs. an EFS
| partition, so that I know to use the voldesc or not? I guess I could
| register a second fstype ("efscd" or some such) and make the user use
| that.Look at block 0 on the disk ("absolute" block 0), and use the magic number to see if it's an sgi volume. If it is, for each partition other than 8 and 10, check to see if block 1 is an EFS superblock. That's the only possible way. For almost all (but not all!) efs CD's, there will only be partition 7,8,10, so you can just check partition 7, if you want to be lazy.
And of course, it's possible to have hybrid iso9660 and sgi/efs CD's as well, so you might still want to check for iso9660.
Dave Olson, Silicon Graphics
http://reality.sgi.com/olson [email protected]
Quoted 6 lines · Dave Olson
Look at block 0 on the disk ("absolute" block 0), and use the magic number to see if it's an sgi volume. If it is, for each partition other than 8 and 10, check to see if block 1 is an EFS superblock. That's the only possible way. For almost all (but not all!) efs CD's, there will only be partition 7,8,10, so you can just check partition 7, if you want to be lazy.
Excellent! Thanks.
Mike
Signature · 1 line
108908.71 93516.45