home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cis.ohio-state.edu!rutgers!cmcl2!GRANNY.CS.NYU.EDU!m-jk8594
- From: m-jk8594@GRANNY.CS.NYU.EDU (James Kyriannis)
- Newsgroups: comp.unix.admin
- Subject: Reading BSD filesystems on a block level
- Message-ID: <9208180320.AA00974@GRANNY.CS.NYU.EDU>
- Date: 18 Aug 92 03:20:25 GMT
- References: <rkz1H02x!8@atlantis.psu.edu>
- Sender: daemon@cmcl2.nyu.edu (Mr Background)
- Organization: Courant Institute, New York University
- Lines: 28
-
-
- I'm trying to learn about BSD filesystems, so I decided to write myself a
- 'sector editor', which can read in blocks from the filesystem device and let
- me view the stuff it finds. Since I'm running BSD/386, I don't have access
- to fsdb or its source, so I don't know how some things were done.
-
- fsdb is capable of letting you edit filesystems while they are still
- mounted. How is this done? I've been using 'open(filesys_fd, buffer)'
- to open the block device, but if the filesystem is mounted, this call
- returns with a "/dev/sd0a: Device busy" from perror(). Then, how can I
- access my filesystem directly, without having to unmount it? [fsck also
- uses the 'open()' method.]
-
- Also, I want to be able to lseek() into the filesystem, at increments
- the size of one block. According to usf/fs.h, MINBSIZE is 4096, though
- in sys/param.h, MAXBSIZE is 8192. Further, calling getfsstat() will tell
- you that the fundamental filesystem block size (f_fsize) is 1024 bytes.
- Which one is the correct size of a BSD Net2 filesystem block?
-
- Thanks,
-
- Jimmy
-
- --
- =============================================================================
- |
- Jimmy Kyriannis | +5 Chain Mail --- don't leave home without it.
- m-jk8594@cs.nyu.edu |
-