kanotix.com

General Support - Live CD: Is shutdown necessary?

anvilhead - 21.05.2006, 23:30 Uhr
Titel: Live CD: Is shutdown necessary?
Hi dudes,

When running from a live Kanotix CD, is it really necessary to wait for the system to "shut down"? If you've mounted any writeable devices, couldn't you just do a sync (as root) to save any data, umount everything, then just turn off the machine?

Cheers, a.
Kano - 21.05.2006, 23:42 Uhr
Titel: Live CD: Is shutdown necessary?
When everything is umounted you can switch off.
slh - 22.05.2006, 00:21 Uhr
Titel: Live CD: Is shutdown necessary?
Although ensuring that really all writeable media is properly umounted definately takes longer than just issuing a proper shutdown... (and it's always bad practice to just yank the power cord, even if it doesn't hurt badly if the conditions depicted above are valid)
anvilhead - 23.05.2006, 03:58 Uhr
Titel: Re: Live CD: Is shutdown necessary?
Zitat:
slh > Although ensuring that really all writeable media is properly umounted definately takes longer than just issuing a proper shutdown...


Not if you haven't mounted anything. :?)

Zitat:
slh > (and it's always bad practice to just yank the power cord, even if it doesn't hurt badly if the conditions depicted above are valid)


Sure, that's what I'd usually think. But when you power down a live-CD session, you're "pulling the plug" on your boot drive (RAMdisk) even when you do let the shutdown finish.

So, while I am enough of a geek to enjoy the display of shut-down progress messages, there are times when I'd rather have the extra 30 seconds or so to do other things. I just wanted to be sure I wasn't overlooking any technical reason not to do it.

Cheers, a.

P.S.: Hey, I just "Vorschau'd" my message before "Absenden-ing" it. :?D
brodders - 24.05.2006, 15:19 Uhr
Titel: RE: Re: Live CD: Is shutdown necessary?
Hi..

if nothing is mounted, powerdown should be safe. But people are things of habit... get used to doing that, and one day you might do it whilst something IS mounted.

If you mount and do a sync, beware that sync timing / buffer flushing is at the fancy of the system. I have known a 30 sec delay from command to disc activity.

And what about Union fs? Does sync aggregate changes and write them out? I hope so, but I don't know.

Hm. If anything had been mounted, I'd follow the usual shutdown process.

brodders
craigevil - 24.05.2006, 21:05 Uhr
Titel: RE: Re: Live CD: Is shutdown necessary?
Depend on whether you have anythiing on HD mounted. My wife uses a LiveCD on an old laptop and just hits the power button all the time never had any problems.

But all she really uses it for is to get online.
anvilhead - 25.05.2006, 00:16 Uhr
Titel: Re: RE: Re: Live CD: Is shutdown necessary?
Zitat:
brodders > If you mount and do a sync, beware that sync timing / buffer flushing is at the fancy of the system. I have known a 30 sec delay from command to disc activity.

You mean sync keeps running in the background after the command line comes back to you?

Zitat:
craigevil > Depend on whether you have anythiing on HD mounted. My wife uses a LiveCD on an old laptop and just hits the power button all the time never had any problems.

That sounds like something my wife would do, even if she wasn't supposed to. (A Master's in education, and she can't connect a VCR to a TV... :?)
brodders - 26.05.2006, 11:42 Uhr
Titel: RE: Re: RE: Re: Live CD: Is shutdown necessary?
Zitat:

Zitat:

brodders > If you mount and do a sync, beware that sync timing / buffer flushing is at the fancy of the system. I have known a 30 sec delay from command to disc activity.

You mean sync keeps running in the background after the command line comes back to you?


..yes.

Well, sync isn't running - but the jobs it creates are placed as tasks on the scheduler, as per usual.

They run when the schedular can get to them - which may be sooner ... or it may be later. sync does not come with a "finished in X seconds" guarenttee.

Don't forget, these systems were NOT originally designed for GUI / human interaction - and they do not anticipate loosing power; so sync assumes the machine will be up for an extended period. It's under no pressure.

