Linux CONFIG files

Nov 29, 2005
160
0
0
I'm just wondering if someone could list the common important files that is hardware-specific. Lets say I cloned a working linux harddrive and wants to boot it off another system. HAL takes care of most things but I just want to know the list of files that are expected to change.

Eexample of the list..


  • \etc\FSTAB - drive mountpoints that needs to be modified if needed
    \etc\MTAB - drive mountpoints that needs to be modified if needed
    \X11\Xorg.conf - video that needs to be modified if needed

to be more specific, the other machine with the cloned drive got ATI video card instead of Nvidia which is what I'm using on this one. I managed to modified the FSTAB and MTAB to boot accordingly, but I got no success with the video (it failed to show desktop after running startx command; it returned something like PCI 0:0 something. Will deleting the xorg.conf help ?

Thanks for your help in advance
 

DarkThinker

Platinum Member
Mar 17, 2007
2,822
0
0
Did you reach the point where your system tries to launch X server?
If so and X is crashing, it should offer you that option (making a new xorg.conf file), usually when Xorg.conf is missing or has bad settings Xorg replaces it with something that works for your system after prompting you if you want to do so.
 

Fineghal

Member
Apr 6, 2006
170
0
0
You might need to remove the nvidia drivers and install the ATI ones. I'm assuming you're using the "binary blobs." I'd do that then reconfigure xorg.

I think it's something like dpkg -i rconfigure xserver-xorg or something like that. Been a while since I've done it.


I now realize the pointlessness of posting possibly incorrect CLI commands on the internet. 3 seconds on google gives you the right answer.
 

bersl2

Golden Member
Aug 2, 2004
1,617
0
0
Case sensitivity: using the correct file name now will save a bunch of hair-pulling later.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Keep in mind that HAL is very different in Linux versus in Windows. In Windows HAL is a kernel-level thing.

In Linux the kernel dynamicly adapts itself to new hardware so that a hal like what Windows uses is unnessicary.

In Linux you have a program/daemon called udev combined with linux hotplug to dynamicly detect and configure hardware.

Hal for Linux is a bit higher level thing for desktop applications. You can think of it as a database of current hardware configurations presented to applications via dbus. Dbus is a simple mechanism for applications and subsystems to make annoucements and to communicate to one another.

It's not a big deal, but for boot-up time conifguration of hardware you want to muck around udev.

(udev is something that is relatively new. older Linux systems may not have it.)



Now X.org is a completely different beast from the Linux kernel. Linux has very good dynamic hotplug and configuration support for hardware... X.org has _none_. It's configuration is a bit stone age.

X.org has it's own set of drivers that needs to be configured for it to boot, and of course that is taken care of through the /etc/X11/xorg.conf file.

So for X to work when moving from machine to machine you need to have a mechanism to edit a new xorg.conf file.

Most people end up doing it manually since you only have to do it once for a new machine. But if your moving very often you probably want a setup program to do it automaticly.

To do this in Debian or Ubuntu you can run:
dpkg-reconfigure xserver-xorg

It'll ask a lot of questions... It's easier just to edit xorg.conf manually. Just look for the section containing the video driver and delete the line dealing with PCI stuff (it's not needed) and then replace the driver name with something that will work with your hardware. VESA is unaccelerated video that will work with everything.

A alternative way to do it is to install xdebconfigurator.
You can use that if your building a Debian/Ubuntu image that you want to deploy on many different machines. Or you want to make a livecd or install debian on a USB key or something like that. It will try to reconfigure X on the fly. Usually works.

In the future X.org will tie into the dbus/udev/hal infrastructure to autoconfigure it self and xorg.conf file will be optional. But it doesn't work that way yet.


machine dependant files are....
/etc/X11/xorg.conf
/etc/lilo.conf (if your using lilo)
/boot/grub/menu.lst (if your using grub. This is the default for most systems)
/etc/fstab


Other then that hardware should be autodetected.


Sometimes just moving from one machine to another machine will take no effort.

The problem that occurs is like this....

In Linux you have the /dev/ directory.
This contains files that represent hardware resources, and they are presented in files to make it easy for programmers to interact with them.
for example:
/dev/null -- blackhole, you redirect output from programs to make that output 'go away'.
/dev/zero -- file of infinate zeroes.
/dev/input/mice -- mouse output


Harddrives are represented by...
/dev/hd? -- IDE harddrives.
/dev/sd? -- SCSI harddrives.

Then /dev/hd?? or /dev/sd?? represent partitions on those drives... so /dev/hda1 would be the first partition on the first IDE harddrive.

/dev/sdb4 would be the fourt partition on the 2nd scsi drive.

Now with modern SATA drives, USB mass storage, some IDE drivers and other things end up using the Linux kernel SCSI subsystem. So they end up _appearing_ as SCSI drives to userland. So they appear as /dev/sd** whatever.

So the problem happens when these files are referenced in /etc/fstab and then you move that harddrive or image to a different machine and then the order of things change. If the order changes then the filenames change and thus the system won't boot anymore.

To fix it you boot up in knoppix or whatever and edit /etc/fstab and then edit the kernel parameters in /boot/grub/menu.lst to the correct values.

Now with GRUB or Lilo things can get a bit hairy also. They are independant from the Linux kernel so they have their own paticular way to find partitions and such. So often they need to be fixed. I am not sure there is a easy way to deal with that sort of thing.


Now for a perminate solution to the /etc/fstab and kernel boot time parameters is made avaible to us by Udev.

The /dev/sd** stuff is more or less legacy thing. People use it because it works and people are familar with it. With the introduction of Udev those /dev names can be (and are) dynamicly created and realy you can easily (more or less) change how udev works so that those /dev/ files can be anything.

So if your building a linux image that will be working on a wide veriaty of hardware you can reference filesystems by file system label or by UUID.

Also you can change udev rules so that instead of having a partition show up as /dev/sdc3 or whatever it can show up as a /dev/rootdrive or whatnot.

That way you can migrate from machine to machine and not have a issue finding root.

Except for the whole bootloader problem, which I am not sure about the correct way to deal with that.

Hope all that makes sense.
 

xSauronx

Lifer
Jul 14, 2000
19,582
4
81
Originally posted by: drag

To do this in Debian or Ubuntu you can run:
dpkg-reconfigure xserver-xorg

fwiw, this will *not* work by default in Etch, i found out the hard way recently
(dont ask, and yay for lynx )

You first have to comment out a line in /var/lib/dpkg/info/xserver-xorg.postinst

if [ -z "$UPGRADE" ] || dpkg --compare-versions "$2" le "1:7.0.14"; then

more details
 
Nov 29, 2005
160
0
0
DarkThinker, Fineghal, bersl2, drag, xSauronx..

THANK YOU ALL so much for your quick and friendly assistance *hugs* to u all

YES.. dpkg-reconfigure xserver-xorg under "root" does the job That is one nice command !

Thanks again and FYI.. i was running elive v6.6 on my P4 (Intel 2.4ghz, 768MB ram, GeoforceMX440) and now I'm running the same exact image (using Acronis True Image) on a P3 ( 800 mhz, 128MB ram, Nvidia TNT2). After I got to the desktop via that wonderful dpkg command, I also had to log-in as ROOT and modify the FSTAB / MTAB and then re-activate the ETH0.

Thanks again mates

MyElive6.6 desktop screenshot --> http://i60.photobucket.com/albums/h13/stickypookie/screenshot3.png?t=1176473137
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |