Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
2) If you forget/can't/don't shutdown properly, wait for the fsck (file system check) process to finish -- it's trying to figure out if something went wrong during the last improper shutdown.
You can skip these steps only if you move to a different filesystem, such as ext3/ReiserFS/etc., that does journaling, but even then there are no absolute guarantees !
erm, you could stop it checking the systems on boot by replacing the numebrs at the end of the relevant line in /etc/fstab to "0 0", but that's a VERY stupid thing to do, and someone who sees fit to do that deserves every FAT corruption they deserve. it's not reasonable to expect a computer to happily survive for ever by pulling the plug literally.
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233
Rep:
hmm, correct me if i'm wrong, but the halt command usually just halts the os even on computers that DO switch themselves off when the os shuts down, (to actually turn off the machine, you have to call 'poweroff' or 'shutdown -h now' or select 'halt' from the graphical login screen for x) all you really have to do is issue a halt command, wait for the OS to shut properly down, THEN it will be safe to switch the computer off, the only thing different is it simply says "system halted' (or something like that) instead of a "it is now safe to switch off your computer" splash screen like in mac or windows, give it a try
Yo, MasterC, why you don't wanna turn off your computer the right way?, too lazy?,
Besides doing the shutdown command, you can just reboot, and as soon as you do it then you can pull the plug.
The problem is that while your computer is running normally, the heads on your hardrives are not in a shutdown position. You see, your hardrive never stop spinning when your computer is on, but the head do stand still at time when there is nothing being read or written onto the hardrive. When you shutdown properly, your computer sends orders to the hardrive that it's gonna shutdown, and the heads are positioned in shutdown position (away from the hardrive), and when your computer is working normal it's ontop of the hardrive disks. If you just pull the plug out, the heads remain there ontop of the disks. The problem is that these heads are flexible because they have spings that help move them. If the heads are powered down, these spring can slowly give up stretch. If this happens, and your heads are ontop of the disk, this will cause a major head crash in your hardrive when you turn your computer on, because the heads will be touching the hardrive disks. And of course, because hardrive manufactures know this, they make very good springs and inside parts...you would hope at least, but even highly unlikely...you do it enough times and it will happen. It may depend on what kind of hardrive you have.
Anyway, really you don't want to keep shutting down the hardway.
Thanks for all the replies. I am not using the PC that is in my signature line. I am using an ultra cheap mobo with ultra cheap parts. I am not sure what "ACPI" is.
See I don't have a screen, or a mouse. I use this PC as an MP3 Player in my truck. All I do is play MP3's with it. But it's hard to issue a shutdown or any command while I am driving. I use XMMS and can press "B" to go to the next track, but that's about it. Oh and "X" to get it playing. If I do issue a shutdown command, it has to be once I have stopped and am in the driveway. So then I have to wait the 30 or 45 seconds for the PC to shutdown before I can shutoff the Power Inverter and finally the truck.
The only thing I use the hard drive for is to play MP3's.
If anyone knows an easier way to do this and still be able to switch songs with 1 button commands, please let me know. I don't know how to make MACROS so I can't use a 1 button shutdown either. That would be just fine if I could do something like that.
Well the main thing that goes wrong is when it's still trying to write to the drive when you shut it down cold. Since it's just an mp3 player you could get away with only reading from the drive. Might even want to mount the drives in read only mode. If you are just reading from the drive then it shouldn't be a problem to shutdown cold and you can disable checking the filesystems on boot the way acid_kepie suggested.
The only thing that might get written to is /tmp and /var. You could get around that by making a ramdrive and mounting /tmp and /var there. Once you have gotten everything running properly you could probably turn off most of the error logging to save a lot of space in your ramdrive. You could even switch off syslog all together if you want. Depending on how far you've stripped down your linux distribution, the only other things that will be written to /var is just a few pid of several daemons that are running. Since you aren't shutting down properly anyways you wouldn't really need those either. But they take up practically no space at all so leaving them wouldn't be a disaster.
Just out of curiosity what kind of distribution are you running? And what kind of steps have you gone through to get it to boot up as fast as possible? Since it's just a dedicated mp3 player you can go quite far into skipping a bunch of stuff that is not needed.
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233
Rep:
you do know how to issue a time delayed shutdown command, right?
shutdown -h (x minutes), just enter that in on a seperate virtual console for however many minutes you need for travel time, not quite an elegant solution, but it should work. another solution would be to chain the command to invoke the mp3 player and the shutdown command into the same line with a ';' eg
[user@hostname /directory]$ *mp3 player*; halt
someone correct me if i'm wrong, but the halt command shouldn't be carried out by the computer until the mp3 player quits so when driving all you have to do is issue a quit command to mp3 player which probably is a one button (or maybe two) command then the system will shut down automatically
Thanks for all the ideas, I have ended up going with the following config:
I still boot into X but this time into gnome instead, it seems to be about 3 seconds faster than KDE. Plus it has an option to set what programs start at boot. So I have an xterm starting up at 25 (whatever that means, I think microseconds) and then I have ran the command
xmms;reboot
And since this is the last command I ran, all I have to do on each consecutive boot is push the arrow up key and it runs the command again for me. Then about 5 seconds before I get to my driveway I press "ALT+F4" and it shuts down xmms and runs the command "reboot" and restarts the PC. I think I am going to take it 1 step further, instead of xmms;reboot I think I will run a xmms;shutdown -h But am not sure how to yet (unless that is the command, huh huh). Cool, thanks for all the great ideas.
By the way I am down to about a 25 second boot up time now! Not too bad from a minute and 10 or so.
Just a question, but why are you using X? If all you use it for is just an MP3 player then you don't need gnome and x for that. I'm sure you could get that 25 seconds to 10 or less if you don't use X and maybe a few other optimilisations.
The shutdown command usually needs a time attribute. You can use the 'now' keyword to make it shutdown instantly.
Ex. 'shutdown -h now'
Cool, thanks for the shutdown command. I boot into X because I know XMMS only uses 1 key to move from song to song, and to pause etc. mpg123 seems to want me to type the entire filename including path to get it to play a song. Unless I am wrong?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.