Difference between revisions of "Configure System Settings"

From gr0x0rd
Jump to navigation Jump to search
Line 3: Line 3:
 
Windows users will be familiar the registry, which stores system settings in a proprietary database spanned across two files named ''system.dat'' and ''user.dat''. Both of these files are susceptible to corruption, tampering and security issues, and a Windows system cannot boot without them. Almost every setting in a Linux system is stored in a text-based configuration file stored somewhere within the filesystem. All of these files are accessible from a command prompt and can be modified using a simple text editor such as [http://www.nano-editor.org/ nano].
 
Windows users will be familiar the registry, which stores system settings in a proprietary database spanned across two files named ''system.dat'' and ''user.dat''. Both of these files are susceptible to corruption, tampering and security issues, and a Windows system cannot boot without them. Almost every setting in a Linux system is stored in a text-based configuration file stored somewhere within the filesystem. All of these files are accessible from a command prompt and can be modified using a simple text editor such as [http://www.nano-editor.org/ nano].
  
= Using nano =
+
=== Using nano ===
  
 
* Open files for writing using the command '''nano -w /path/to/file'''
 
* Open files for writing using the command '''nano -w /path/to/file'''
Line 10: Line 10:
 
* Save the file and exit nano using '''Ctrl-x'''
 
* Save the file and exit nano using '''Ctrl-x'''
  
# before setting up the new environment we need to copy over the network settings
+
To set the system time zone, you can create a symbolic link to the file relating to your region stored in ''/usr/share/zoneinfo/''. In this example I use the Canada Pacific (Vancouver) setting.
 
+
'''#''' unlink /etc/localtime
cp -L /etc/resolv.conf /mnt/gentoo/etc/
+
'''#''' ln -s /usr/share/zoneinfo/Canada/Pacific /etc/localtime
 
+
There are many options in Linux for setting the system clock. By setting the clock to ''local'', it will read the time from the system BIOS. It is also important to set the timezone here as well.
# in order to compile the kernel in the new environment we need to mount the dev and proc systems
+
'''#''' nano -w /etc/conf.d/clock
 
+
'''file: /etc/conf.d/clock'''
mount -t proc none /mnt/gentoo/proc
+
CLOCK="local"
mount -o bind /dev /mnt/gentoo/dev
+
...
 
+
TIMEZONE="America/Vancouver"
# now, we enter the new environment.
+
Your system's hostname is stored in the file ''/etc/conf.d/hostname''.
 
+
'''#''' nano -w /etc/conf.d/hostname
chroot /mnt/gentoo /bin/bash
+
'''file: /etc/conf.d/hostname'''
env-update && source /etc/profile
+
HOSTNAME="yourcomputersname"
 
 
# now we set the system time zone. in this example I use the Canada Pacific (Vancouver) setting.
 
 
 
unlink /etc/localtime
 
ln -s /usr/share/zoneinfo/Canada/Pacific /etc/localtime
 
 
 
nano -w /etc/conf.d/clock
 
 
 
# make the following changes:
 
 
 
CLOCK="local"
 
TIMEZONE="America/Vancouver"
 
 
 
 
 
# as usual, ctrl-x then y to exit nano. now, let's set our networking info.
 
 
 
nano -w /etc/conf.d/hostname
 
 
 
HOSTNAME="yourcomputersname"
 
  
 +
Copy over the current network settings.
 +
'''#''' cp -L /etc/resolv.conf /mnt/gentoo/etc/
 
# we also need to configure the domain.
 
# we also need to configure the domain.
  

Revision as of 18:46, 17 November 2010

Installing Gentoo - Configure System Settings

Windows users will be familiar the registry, which stores system settings in a proprietary database spanned across two files named system.dat and user.dat. Both of these files are susceptible to corruption, tampering and security issues, and a Windows system cannot boot without them. Almost every setting in a Linux system is stored in a text-based configuration file stored somewhere within the filesystem. All of these files are accessible from a command prompt and can be modified using a simple text editor such as nano.

Using nano

  • Open files for writing using the command nano -w /path/to/file
  • Search for text using Ctrl-w (press Ctrl-w again to find next instance)
  • Delete an entire line of text using Ctrl-k
  • Save the file and exit nano using Ctrl-x

To set the system time zone, you can create a symbolic link to the file relating to your region stored in /usr/share/zoneinfo/. In this example I use the Canada Pacific (Vancouver) setting.

# unlink /etc/localtime
# ln -s /usr/share/zoneinfo/Canada/Pacific /etc/localtime

There are many options in Linux for setting the system clock. By setting the clock to local, it will read the time from the system BIOS. It is also important to set the timezone here as well.

# nano -w /etc/conf.d/clock

file: /etc/conf.d/clock

CLOCK="local"
...
TIMEZONE="America/Vancouver"

Your system's hostname is stored in the file /etc/conf.d/hostname.

# nano -w /etc/conf.d/hostname

file: /etc/conf.d/hostname

HOSTNAME="yourcomputersname"

Copy over the current network settings.

# cp -L /etc/resolv.conf /mnt/gentoo/etc/
  1. we also need to configure the domain.

nano -w /etc/hosts

127.0.0.1 yourcomputersname.domain.com yourcomptuersname localhost

  1. exit nano. to start networking automatically at boot,

rc-update add net.eth0 default

  1. have numlock enabled at startup.

rc-update add numlock default

  1. now its time for some system configuration. first, we need to create our fstab.

nano -w /etc/fstab


  1. gr0x0rd's fstab

/dev/sda1 /boot ext2 noauto,noatime,user 1 2 /dev/sda3 / ext3 noatime 0 1 /dev/sda2 none swap sw 0 0 /dev/cdrom /mnt/cdrom auto noauto,user 0 0

  1. /dev/fd0 /mnt/floppy auto noauto 0 0
  1. glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for
  2. POSIX shared memory (shm_open, shm_unlink).
  3. (tmpfs is a dynamically expandable/shrinkable ramdisk, and will
  4. use almost no memory if not populated with files)

shm /dev/shm tmpfs nodev,nosuid,noexec 0 0



  1. now, lets set the root password.

passwd