LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 12-01-2005, 01:51 AM   #1
binarybob0001
Member
 
Registered: Dec 2004
Distribution: Debian Wheezy
Posts: 444

Rep: Reputation: 30
A thread of my various problems (I'm changing from Windows)


Hi, I end up with so many problems, that I decided to make myself a special thread, instead of hogging the thread title space. I switched from Windows to Linux only a couple of months ago and am trying to adjust. I'll just keep piling on problems here as I get them. Here is the first two.
1. The shutdown -h now command does not poweroff the computer automatically. What do I need to compile into the kernel to make this work?
2. I had a problem unmounting one of my hard drives a while ago. I received the device is busy error. I looked on the web and found that lsof will list all open files. The drive was mounted with the command mount -t vfat /dev/hdb2 /mnt/backup. I ran the lsof | grep backup test and discovered that bash on tty1 was using the file! I actually tried to kill bash but that did not work. What happened and can this be avoided in the future?
Thanks everyone.
 
Old 12-01-2005, 02:19 AM   #2
GrueMaster
Member
 
Registered: Aug 2005
Location: Oregon
Distribution: Kubuntu.
Posts: 848

Rep: Reputation: 30
Ok, first, don't be afraid to create a new thread when you have a new question. That's the only way they will get noticed by peole (like me) that look for 0 reply help questions.

Second, you should edit your profile to specify which distribution you are running, as there can be some major differences in low level operations (like general file paths, etc). At least add that to each post when you start a new thread/question.

Ok, basic forum usage aside, I'd like to welcome you to the growing cult of Linux (can we now be concidered a religion?). To answer your questions:

1. "shutdown -h now" will do just that. The -h means to halt the system, not power it off. Use either "shutdown -P now", or alternatively (depending on your distribution), just type "poweroff". The reason for the halt (without powering off) is that older systems that didn't support acpi poweroff function calls, or servers with external raid arrays and power supplys, can't simply "poweroff", thus, they are put in a state of no executions allowed (halted).

2. Bash is just the shell script that you are using (think command prompt in dos/windows). The reason it was showing up in lsof, was you were probably in a directory on the drive you had mounted (or at least one of your shells was). Each time you start a new shell terminal, you run a new copy of bash (or tcsh, there are actually quite a few different shells depending on user preference). Type "pwd" to see what your current working directory is, and "ps" to see what your current processes are for the shell window you have open (it will list every process running in the background that are "owned" by that shell).

I hope this has been helpful. The best way to learn is from others and to ask questions.
 
Old 12-01-2005, 07:01 AM   #3
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,545

Rep: Reputation: 57
Quote:
1. "shutdown -h now" will do just that. The -h means to halt the system, not power it off. Use either "shutdown -P now", or alternatively (depending on your distribution), just type "poweroff". The reason for the halt (without powering off) is that older systems that didn't support acpi poweroff function calls, or servers with external raid arrays and power supplys, can't simply "poweroff", thus, they are put in a state of no executions allowed (halted).
I use shutdown -h now to power off my PC and you can too for only $2.95 + postage! You just need the correct modules loaded for your mobo and acpi and it'll work fine. If the above solution works though then who cares, as long as what you want to happen happens in the end.
 
Old 12-02-2005, 01:18 AM   #4
binarybob0001
Member
 
Registered: Dec 2004
Distribution: Debian Wheezy
Posts: 444

Original Poster
Rep: Reputation: 30
Thank you for the welcome! I tried the shutdown command as you wrote it, and the parameter -P is not recognized. I checked the man pages and saw nothing of the sort in it. I'll remember to travel back down to the root directory when unmounting drives next time. Could my shutdown command be out of date? Here are another couple of questions.
3. How can I allow other users to shutdown my computer without giving them access to the sbin directory?
4. After compiling a program from source, the entire code and compiled programs are usually contained under /usr/src. Where should I move the compiled programs? Should I keep the source code? What can I do about program dependency problems?
5. I have learned how to partition, format and mount my drives. How can I lookup up the space remaining on a hard drive or the space used? How can I do that with individual folders?
 
Old 12-02-2005, 01:43 AM   #5
GrueMaster
Member
 
Registered: Aug 2005
Location: Oregon
Distribution: Kubuntu.
Posts: 848

Rep: Reputation: 30
The shutdown command I am using is parto of the SysVinit packages in Mandriva. I'm not sure where Slackware gets their shutdown command, or what the differences are (obviously there are differences). It has been almost 8 years since I used Slackware, I'll have to download a copy and install it on my test system.

That aside, I really do need to point out that posting new questions to existing threads reduces the visability of your questions.

Going forward:

3. It can be configured through your login manager, if you are using XWindows logins. If you are using standard console shell logins, you can either look for a usermode set of utilities that include a poweroff command (Mandriva has a package for this specifically), or you can change the permissions of the /sbin/poweroff command to run sudo (not recommended) and create a symbolic link to /usr/bin.

4. Depending on the program, it should have an installation script as part of the makefile, or a separate shell script. If the program has a configure script that you ran prior to typing make, then just type "make install" to install all of the program's data and support files. If it is a single executable, just copy it to the /usr/bin directory.

5. The space remaining on a drive can be determined with the "df" command. "df -h" will give you a listing of all mounted drives, their partition size, the amount used, and the amount available. You can also specify which directory you want if you are only looking for a specific partition (i.e. df -h /boot for my boot partition that has just the kernel and initrd files). You can use the du command to get the usage for a directory (includes all of it's subdirectories on the local filesystem). Both commands use the -h parameter to print in human readable format (i.e. 780M as opposed to 798476 in 1k blocks).
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
FC4 Problems thread: Post your problems here hkl8324 Fedora 73 09-19-2005 04:24 AM
Linux Thread Questions and Problems esi-eric Linux - Software 1 07-28-2004 12:21 PM
configure qt thread issue (just compiled qt w/ -thread option) cleff Linux - Software 8 05-07-2004 11:11 PM
Discussion thread: What does Windows do better than Linux and how do we get there? invictus General 77 08-27-2003 08:19 AM
Compiling Problems - New Thread ryanstrayer Linux - General 12 02-14-2002 02:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration