Path: utzoo!utgpu!water!watmath!clyde!att!occrsh!uokmax!rmtodd From: rmtodd@uokmax.UUCP (Richard Michael Todd) Newsgroups: comp.os.minix Subject: Re: Block special file sizes Summary: mkfs Keywords: Block,Special,/dev/fd? Message-ID: <1622@uokmax.UUCP> Date: 17 Jul 88 19:51:44 GMT References: <13@ausonics.OZ> Reply-To: rmtodd@uokmax.UUCP (Richard Michael Todd) Organization: University of Oklahoma, Norman, OK Lines: 25 In article <13@ausonics.OZ> grahams@ausonics.OZ (Graham Stoney) writes: >Could someone please explain how the /dev block special files are attributed >with a size?. For example, /dev/fd0 has a size of 360k; but how did it get it? >mknod(2) has no way of specifying a size; in fact, if you rm /dev/fd0 then >mknod it again with the same major and minor device numbers, it loses its >size. How was it created in the first place?. The only way to create a block-special-file with a size is to specify it in the prototype file given to mkfs when the system is created. The required line in the prototype file looks like this: fd0 b--644 2 1 2 0 360 name mode uid gid maj/min size in KB As you saw, mknod(2) cannot specify the size when the special-file is created. The whole idea of block-special file *having* a size is unique to MINIX; no other Unix variant has it. It isn't terribly clear to me that it's all that useful to have. I suppose if you were terribly interested (and willing to risk major havoc to your filesystem) you could write a program to add a size value to an inode created with mknod(2); it obviously requires mucking around with the raw device on which the filesystem in question is stored and directly fiddling with the inode fields yourself (yecch). -- Richard Todd Highly Dubious Domain: rmtodd@uokmax.ecn.uoknor.edu USSnail:820 Annie Court,Norman OK 73069 Fido:1:147/1 UUCP: sun!texsun!uokmax!rmtodd, at least for now... "MSDOS is a Neanderthal operating system" - Henry Spencer