Thanks,
Xiao
Sent via Deja.com http://www.deja.com/
Before you buy.
It's not generally necessary. Maybe it was needed on some ancient Unixes,
and it has become part of the collective consciousness of sysadmins. It
certainly can't hurt, so there's been little reason for those who learned
it to stop doing it or stop passing it on.
--
Barry Margolin, bar...@genuity.net
Genuity, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
> I am told by the system administrator that before I
> reboot a Solaris box, I need to do sync twice. Why
> twice? Also, I checked on a book which says reboot
I thought tradition had it as 3 syncs?
> command will make sync system call. Then why do I need
> to call sync anyways?
Paranoia. I believe this was common practice when disks
were large and clunky. The time taken to type "sync" 3
times generally guaranteed that everything was flushed.
Or am I just making this up?
hth
t
--
Eih bennek, eih blavek.
"Let us weigh the gain and the loss in wagering that God is. Let us consider
the two possibilities. If you gain, you gain all; if you lose, you lose
nothing. Hesitate not, then, to wager that He is."
better safe than sorry, a wise maxim for any Unix bod.
steven
Tony Curtis <tony_c...@yahoo.com> wrote in message
news:87snq12...@limey.hpcc.uh.edu...
Paranoia. I believe this was common practice when disks were
large and clunky. The time taken to type "sync" 3 times generally
guaranteed that everything was flushed.
Or am I just making this up?
I could swear I've actually read this someplace in an old manual, but
looking through my library, I couldn't place it. Now it's pretty much
just Unix folklore than in the old days you typed 'sync;sync;sync;halt'.
Anyway, it was necessary in the early days to run sync before halting
the system. For instance, this very early man page from version 4 unix:
SYNC(VIII) SYNC(VIII)
NAME
sync update the super block
SYNOPSIS
DESCRIPTION
executes the system primitive. If the system is to be
stopped, must be called to insure file system integrity.
See sync(II) for details.
SEE ALSO
sync(II)
--
Allen Garvin
Internet Administrator
S!XTYFOOTSP!DER
aga...@sixtyfootspider.com
Jerry
Tony Curtis wrote:
> >> On Thu, 12 Oct 2000 20:05:57 GMT,
> >> double...@my-deja.com said:
>
> > I am told by the system administrator that before I
> > reboot a Solaris box, I need to do sync twice. Why
> > twice? Also, I checked on a book which says reboot
>
> I thought tradition had it as 3 syncs?
>
> > command will make sync system call. Then why do I need
> > to call sync anyways?
>
> Paranoia. I believe this was common practice when disks
> were large and clunky. The time taken to type "sync" 3
> times generally guaranteed that everything was flushed.
>
> Or am I just making this up?
>
>
--
Jerry Jorgenson
je...@j3iss.com
http://www.j3iss.com/
>I am told by the system administrator that before I reboot a Solaris
>box, I need to do sync twice. Why twice? Also, I checked on a book
>which says reboot command will make sync system call. Then why do I
>need to call sync anyways?
Folklore from the days before there was a "reboot" system call
which can do the syncs for your, or if it gets really fancy
unmount all the mounted file systems it can, and wait for the
system to become quiet.
As for two syncs, on some versions it may have been the case
that a 2nd sync would block on any buffer that was waiting
to finish writing. So, the first sync starts all the dirty
buffers being written and the 2nd can't finish until they're
done. If the system is otherwise quiet, there won't be any
new dirty buffers.
This is just a guess though. On the early systems I got to
see managed, there wasn't "reboot". So, the sequence was
three syncs then press the halt switch.
>
>Thanks,
>Xiao
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.
>
--
Alan Rollow al...@nabeth.cxo.dec.com
Of course, Pascal's Wager is a fallacy.
But still, a point well taken in this case.
--
Jefferson Ogata : Internetworker, Antibozo
<og...@antibozo-u-spam-u-die.net> http://www.antibozo.net/ogata/
whois: jo...@whois.networksolutions.com
> Paranoia. I believe this was common practice when disks
> were large and clunky. The time taken to type "sync" 3
> times generally guaranteed that everything was flushed.
Just noticed sync is executable by regular users on Solaris 2.7,
has this always been the case with the various unices?
--
Joe Morris, SysAdmin and Not Insane
Atlanta stories: http://www.olagrande.net/users/jolomo/atlanta.html
For SunOS back to 3.X (that's as far as I go), yes.
Yes also for misc. 680x0 BSD-based OS's back to 1984.
Memory fails me for Vax-based 4.x BSD; I wouldn't have known
about sync back then, anyway, I was just a luser. :-)
--
Jay Lessert Portland, Oregon USA j...@teleport.com
I can't remember it not being generally executable in the 20 years I've
been using Unix. Its impact is pretty minor, and I think many early
systems had a daemon that ran sync every 10 or 20 minutes automatically.
Joe Morris <jol...@og1.olagrande.net> wrote:
Just noticed sync is executable by regular users on Solaris 2.7,
has this always been the case with the various unices?
For SunOS back to 3.X (that's as far as I go), yes.
With the help of Bob Supnik's pdp-11 emulator, I can go back a wee bit
further and show this from version 5 (in 1974):
PDP-11 simulator V2.3d
sim> at rk0 unix_v5_rk.dsk
sim> boot rk0
@unix
login: root
# ls -l /bin/sync
-rwxr-xr-x 1 bin 144 Nov 26 18:13 /bin/sync
It's a mixture of paranoia, misunderstanding, and plain old magical
thinking, I'd guess.
> Also, I checked on a book
> which says reboot command will make sync system call. Then why do I
> need to call sync anyways?
You don't need to do it at all. I regularly just type "reboot" at a
root prompt on my test systems here. It syncs and reboots as you'd
expect.
--
James Carlson, Internet Engineering <james.d...@east.sun.com>
SUN Microsystems / 1 Network Drive 71.234W Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757 42.497N Fax +1 781 442 1677
Second Edition now available - http://people.ne.mediaone.net/carlson/ppp
>Paranoia. I believe this was common practice when disks
>were large and clunky. The time taken to type "sync" 3
>times generally guaranteed that everything was flushed.
Evi Nemeth's sysadmin book sez:
sync; sync; halt
... the reason being that when the first sync returns, buffers
have been scheduled to be written, but aren't actually guaranteed
to have been written. The second sync (however) won't start
until the first completes.
But (agreed) modern versions of halt seem to do the necessary
syncing on their own, unless you tell them otherwise.
--
-- Paul A. Sand | I'm not smart enough to be happy
-- University of New Hampshire | about thinking that hard.
-- p...@unh.edu | (Larry Wall, comp.lang.perl)
-- http://pubpages.unh.edu/~pas |
double...@my-deja.com wrote:
>
> I am told by the system administrator that before I reboot a Solaris
> box, I need to do sync twice. Why twice? Also, I checked on a book
> which says reboot command will make sync system call. Then why do I
> need to call sync anyways?
You don't. The "reboot" command does the sync for you.
Hope this helps,
Don
--
********************** You a bounty hunter?
* Rev. Don McDonald * Man's gotta earn a living.
* Baltimore, MD * Dying ain't much of a living, boy.
********************** "Outlaw Josey Wales"
http://members.home.net/oldno7
Modern systems have this daemon too. Solaris has fsflush. Tru64 has
/sbin/update. Linux has kflushd and kupdate (I'm not sure which does the sync
thing). FreeBSD has (syncer). The syncs are more like every 30 seconds.
Jeff Ortega wrote:
> Barry Margolin wrote:
> > Joe Morris <jol...@og1.olagrande.net> wrote:
> > >Just noticed sync is executable by regular users on Solaris 2.7,
> > >has this always been the case with the various unices?
> >
> > I can't remember it not being generally executable in the 20 years I've
> > been using Unix. Its impact is pretty minor, and I think many early
> > systems had a daemon that ran sync every 10 or 20 minutes automatically.
> Modern systems have this daemon too. Solaris has fsflush. Tru64 has
> /sbin/update. Linux has kflushd and kupdate (I'm not sure which does the sync
> thing). FreeBSD has (syncer). The syncs are more like every 30 seconds.
FreeBSD isn't a UNIX system, Jeff.
Happy to have cleared things up for you,
Neither is Linux. Let us know when you have something relevant to say.
Jeffrey Ortega wrote:
> Reverend Don Kool patiently explained:
> > Jeffie Ortega erred:
> > > Barry Margolin wrote:
> > > > Joe Morris <jol...@og1.olagrande.net> wrote:
> > > > >Just noticed sync is executable by regular users on Solaris 2.7,
> > > > >has this always been the case with the various unices?
> > > > I can't remember it not being generally executable in the 20 years I've
> > > > been using Unix. Its impact is pretty minor, and I think many early
> > > > systems had a daemon that ran sync every 10 or 20 minutes automatically.
> > > Modern systems have this daemon too. Solaris has fsflush. Tru64 has
> > > /sbin/update. Linux has kflushd and kupdate (I'm not sure which does the sync
> > > thing). FreeBSD has (syncer). The syncs are more like every 30 seconds.
> > FreeBSD isn't a UNIX system, Jeff.
> Neither is Linux.
Exactly, Jeff.
> Let us know when you have something relevant to say.
Sorry but you'll have to get your mommy or someone to interpret for
you, Jeff. I don't have time to hold your hand and help you with
your reading comprehension.
Yours in the glory that is our Lord Jesus Christ,
I don't know about the rest of you guys, but I just started reading this
newsgroup 3 days ago, and I'm already killfiling this guy. I haven't
once seen him post something useful or intelligent. Just trolls all day.
Moshe
--
jehsom@ angband.org cc.gatech.edu polter.net shaftnet.org nullity.dhs.org
wreck.org bellsouth.net resnet.gatech.edu burdell.org yo.dhs.org gooning.org
usa.net togetherweb.com; gte741e mj116 @prism.gatech.edu; jacobsonconsulting@
usa.net; ICQ 1900670
I don't know about the rest of you guys, but I just started
reading this newsgroup 3 days ago, and I'm already killfiling
this guy. I haven't once seen him post something useful or
intelligent. Just trolls all day.
Well, I just got back on Usenet after a couple years absense, and I
find him an amusing person with whom to argue.
> In article <8scdas$apu$2...@news-int.gatech.edu>,
> I don't know about the rest of you guys, but I just started
> reading this newsgroup 3 days ago, and I'm already killfiling
> this guy. I haven't once seen him post something useful or
> intelligent. Just trolls all day.
> Well, I just got back on Usenet after a couple years absense, and I
> find him an amusing person with whom to argue.
Likewise. I took a two year hiatus after finishing my
book on Linux systems administation (with the obvious title) and
found that we'd attracted a pet troll to toy with.
It's sort of like that rambunctious puppy that chews up everything but
is irresitable to kick around (gently) 'cause the stupid little
creature enjoys it so much.
"James T. Dennis" wrote:
> Allen Garvin <aga...@abraxas.cpsgroup.com> wrote:
> > I don't know about the rest of you guys, but I just started
> > reading this newsgroup 3 days ago, and I'm already killfiling
> > this guy. I haven't once seen him post something useful or
> > intelligent. Just trolls all day.
>
> > Well, I just got back on Usenet after a couple years absense, and I
> > find him an amusing person with whom to argue.
>
> Likewise. I took a two year hiatus after finishing my
> book on Linux systems administation (with the obvious title) and
> found that we'd attracted a pet troll to toy with.
translation: Jimmy's daddy cut off his AOL account for two years.
Yours in Christ,
>I am told by the system administrator that before I reboot a Solaris
>box, I need to do sync twice. Why twice? Also, I checked on a book
>which says reboot command will make sync system call. Then why do I
>need to call sync anyways?
The system administrator is wrong.
Any vaguely modern unix-like OS will sync the disks on a reboot. The time
you need to manually sync an OS is if you need to stop the machine without
shutting it down (ie hitting Stop-A on a Sun).
The sync;sync;reboot idea dates back to before OSs were sure to do it
themselves. The sync command will return before it's actually finished
sync'ing the disks. On at some versions of unix, the second sync would
block until the first one finished, insuring that the disks were sync'd
before the machine halted.
--
**************************************************************************
* Michael T Pins | mtp...@visi.com *
* keeper of the nn sources | mtp...@icaen.uiowa.edu *
* ftp://ftp.visi.com/users/mtpins | #include <std.disclaimer> *
>Tony Curtis <tony_c...@yahoo.com> wrote:
>>> command will make sync system call. Then why do I need
>>> to call sync anyways?
>> Paranoia. I believe this was common practice when disks
>> were large and clunky. The time taken to type "sync" 3
>> times generally guaranteed that everything was flushed.
>Just noticed sync is executable by regular users on Solaris 2.7,
>has this always been the case with the various unices?
Yes.
In fact, on SunOS, you'll find an account named "sync" with no password
that has /bin/sync as it's shell.
Heh. Hadn't thought about that in years.
This used to be a favorite location for a backdoor by the era's crackers.
Shawn