develooper Front page | perl.beginners | Postings from December 2002

RE: Umount / mnt

Paul Kraus
December 5, 2002 05:39
RE: Umount / mnt
Message ID:

> How much data are you writing to /mnt/backup whilst it's mounted?

When it completed a lot. Some machines have 20 some gigs worth of
However right now all that I am is about 115 mb. But even then its just
the first time. All the following times its just looking for newer files
and there are none. So nothing is copied. Its on these tests that the
umount is failing.

> Usually, the kernel buffers writes in memory before actually 
> performing them, so as to smooth out any big spikes and make 
> the whole system feel faster.  When you unmount a filesystem, 
> all of these writes have to be committed, and this can give 
> you a noticeable pause if it's being done over a slow link.  
> The next time you have this problem, check whether there's 
> much traffic on the network.

I thought this may be the case however when I realised I wasn't coping
any files I realised the buffers would be empty.
> Things to try:
> 1) Run sync every so often during your Perl script.  This 
> will force the kernel to commit any outstanding changes, so 
> it won't have quite so much work to do when you unmount.
> 2) Have the Perl script open all files O_SYNC (you'll need to 
> switch to sysopen rather than standard open then, though).
> 3) Use the sync option when mounting the filesystem.
> 4) Have the Perl script call SYS_fsync function on any file 
> descriptors to files on the remote machine before closing them.

What does O_SYNC and sysopen do?
I thought sync just dumped the buffers what does syncing when the drive
is mounted accomplish? I am also clueless on SYS_fysnc. Sorry for my
ignorance but I have only made my way though learning perl. I have
purchased mastering regular expressions (per the books recommandation)
and plan on working through programming perl next.

Paul Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About