Free Disk Necessary To Retructure A File

Scott Walker ScottWalker at RAMSystemsCorp.com
Sat Jul 26 17:58:14 PDT 2008


Is the performance of SCSI vastly superior over SATA in a Linux server
with multiple users?

Scott Walker
RAM Systems Corp.
ScottWalker at RAMSystemsCorp.com
Ph: (704) 896-6549




-----Original Message-----
From: John Esak [mailto:john at valar.com] 
Sent: Saturday, July 26, 2008 7:55 PM
To: 'Scott Walker'
Cc: filepro-list at lists.celestial.com
Subject: RE: Free Disk Necessary To Retructure A File


Yeah, this is little known ... so I'm glad it helps you out.  Howver,
customers should *always* upgrade their servers!  :-)  And, seriously,
if they are using a system with only 400MB free these days... that is
not enough... just on GP's.  Everyone talks about needing 10% free disk
space at the very least.  I like to have 50% free whenver I can get it..
.and today with 500Gb SATA drives costing $105!!!! Well, it's cheaper
and easier to have lots of space than it ever was.  By the way, I still
and will probably forever support and suggest SCSI over SATA, just using
that as an example.


John


> -----Original Message-----
> From: Scott Walker [mailto:ScottWalker at RAMSystemsCorp.com]
> Sent: Saturday, July 26, 2008 7:48 PM
> To: john at valar.com
> Cc: filepro-list at lists.celestial.com
> Subject: RE: Free Disk Necessary To Retructure A File
> 
> John,
> 
> Thank you much.  I never realized that's how it worked.  I always 
> thought if you had a 500mb file and you were adding 100mb to it, then 
> you would need 1.1gb free to do it.  I thought it copied stuff from 
> the "old" key file to a new bigger one, and then deleted the old key 
> file. Thus since there would be an instant in time where both the 
> "old" key file existed and the new one existed, just before it deleted

> the old one I would need enough disk space for both.
> 
> This is really a case of the customer causing the problem.  I have 
> been telling them for (3) years that they must upgrade their server.
> 
> Thanks again for the info.
> 
> Regards,
> 
> Scott
> 
> Scott Walker
> RAM Systems Corp.
> ScottWalker at RAMSystemsCorp.com
> Ph: (704) 896-6549
> 
> 
> 
> 
> -----Original Message-----
> From: John Esak [mailto:john at valar.com]
> Sent: Saturday, July 26, 2008 7:31 PM
> To: 'Scott Walker'
> Cc: filepro-list at lists.celestial.com
> Subject: RE: Free Disk Necessary To Retructure A File
> 
> 
> Yes,
> In the case of *adding* characters to a file... you only need the 
> entire disk space available (including the original file) to be the 
> size of the "resulting" file.  so, if your file takes up 500MB and you

> have a 600MB disk.... you can only add 100MB more to that file, 
> however you do the math. If you take the very same 500MB file and try 
> to "remove" characters from it... the program will break and your data

> will be lost... and everything bad will happen, because in this case 
> you would need at least the size of the original file in free disk 
> space *before* you start the shuffle operation.
> 
> Actually, in such a situation, I think filePro's free disk free check 
> would complain and say the re=shuffle could not be done, rather than 
> destroy your data, but I wouldn't chance this. :-)  Do the calculating

> yourself first... or you will end up having to break out of the define

> program, or carefully roll lback all of your changes. Yikes, it would 
> just be a hassle.
> 
> John
> 
> P.s. Even though with the "in-place" re-define thing you don't need a 
> duplicate size area of free space available as the size of your final 
> file to do a shuffle that adds characters... I would hope that you 
> would have a few extra bytes more than the final restructured size 
> free for safety's sake.  I don't know who safety is, but he likes 
> extra on everything.
> 
> John
> 
> 
> > -----Original Message-----
> > From: Scott Walker [mailto:ScottWalker at RAMSystemsCorp.com]
> > Sent: Saturday, July 26, 2008 6:38 PM
> > To: john at valar.com
> > Cc: 'filePro_List'
> > Subject: RE: Free Disk Necessary To Retructure A File
> >
> > John,
> >
> > So are you saying that if I had 10 million bytes free on my disk 
> > drive, I could add a field to a file with 400mb as long as the 
> > resulting file was not more than 10mb larger.
> >
> > In other words, I don't need free disk space to be anywhere near the

> > size of the file I am restructuring.
> >
> > Regards,
> >
> > Scott
> >
> >
> > Scott Walker
> > RAM Systems Corp.
> > ScottWalker at RAMSystemsCorp.com
> > Ph: (704) 896-6549
> >
> >
> >
> >
> > -----Original Message-----
> > From: John Esak [mailto:john at valar.com]
> > Sent: Saturday, July 26, 2008 6:32 PM
> > To: 'Scott Walker'
> > Cc: filepro-list at lists.celestial.com
> > Subject: RE: Free Disk Necessary To Retructure A File
> >
> >
> > <top posted question about file size in re-define>
> >
> > You are right, You have plenty to spare.
> >
> > I hate working in MB's... much better to work with the actual byte 
> > size of the files and not worrry about converting to millions and 
> > then
> 
> > dividing by 1024*1024, etc.  If you simply  add 20 to the 2837 
> > (which you are heading for, (because the Define files program does 
> > not display the extar 20 byte header needed for each record), giving

> > you 2857 and multiply this times 159,000 + 1 (for the extra 0th 
> > record which is also commonly forgotten... you end up with 454265857

> > bytes of
> 
> > space needed to
> 
> 
> 
> 
> > hold the new file... and that is really all you need.
> >
> > Ken wrote the Define Files routine that adds characters, to do it 
> > "in place". In other words you just move the end of file marker to 
> > the highest point the file will require after the new full size is 
> > calculated, and then writing all the records one by one from the end

> > of the file to their new position starting backwards from the end of

> > the file.  A nice, efficient way to make a file bigger back in the 
> > days when disk space was at a huge premium.
> >
> > So, you really have plenty of room for your addition.
> >
> > If you were to *shrink* the file on the other hand (take away 
> > characters from any field), this trick is not employed so you would 
> > need the full new size of the file in free space, at least, for the 
> > "temp" file which would be created and then moved into place.
> >
> > John
> >
> >
> >
> > > -----Original Message-----
> > > From: filepro-list-bounces+john=valar.com at lists.celestial.com
> > > [mailto:filepro-list-bounces+john=valar.com at lists.celestial.com] 
> > > On Behalf Of Scott Walker
> > > Sent: Saturday, July 26, 2008 3:25 PM
> > > To: 'filePro_List'
> > > Subject: Free Disk Necessary To Retructure A File
> > >
> > > I just want to make sure...
> > >
> > > I have a key file that is 436mb.
> > >
> > > I am going to restructure it, changing the record length from 2735

> > > to 2837
> > >
> > > I have 159,000 records in this file.
> > >
> > > I have 515mb of free disk space.
> > >
> > > I think I have enough disk space to do this.
> > >
> > > Am I right?
> > >
> > > Regards,
> > >
> > >
> > > Scott
> > >
> > >
> > > Scott Walker
> > > RAM Systems Corp.
> > > ScottWalker at RAMSystemsCorp.com
> > > Ph: (704) 896-6549
> > >
> > >
> > >
> > > _______________________________________________
> > > Filepro-list mailing list Filepro-list at lists.celestial.com
> > > http://mailman.celestial.com/mailman/listinfo/filepro-list




More information about the Filepro-list mailing list