Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 08-12-2005, 02:39 PM   #1
LQ Newbie
Registered: Aug 2005
Posts: 1

Rep: Reputation: 0
Determine os install directory

I'm writing a program and I need to know the install location of linux as well as root and boot partitions. I'm getting root and boot from /etc/mtab, but I can't find a good way to always determine where the os is installed. This recently caused me to wipe out one of my systems that was booting from a small partition on a windows drive and had the os installed on a separate disk. Also with the recent addition of /dev/mapper to the 2.6 kernel, it's making my life a little harder. Something that accomplishes the analog of the windows environment variables "windir" "SystemRoot" and "SystemDrive" would be what I'm looking for.
Old 08-12-2005, 03:10 PM   #2
LQ Guru
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 125Reputation: 125
The distribution currently running is installed in /. It's always going to be /. What are you trying to do with this information?
Old 08-12-2005, 11:48 PM   #3
Registered: Feb 2004
Location: Southampton, England
Distribution: Laptop:Gentoo-i686-2.6.9-r9 Desktop:Slackware10 2.4.26
Posts: 298

Rep: Reputation: 30
if mtab or fstab says /boot is on /dev/hda1 and / is on /dev/hda3, then that's where they're always going to be.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to determine # files in a directory ElricM Linux - Newbie 9 01-24-2012 03:37 PM
Bash scripting and trying to determine whether a directory exists? obelxi Programming 9 04-19-2005 12:22 AM
telling `make install` to install in a specific directory?!? black hole sun Linux - Software 3 02-08-2005 10:18 PM
Determine Executable Starting Directory codeblue Programming 4 10-17-2003 11:11 AM
trying to determine the size of all files in a directory riddlebox80 Programming 7 06-11-2003 08:27 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:20 PM.

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