home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.amiga
- Path: sparky!uunet!sybus.sybus.com!myrddin!tct!ckctpa!crash
- From: crash@ckctpa.UUCP (Frank "Crash" Edwards)
- Subject: Re: Help!!
- Message-ID: <1992Nov13.041138.8476@ckctpa.UUCP>
- Date: Fri, 13 Nov 1992 04:11:38 GMT
- Reply-To: crash%ckctpa@tct.com (Frank "Crash" Edwards)
- References: <BxKyz5.80u@csugrad.cs.vt.edu>
- Organization: Edwards & Edwards Consulting
- Lines: 90
-
- keven@csugrad.cs.vt.edu (Keven Ring) writes:
- >1) I have shrunk the partition by 2 meg (without optimizing), used the new
- > space on amiga dos, booted up unix, and shut it down, went back onto
- > amiga dos, and everything was intact.
-
- Wow! Was that dangerous or what!!???
-
- > Do I have a chance in ???? of getting this to work? Basically, is there
- >such a thing as an "optimizer" for UNIX that just reorganizes the files to the
- >front of the partition. If so, where can I get such a program? If you
-
- There's not a free one that I know of, and the commercial versions are
- targeted at the 386 market.
-
- >hesitate in answering because I might destroy UNIX, well, don't worry. As I
- >said, I am basically beta testing it, and I can get it RECLONED (basically
- >reinstalled in about 15 minutes free of charge). Please, any help would be
- >greatly appreciated. If I get this to work, I should be able to "steal"
- >about 25 megs!!
-
- Alright, here's what I would do. I'm assuming the filesystem is ufs,
- since that's the trickier one.
-
- [Kids, don't try this at home. This gentleman said he wants to blow
- away his root partition so that's why I'm writing this here!]
-
- I would edit the first superblock in the filesystem (fsck can tell you
- where that is, or you may have to run a fake mkfs to get the numbers
- -- see a previous post of about 2 weeks ago) and change the
- filesystem's idea of how many blocks are available. This may take
- some perusal of /usr/include/sys/fs/ufs_fs.h but I think it may be the
- fs_size field.
-
- After that's done, run "fsck -F ufs -b# -n /dev/dsk/..." where the
- pound sign ("#") is the block number where the superblock is located,
- and the "..." is the rest of the disk device name.
-
- The "-n" says "don't fix any problems", but fsck will still report any
- inodes that contain data blocks beyond the 50MB point or whatever
- maximum block size you put into the superblock. This will tell you
- which files would be destroyed. (I'd back them up to tape instead of
- just copying -- if you copy them then you have to run fsck again and
- possibly copy them again, etc, until they fit inside the smaller
- size.) [Only do this with an unmounted filesystem.]
-
- Change the number in the superblock fs_size field back to what it was
- and after the files are backed up, delete them using "rm". Now there
- shouldn't be any blocks in use beyond the 50MB point. The filesystem
- will have to mounted for the backup and delete operations, of course.
- Unmount it again. Now put your 50MB value into the fs_size field and
- run "fsck -F ufs ..." just like before, but take out the "-n" option.
- Fsck will read through the filesystem and check for the inode
- situation again. There shouldn't be any problem there. It *WILL*
- complain that there are blocks in the freelist that shouldn't be
- there. It will ask if it should salvage the free list. Answer with
- yes -- that will cause fsck to fix the partition. When it is done, it
- will update the other superblocks as well, so that the entire
- filesystem is back in sync.
-
- The above method should work for both shrinking and expanding a
- filesystem. I would wait a week or so and see if anyone posts a
- followup and points out any details that I may have forgotten. Or, if
- you're lucky, I'll get a chance to try this myself. It's the first
- time I've ever given real consideration to this problem and I'm
- somewhat intrigued by the simplicity of this solution. Therefore, I
- can't believe that's all there is to it. But if I find the time, I'll
- create a small partition and try to shrink it. Stay tuned for the
- results.
-
- >Thanks in advance. It is greatly appreciated. The whole university will
- >"thank" you (at least those using UNIX and wanting more room on AMIGA DOS!)
- >
- >Once again, thanks...
-
- No problem. Perhaps the University could use some consulting in some
- area where I could be of assistance?! I'm always willing to trade
- some experience/talent for cold, hard cash...
-
- [Yeah, that's a bit commercial, but what the hey. Look what he just
- got for free!]
-
- >|Keven Ring |your mission is a failure. Your lifesyle's too extreme
- >|keven@csugrad.cs.vt.edu|I'm your new commander - You are now my prisoner
- >|VPI & SU |We return to Transylvania.
-
- --
- Frank "Crash" Edwards Edwards & Edwards Consulting
- Fax: 813/786-6526 Home: 813/786-3675
-
- "I'd love to go out with you, but I want to spend more time with my blender."
-