Filesystem creation
Hello.
As being new to this list, first a short introduction:
Living 15 km outside the nearest town with my woman and four cats. Working as a lathe-turner in town.
I have been interested in and tinkered with computers since the late seventies, more actively since late eighties. Could afford to buy my first DOS-box (second hand XT) -89. Since then the zoo has grown a bit. Installed Linux for the first time somewhere late -98. Got LRP running on an old crappy 386 to network my modem a year later. Fiddel with muLinux now and then. Never done any serious programming of any sort, just small bits and pieces in Basic, Pascal, assembler, DOS batch, shellscript. Enough of this.
I was glad when I found out about ELKS a while ago (2-3 yrs) and even gladder to see that there now are ready-to-go floppy images.
I'm trying to run the image "comb" on an IBM PS/2-30. It boots OK and runs as I expect. But when I try to make a file system on the harddisk and mount it, I bump into something.
fdisk reports 773 cyl, 2 heads, 27 sec.
/dev/bda1 * 0 1 6 1 27 385 1 20520 /dev/bda2 * 0 1 386 1 27 695 80 16740 /dev/bda3 * 0 1 696 1 27 772 80 4158
mkfs /dev/bda2 5859 finishes OK, but a following fsck /dev/bda2 produces an error message, fsck: bad magic number in super-block.
If I reduce the number of blocks by one, to 5858, fsck finishes without error message.
Mounting the new fs under /mnt goes OK, but ls /mnt gives error messages.
/mnt:
Bad inode number on dev 0302: 3677 is out of range Bad inode number on dev 0302: 11330 is out of range (some garbage on this line)
Trying to repair the fs with fsck -a desn't seem to do any good.
If I reduce the number of blocks further, down to 5666, I get no error messages anywhere. Mounting, unmounting, making directories, copying files seems to work OK.
Did I bump into anything but my own ignorance?
I realize I know too little about the minix fs. Google produces a lot of links but the first few pages contained no link to a spec. Anybody got a good URL to a little detail on minix fs?
Regards,
Lars
Does steel wool come from metal sheep?
Net-Tamer V 1.10.1 - Registered
Hi Lars.
Quoted 7 lines
As being new to this list, first a short introduction: Living 15 km outside the nearest town with my woman and four cats. Working as a lathe-turner in town. I have been interested in and tinkered with computers since the late seventies, more actively since late eighties. Could afford to buy my first DOS-box (second hand XT) 1989. Since then the zoo has grown a bit. Installed Linux for the first time somewhere late 1998.
Similar to my own experience in many ways, although the years vary slightly.
Quoted 4 lines
Got LRP running on an old crappy 386 to network my modem a year later. Fiddle with muLinux now and then. Never done any serious programming of any sort, just small bits and pieces in Basic, Pascal, assembler, DOS batch, shellscript. Enough of this.
I've done a lot more programming though...
Quoted 3 lines
I was glad when I found out about ELKS a while ago (2-3 yrs) and even gladder to see that there now are ready-to-go floppy images. I'm trying to run the image "comb" on an IBM PS/2-30.
I don't know that particular model, but have a PS/2-70 here and that has an ESDI hard drive.
Quoted 23 lines
It boots OK and runs as I expect. But when I try to make a file system on the harddisk and mount it, I bump into something.
fdisk reports 773 cyl, 2 heads, 27 sec.
/dev/bda1 * 0 1 6 1 27 385 1 20520 /dev/bda2 * 0 1 386 1 27 695 80 16740 /dev/bda3 * 0 1 696 1 27 772 80 4158mkfs
/dev/bda25859 finishes OK, but a following fsck/dev/bda2produces an error message, fsck: bad magic number in super-block.If I reduce the number of blocks by one, to 5858, fsck finishes without error message.
Mounting the new fs under /mnt goes OK, but ls /mnt gives error messages.
/mnt:
Bad inode number on dev 0302: 3677 is out of range Bad inode number on dev 0302: 11330 is out of range (some garbage on this line)
Quoted 7 lines
Trying to repair the fs with fsck -a desn't seem to do any good.
If I reduce the number of blocks further, down to 5666, I get no error messages anywhere. Mounting, unmounting, making directories, copying files seems to work OK.
Did I bump into anything but my own ignorance?
Probably only the same problem I'm having - I don't have the foggiest how to calculate the figure to use on the mkfs line. The figures produced and used by the various tools appear to bear no resemblance to each other in any shape or form.
Perhaps somebody with a bit more knowledge can arrange for the ELKS mkfs tool to auto-calculate the correct figure given the partition to use? Probably hoping too much, but...
Quoted 3 lines
I realize I know too little about the minix fs. Google produces a lot of links but the first few pages contained no link to a spec. Anybody got a good URL to a little detail on minix fs?
I tried asking Copernic for "Minix File System specification" and only came up with a spec for the umsdos file system, not what you're after, so can't help...
Quoted 1 line
Does steel wool come from metal sheep?
Probably...
Best wishes from Riley.
Quoted 5 lines · [email protected] wrote:
I realize I know too little about the minix fs. Google produces a lot of links but the first few pages contained no link to a spec. Anybody got a good URL to a little detail on minix fs?
Try the Tanenbaum's "Operating System. Design and implementation" book.
It is the book where minix was explained and designed, so it the best place to look for minixfs information..
Signature · 9 lines
Mamaaaa, ¿donde has dejado el manual de la vela? -------- Javier Sedano Jarillo http://www.it.uc3m.es/~jsedano [email protected] (*) [email protected] - To unsubscribe from this list: send the line "unsubscribe linux-8086" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
The mkfs utility needs the size to be specified because block devices in ELKS do not update the blk_sizes array. (Remember the swap discussion).
Harry
Hi Harry.
Quoted 3 lines
The mkfs utility needs the size to be specified because block devices in ELKS do not update the
blk_sizesarray. (Remember the swap discussion).
I don't remember the discussion you refer to, so presume it wasn't on this list but on some other list. However, there's a few obvious questions that your comment poses, so can I ask them?
1. How come the figure that mkfs needs is so different from the figure displayed by fdisk? I've yet to work out what the correlation between the two is, as they appear to bear no relation to each other.
2. How hard would it be to make mkfs take as its size parameter the number reported by fdisk and calculate the size it needs from that rather than expect the user to do the calculation instead?
3. How hard would it be to fix ELKS so the size doesn't need to be specified, either by getting the block devices to update the blk_sizes array or by whatever other means are required? This way, the whole problem just vanishes.
Best wishes from Riley.
Quoted 4 lines
2. How hard would it be to make mkfs take as its size parameter the number reported by fdisk and calculate the size it needs from that rather than expect the user to do the calculation instead?
That would break the expected but daft old Unix API
Quoted 4 lines
3. How hard would it be to fix ELKS so the size doesn't need to be specified, either by getting the block devices to update the
blk_sizesarray or by whatever other means are required? This way, the whole problem just vanishes.
You can fill in the block sizes for each partition by reading the partition table. In the ELKS case I'd argue that mkfs ought to figure out the primary device, and do the partition table read itself simply because kernel space is precious and only mkfoo need to know
Hi Alan.
Quoted 6 lines
Quoted 4 lines
2. How hard would it be to make mkfs take as its size parameter the number reported by fdisk and calculate the size it needs from that rather than expect the user to do the calculation instead?
That would break the expected but daft old Unix API
The other option would be to give fdisk an option to do the calculation and display the numbers that mkfs needs...
Quoted 10 lines
Quoted 4 lines
3. How hard would it be to fix ELKS so the size doesn't need to be specified, either by getting the block devices to update the
blk_sizesarray or by whatever other means are required? This way, the whole problem just vanishes.You can fill in the block sizes for each partition by reading the partition table. In the ELKS case I'd argue that mkfs ought to figure out the primary device, and do the partition table read itself simply because kernel space is precious and only mkfoo need to know
I'm in full agreement with that.
Best wishes from Riley.
Hi Alan.
Quoted 6 lines
Quoted 4 lines
2. How hard would it be to make mkfs take as its size parameter the number reported by fdisk and calculate the size it needs from that rather than expect the user to do the calculation instead?
That would break the expected but daft old Unix API
I have to admit that I didn't even know there was a Unix API to break, and from a personal viewpoint I'd be a lot more interested in building compatibility to the current Linux system on the assumption that if the API is important in the Unix world as a whole, then Linux will already follow it, and if Linux doesn't, then the API can't be that important.
Quoted 7 lines
Quoted 4 lines
3. How hard would it be to fix ELKS so the size doesn't need to be specified, either by getting the block devices to update the
blk_sizesarray or by whatever other means are required? This way, the whole problem just vanishes.You can fill in the block sizes for each partition by reading the partition table.
Alternatively, and according to Blaz, it's only the RamDrive driver that fails to provide this information already, so if we correct that bug (which I'm looking into now), then mkfs can already get all it needs from the current drivers and the problem just evaporates.
Quoted 3 lines
In the ELKS case I'd argue that mkfs ought to figure out the primary device, and do the partition table read itself simply because kernel space is precious and only mkfoo need to know
I could certainly agree with that argument if there was lots to insert in the ELKS kernel code to support it, but such is claimed not to be the case. I'll let you know what I find out anyway.
Best wishes from Riley.
Quoted 7 lines
Quoted 1 line
That would break the expected but daft old Unix API
I have to admit that I didn't even know there was a Unix API to break and from a personal viewpoint I'd be a lot more interested in building compatibility to the current Linux system on the assumption that if the API is important in the Unix world as a whole, then Linux will already follow it, and if Linux doesn't, then the API can't be that important.
Linux fdisk/mkfs also behave the same wacky way
Alan
Hi Alan.
Quoted 10 lines
Quoted 8 lines
Quoted 1 line
That would break the expected but daft old Unix API
I have to admit that I didn't even know there was a Unix API to break and from a personal viewpoint I'd be a lot more interested in building compatibility to the current Linux system on the assumption that if the API is important in the Unix world as a whole, then Linux will already follow it, and if Linux doesn't, then the API can't be that important.
Linux fdisk/mkfs also behave the same wacky way
Now you have me puzzled - I don't remember ever having to specify the partition size when running any of the Linux mkfs commands. Perhaps you could remind me what I'm missing please?
mke2fs /dev/hda3
mkdosfs /dev/hdb2
For some reason, both of those commands worked fine earlier today...
Best wishes from Riley.
Την Δευ, 13-05-2002 στις 23:55, ο/η Blaz Antonic έγραψε:
Quoted 9 lines
Quoted 2 lines
The mkfs utility needs the size to be specified because block devices in ELKS do not update the
blk_sizesarray. (Remember the swap discussion).Weren't you the one who posted the update to correct that ? It is really simple error and should be fixed immediately (i can't think of any reason for _not_ fixing it).
Blaz Antonic
No I just spoted it, didn't fix it! The only problem that I can see is that the blk_sizes is an array with the one dimention being the major and the other the minor device number. This is probably a waist of data segment in the case of ELKS. That is the only reason I can see, that made the developers comment out the source the blk_sizes references.
Harry
-
To unsubscribe from this list: send the line "unsubscribe linux-8086" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 9 lines
Now you have me puzzled - I don't remember ever having to specify the partition size when running any of the Linux mkfs commands. Perhaps you could remind me what I'm missing please?
mke2fs
/dev/hda3mkdosfs
/dev/hdb2For some reason, both of those commands worked fine earlier today...
It computes it, if you need to specify it then its in K and the fdisk data is in sectors.
Quoted 3 lines
and the other the minor device number. This is probably a waist of data segment in the case of ELKS. That is the only reason I can see, that made the developers comment out the source the
blk_sizesreferences.=20
Thats why I thought it would be a much better thing to leave in user space. 256 long words is expensive
Hi Harry.
Quoted 8 lines
Quoted 7 lines
Quoted 3 lines
The mkfs utility needs the size to be specified because block devices in ELKS do not update the
blk_sizesarray. (Remember the swap discussion).Weren't you the one who posted the update to correct that ? It is really simple error and should be fixed immediately (i can't think of any reason for _not_ fixing it).
Quoted 6 lines
No I just spoted it, didn't fix it! The only problem that I can see is that the
blk_sizesis an array with the one dimension being the major and the other the minor device number. This is probably a waste of data segment in the case of ELKS. That is the only reason I can see, that made the developers comment out the source theblk_sizesreferences.
I've now had a look at both the doshd.c and rd.c source files, and the ONLY references I can find resembling what you're discussing are to the blksize_size array. This is only a one dimensional array indexed by MAJOR_NR, and appears to contain the size of the block rather than the number of blocks as per this discussion. In both doshd.c and rd.c it's set to 1024 in the initialisation routine (or at least, it would be if the relevent lines weren't #if 0'd out altogether) and is then never used at all therein.
Does anybody have any documentation on the expected API for new block devices? If not, I'll try to write one based on the kernel source, then I might just have an idea what is going on here. I certainly don't at the moment.
Best wishes from Riley.
Hi Alan.
Quoted 11 lines
Quoted 9 lines
Now you have me puzzled - I don't remember ever having to specify the partition size when running any of the Linux mkfs commands. Perhaps you could remind me what I'm missing please?
mke2fs
/dev/hda3mkdosfs
/dev/hdb2For some reason, both of those commands worked fine earlier today...
It computes it.
That's the API that I'm aware of, and what I'd prefer to see in ELKS.
Quoted 2 lines
If you need to specify it then its in K and the fdisk data is in sectors.
To quote from Lars' email of a few days ago...
Q> I'm trying to run the image "comb" on an IBM PS/2-30. It boots Q> OK and runs as I expect. But when I try to make a file system on Q> the harddisk and mount it, I bump into something.
Q>
Q> fdisk reports 773 cyl, 2 heads, 27 sec.
Q>
Q> /dev/bda1 * 0 1 6 1 27 385 1 20520 Q> /dev/bda2 * 0 1 386 1 27 695 80 16740 Q> /dev/bda3 * 0 1 696 1 27 772 80 4158
I've just fed the above parameters into Linux's fdisk and I get the following display:
Disk /dev/hda: 2 heads, 27 sectors, 773 cylinders Units = cylinders of 54 * 512 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 385 10381+ 1 FAT12
/dev/hda2 * 386 695 8370 80 Old Minix
/dev/hda3 * 696 772 2106 80 Old Minix
By your argument, the "Blocks" column should be displaying the same numbers in both tables, but the ELKS version displays what looks like precicely double the number the Linux version reports, at least for partitions 2 and 3, and it appears to set totally different parameters altogether for partition 1.
Simple arithmetic shows that the Linux fdisk is displaying actual track capacities in Kilobytes in the Blocks column in each case, which is contrary to the API you refer to above.
Alan: Can you explain this please?
Lars continues:
Q> mkfs /dev/bda2 5859 finishes OK, but a following fsck /dev/bda2 Q> produces an error message, fsck: bad magic number in super-block. Q>
Q> If I reduce the number of blocks by one, to 5858, fsck finishes Q> without error message.
Q>
Q> Mounting the new fs under /mnt goes OK, but ls /mnt gives error Q> messages.
Q>
Q> /mnt:
Q> Bad inode number on dev 0302: 3677 is out of range
Q> Bad inode number on dev 0302: 11330 is out of range
Q> (some garbage on this line)
Q>
Q> Trying to repair the fs with fsck -a desn't seem to do any good. Q>
Q> If I reduce the number of blocks further, down to 5666, I get no Q> error messages anywhere. Mounting, unmounting, making Q> directories, copying files seems to work OK.
According to the details provided by the ELKS fdisk, /dev/bda2 has 16,740 sectors, so 8,370 Kilobytes. However, the numbers he's supplying to mkfs are (a) 5,859, (b) 5,858 and (c) 5,666, all of which are considerably smaller than 8,370.
According to the details provided by the Linux fdisk analysis of his settings, /dev/bda2 has 8,370 sectors, so 4,185 Kilobytes. In this case, the numbers he's supplying are LARGER than this.
According to your comments above, the "expected API" is that the parameter to mkfs is exactly half the number reported by fdisk. If so, then ELKS mkfs is NOT following that API at this time.
Alan: Please explain the error in this reasoning, as I can't find it.
Best wishes from Riley.