Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!ux1.cso.uiuc.edu!m.cs.uiuc.edu!wang From: wang@m.cs.uiuc.edu (Eric Wang) Newsgroups: comp.sys.ibm.pc Subject: Re: Problems with sys Keywords: upgrade sys hidden files Message-ID: <1989Oct16.170140.13441@ux1.cso.uiuc.edu> Date: 16 Oct 89 17:01:40 GMT References: <4495@mentor.cc.purdue.edu> Reply-To: wang@cs.uiuc.edu (Eric Wang) Organization: University of Illinois, Dept. of Comp. Science, Urbana Lines: 159 In article <4495@mentor.cc.purdue.edu> aj5@mentor.cc.purdue.edu (Bill Basden) writes: > > I'm having some trouble upgrading from PC-DOS 3.1 to MS-DOS 3.3 on >my 386 clone. When I try to sys my hard drive, I get a 'not enough >room' error. I suspect that this is because the hidden files are >bigger in 3.3, but I thought that the hidden dos and bios files no longer >had to be contiguous. > > Any suggestions on how I can do this without reformating my 80 meg >hard drive? > > >Thanks! > >Bill Basden >aj5@mentor.cc.purdue.edu (Internet) >pur-ee!mentor.cc.purdue.edu!aj5 (uucp) Here's a trick that I've used many, many times to upgrade the system files of DOS du jour WITHOUT reformatting the entire hard disk. I've used it about 50 times to date, and it hasn't failed me yet. Briefly, the idea is to delete one or more file(s) and/or directory(ies) to create a "hole" on the hard disk above the system files which is large enough to allow the new versions thereof to be installed. 1. Find out how much larger the new system files are than the old ones. This is the size of the "hole" you will have to create to make room for the new system files. The system files will always be the first two files in your root directory. Note that you can't simply DIR a system disk to find the size of a system file, because files with the HIDDEN attribute on do not appear in DIR listings, and the two system files are set to Read-Only, Hidden, and System. There are a number of ways around this limitation: a) Use a more powerful DIR program, e.g. Norton, Mace, PC-Tools, or any of a number of available PD & shareware DIR wanna-be's, DOS shells, hard disk repair programs, and so on. b) Change the files' attributes to Normal, i.e. remove the R, H, and S attributes. Again, there are many PD & shareware programs that can do this. After you've done this, the ex-system files become completely normal files, and can be DIRed, COPYed, archived, deleted, and otherwise manipulated as a normal file. However, they will no longer boot DOS, either, even if they are in the right place (see item 3). You have to set them back to RHS (or ARHS, take your pick) for them to regain their "system file" status. Once you have the sizes of the system files, calculate the amount of extra space you need. Here, you can't simply subtract the sum of the file sizes, since file sizes must be rounded up to the next full cluster. Your cluster size is a function of your hard disk. If you used method (a) above, you probably know your cluster size. If not, figure 2048 bytes per 32 MB of hard disk, i.e. a 65 MB hard disk would have 4K clusters, and an 80MB hard disk would have either 6K or 8K clusters (probably 8k). Don't worry about being exact. If you're not sure, just assume 8K or so. All this means is that you might end up deleting a few more files to create a hole that is slightly larger than it had to be. It's still easier than reformatting the entire disk. To calculate the hole size, 1) round the sizes of the old and new IBMBIO.COM files up to the next cluster. 2) Subtract the old size from the new size. 3) Repeat (1) and (2) for IBMDOS.COM. 4) Add the two results. Shit, I'm starting to sound like a textbook. 2. Get a FAT-level listing of your hard disk, beginning at cluster 0000. By this, I mean you have to somehow get a listing of the files and/or directories on your hard disk based on FAT cluster, not directory tree. There are many disk utilities that can do this, e.g. Norton, Mace, PC-Tools, and so on. It really helps to have file sizes included in the listing (see step 2). 3. The first two files on your hard disk must be the two system files IBMBIO.COM and IBMDOS.COM, in that order. As of DOS 3.3 and 4.01, they still have to be contiguous, i.e. not fragmented. IBMBIO.COM should start at cluster 0002. 4. Find and note the first entry (or entries), be they files or directories, which follow IMMEDIATELY after the two system files. Add up the sizes of these entries in consecutive order until the total exceeds the size of the hole which you calculated in step 1, then stop. The entries counted are the ones which must be moved elsewhere to create the hole. 5. Before you create the hole, save any of the entries found in step 4 that you still want to keep around. Files can be COPYed to new names. It's not even necessary to copy them to new directories; just give the copies temporary names to avoid naming conflicts. Note that you must actually do a COPY to create a duplicate image of the file; you can't simply MOV or mv it. Directories are more troublesome. Again, you have to duplicate them by MDing a new directory with a temporary name. Note that it's the directory itself that you're trying to kill, not the contents of the directory (unless they, too, were found in step 4). If the contents of the directory weren't part of the hole, they can be MOVEd by a variety of utility programs into the new directory; otherwise, they must be COPYed, as described for files. If you have XCOPY in DOS 3.1, use it; it can copy an entire directory tree recursively to another directory. 6. Now create the hole by deleting all of the files and removing all of the directories found in step 4. Their space on the hard disk is now returned to the DOS "free pool". You should now have a contiguous hole of unused file clusters adjacent to the system files, ready to be used. 7. Now try the following steps to transfer the new system files: a) SYS your hard disk. There's room in the FAT for the new, larger system files, so this should work. b) If that didn't work, try this: Set the old system files on your hard disk to Normal attributes, then delete them. Try SYS again. c) If that still doesn't work, simulate SYS manually. Do this: Make a bootable DOS disk with the 3.3 system files on it. (This is just for protection, so that you don't screw up your 3.3 master boot disk.) Set the new system files on this bootable disk to Normal attributes. COPY the new system files into the root directory of your hard disk. Verify with your FAT lister that the system files have gone to the right place, which is at the very beginning of the FAT. If they didn't, continue as if they did, then proceed to (d). Reset the system files on your hard disk to RHS. d) SYS your hard disk one more time. The new system files should now be in the proper place, with the proper attributes, i.e. they should work OK. 8. Finally, clean up the mess you created in step 5 by renaming files & directories, etc., to whatever you want to call them. This is the procedure I've used in the past, with much success. One thing that I do now as a matter of course that you might consider is to create and maintain a "system file buffer" file, which is simply a blank file about 30K large which lies contiguous with the two system files. Whenever I have to upgrade, I simply delete this buffer file, install the new system files, then re-create the buffer file in what remains of the hole. Of course, it gets fragmented, since the hole has shrunk somewhat. This is not a problem, though; I simply run a disk defragmenter (Vopt), and it rearranges everything all nice and neat and contiguous again, ready for the next release of DOS. May you find this information to be useful. If you have any questions, comments, flames, or cash donations, you may reach me at wang@cs.uiuc.edu. Eric Wang wang@cs.uiuc.edu