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 - Software
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 08-12-2005, 01:39 PM   #1
Jebrew
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, 02:10 PM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
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, 10:48 PM   #3
0pal_t0ad
Member
 
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.
 
  


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 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 02:37 PM
Bash scripting and trying to determine whether a directory exists? obelxi Programming 9 04-18-2005 11:22 PM
telling `make install` to install in a specific directory?!? black hole sun Linux - Software 3 02-08-2005 09:18 PM
Determine Executable Starting Directory codeblue Programming 4 10-17-2003 10:11 AM
trying to determine the size of all files in a directory riddlebox80 Programming 7 06-11-2003 07:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:10 AM.

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