WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [SOLVED] Instant shutdown of the live CD  (Read 2434 times)

Offline Ulysses_

  • Full Member
  • ***
  • Posts: 232
[SOLVED] Instant shutdown of the live CD
« on: September 15, 2011, 08:28:40 AM »
Can TC shutdown somehow be made instant?  Using it as a live CD without any backup.

Even better, can TC be made to instantly go to the boot-up sequence, skipping the shutdown?
« Last Edit: September 15, 2011, 10:58:36 AM by Ulysses_ »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11619
Re: Instant shutdown of the live CD
« Reply #1 on: September 15, 2011, 10:36:26 AM »
Hi Ulysses_
Quote
Can TC shutdown somehow be made instant if TC is used as a live CD without any backup?

Even better, can TC be made to instantly go to the boot-up sequence and skip the shutdown?
The shut down process probably includes flushing the write buffers to the disk and closing any
open files. So if you just downloaded a bunch of files using Firefox for example, and you decided
to perform one of the two actions quoted above, you stand a chance of corrupting or losing one
or more of those files. The basic message being, if you will be doing any I/O on a real drive then
these would be two really bad things to try.

Offline Ulysses_

  • Full Member
  • ***
  • Posts: 232
Re: Instant shutdown of the live CD
« Reply #2 on: September 15, 2011, 10:40:48 AM »
But there is no hard drive, it is a live CD.  How do I prevent files from being closed and bufffers from being flushed etc?  Should I kill the VM from the host and that is the only way?

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Instant shutdown of the live CD
« Reply #3 on: September 15, 2011, 10:47:58 AM »
If the hardware solution (reset button) is not available, reboot -f or the sysrq-b key combo should be near instant.
The only barriers that can stop you are the ones you create yourself.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11619
Re: Instant shutdown of the live CD
« Reply #4 on: September 15, 2011, 10:54:37 AM »
Hi Ulysses
If you don't have any writable drives mounted you won't have a problem. You gave very little
information in your original post.
Quote
How do I prevent files from being closed and buffers from being flushed etc?
You don't want to prevent this. Flushing the buffers means to finish writing any data that is
temporarily stored in RAM to the drive. Files are supposed to be closed after your done reading
or writing them. These functions are performed transparently for you.

I don't know anything about VMs so can't comment on that.

Offline Ulysses_

  • Full Member
  • ***
  • Posts: 232
Re: Instant shutdown of the live CD
« Reply #5 on: September 15, 2011, 10:56:22 AM »
Thanks, "reboot -f" works very well (files open are in ramdisks). 

Just seen reboot also has an -n option that says "do not sync".   What does this do?


Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Instant shutdown of the live CD
« Reply #6 on: September 15, 2011, 10:57:54 AM »
Avoids syncing your disks. If the VM has no hd's, it's a fast operation.
The only barriers that can stop you are the ones you create yourself.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11619
Re: [SOLVED] Instant shutdown of the live CD
« Reply #7 on: September 15, 2011, 11:08:52 AM »
Hi Ulysses_
Quote
Just seen reboot also has an -n option that says "do not sync".   What does this do?
It skips flushing the buffers and closing any open files.

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: [SOLVED] Instant shutdown of the live CD
« Reply #8 on: September 15, 2011, 06:53:12 PM »
The question of what is the fasted way to force a reboot when not having to flush the buffers is something I've resolved for myself in the following ways:

"real" hardware (e.g. a notebook running on mains supply, this is to not needlessly wear down the battery by constant charge and discharge cycles): I just literately "pull the plug" (i.e. disconnection of the power supply for a fraction of a second is enough). The "v2.0" of this approach is an additional switch I've put into the mains cable that runs into the AC adaptor, as this switch can be placed into a more easy to reach position.

VirtualBox VMs: The (virtual) "Reset button" is the 'Host Key - R' keyboard short cut (with a default host key to be the right 'Ctrl' key).

QEMU VMs: Changing to the QEMU monitor (with the 'Ctrl-Alt-2' keyboard short cut), and then issuing a 'system_reset' command. Whilst that might not look like much of a savings compared to a 'sudo reboot -f', but as one can use the command completion feature of the QEMU monitor I just have to type "s y tab r tab" (i.e. five keystrokes), plus if I have to repeat this reset I can easily use the history function of the QEMU monitor (e.g. via the Up key).
« Last Edit: September 16, 2011, 05:27:50 PM by maro »

Offline Ulysses_

  • Full Member
  • ***
  • Posts: 232
Re: [SOLVED] Instant shutdown of the live CD
« Reply #9 on: September 16, 2011, 08:31:36 AM »
Thanks. It was a command line implementation that was being looked for so it can go inside scripts.  Final aim: to defeat trackers and other anonymity breakers by opening web page links in new VMs and automatically disposing of old VM's. And automatically switching user interface from VM to VM in an almost transparent manner using remote X or vnc derivatives.