Some buffer operations can be long esp. if running a complex database. sync will issue the correct commands as needed to the fs, but all those jobs are ordinary scheduled jobs Smilie

In practice you would be OK 90%+ of the time, but again - I've seen delays into 10's of seconds from giving a command to the system writing to disk. It depends utterly on hardware, tasks, other jobs etc etc.

Perhaps this was why the suites of controlled shutdown code were written??

brodders
anvilhead - 26.05.2006, 22:13 Uhr
Titel: Re: RE: Re: RE: Re: Live CD: Is shutdown necessary?
Zitat:
Well, sync isn't running - but the jobs it creates are placed as tasks on the scheduler, as per usual... They run when the schedular can get to them - which may be sooner ... or it may be later. sync does not come with a "finished in X seconds" guarenttee.

What? Unless a job is specifically run in the background, I always though that the prompt's reappearance indicated that the job was finished. You're saying that's not true?

What about unmounting a drive via KDE's context menu? Are you saying that the "mounted" symbol may be removed from the drive's icon before the drive is actually unmounted? Ack---how can we ever feel safe removing a USB drive? Shouldn't that be pushed to the top of the Urgent Bugs list?

Zitat:
Perhaps this was why the suites of controlled shutdown code were written??

Do I sense some resistance to this topic? That would be funny, because command-line users have always been obsessed with the most efficient, time-saving ways to do everything. I find it hard to believe that people who spend days writing two-letter script commands would be interested in waiting around for a RAM-based session to print all of its "shutdown" details... unless---dare I say it?---the GEEK FACTOR is in effect!

Seriously, though. Let's assume I unmount (not just sync) any physical storage I've mounted. Then, when I "shut down" the system, am I really required to sit there like somebody in a Star Trek episode, watching all those important-looking system messages scroll by? Do I get to say things like, "Captain, a Romulan Bird of Prey has decloaked off the starboard bow!"?

(At this point, I suppose I could also mention those Knoppix startup/shutdown soundfiles, but there's no need to be cruel... Lachen )
brodders - 26.05.2006, 23:45 Uhr
Titel: Re: RE: Re: RE: Re: Live CD: Is shutdown necessary?
Hi anvilhead,

...what I have quoted is the benefit of my limited experience, rather then having read through the kernel code.

And the observation that, after issuing a sync command, disk activity is not always instant.


There may be other reasons for this. For example, filesystem devices might have lied to sync. Imagine that system RAM buffers are flushed to drive hardware, but the drive is managing it's own cache (most drives have 2M cache, often more). It says to sync "OK, I've got that" - not wrong, it's in firmware RAM - but is it on the drive platter yet?

That cache is flushed to disk - when? Does sync do that - does it tell hardware to flush to disk or does sync tell *nix managed RAM buffers to write to the device?

I know that shutdown routines will command the hardware to flush all firmware buffers onto platter.

I cannot confirm that sync will do that; I would like to think so.

What about high level applications? I cannot confirm that anything managed by a high level application (e.g. wordprocessor) will respond to sync. Perhaps it thinks it's the expert at managing its own space.

Sync flushes RAM buffers to the fs. I cannot give warrenty that everything from the user level down to the drive platters and all levels in between will respond to sync.

But... I do believe they will respond to the "system going down" signal issued by shutdown. This will be issued to every task - which _should_ be coded to respond cleanly, as far as they can, to shutdown.


All that is why I use shutdown scripts, or bang in "sync; sync; init 0"

Smilie but I am cautious!
anvilhead - 27.05.2006, 00:25 Uhr
Titel: Re: RE: Re: RE: Re: Live CD: Is shutdown necessary?
Thanks for the info. Actually, I just ran the RC4 live CD, and it doesn't take very long to shut down, does it? So it's not a big deal.

It was a fun thread, though... Okay, I admit it---the whole thing was kind of a joke. We don't always have to be serious here, do we?

"System shutdown initiated." Heh heh!
Alle Zeiten sind GMT + 1 Stunde
PNphpBB2 © 2003-2007