Detail 1: Boot partition and Cdrom boot mount correctly
After installing Gentoo Linux according to the Gentoo manual, the partition configuration file /etc/fstab should look like this, as shown in the manual example.
/dev/sda2 /boot ext2 defaults,noatime 0 2
/dev/sda3 none swap sw 0 0
/dev/sda4 / ext4 noatime 0 1
/dev/cdrom /mnt/cdrom auto noauto,user 0 0
Copy the code
If /dev/sda2 is not in ext2 format, you cannot mount /dev/sda2 to /boot. If /dev/sda2 is in ext2 format, you cannot mount /dev/sda2 to /boot. Although the system can be started, the existing kernel files and boot files on /dev/sda2 cannot be found in /boot. And with this configuration, Cdrom does not automatically mount and open. So we made the following details to automatically mount the boot partitions /dev/sda2 and cdrom correctly after startup.
1. Edit the partition configuration table /etc/fstab to ensure that the /dev/sda2 boot partition can be mounted correctly and the cdrom starts automatic mounting.
~ # nano -w /etc/fstab
Copy the code
2. Create a directory/MNT /cdrom and mount cdrom to the directory.
~ # mkdir /mnt/cdrom
~ # mount /dev/cdrom /mnt/cdrom
Copy the code
Detail 2: Predictable naming rules for the network interface name change to traditional eth0
After gentoo Linux is installed according to the manual, the network interface name of the system is named according to the predictable network device naming rules. The virtual nic on the VMware VM is named ENO16777736, which is different from the traditional network interface name eth0 in the manual. The network does not start properly after the restart. Some prefer traditional interface names. Can I change the network interface name to a traditional interface name? B: Sure.
1. Edit the /etc/default/grub configuration file and add the statement GRUB_CMDLINE_LINUX=”net.ifnames=0 “(in any line) to forcibly disable the predictable network device naming rules (enabled by default). If the sentence already exists in the configuration file, add something like net.ifnames =0 in quotes.
~ # nano -w /etc/default/grub
Copy the code
2. Run the grub-mkconfig command in the shell to update kernel boot parameters.
~ # grub-mkconfig -o /boot/grub/grub.cfg
Copy the code
Detail 3: Add the sudo command for the administrator user
After the system is installed, add an administrator user and try to manage the system as the administrator user. Do not log in as the root user unless necessary. = = = = = = = = = = = = = = = = = = = = = = = =
1. Install sudo.
~ # emerge --ask app-admin/sudo
Copy the code
2. Edit the /etc/sudoers file, copy root ALL=(ALL) ALL, and change root to user name zhangsan so that user Zhangsan can obtain root permission.
~ # nano -w /etc/sudoers
Copy the code
Detail 4: Correct garbled characters displayed in the output of shell system
Real terminals do not support the display of Chinese characters (only Chinese characters can be displayed in terminal emulators such as Terminal under XWindow), and Chinese characters show garbled characters (small squares) in terminals. Modify the LANG environment variable to make the system output information in English and correctly displayed on the terminal; Of course, when the user typed Chinese into the document, the document editor (such as Nano) opened on the terminal would still display only garbled characters (small squares).
~ # export LANG=en_US
Copy the code
Detail 5: Time synchronization
Using the date command to view the time, the system time may not be consistent with the local time. To set the system time to Beijing time, install and configure the time synchronization server NTP.
1. Install the NTP server.
~ # emerge ntp
Copy the code
2. Edit the /etc/ntp.conf configuration file and change the time center to China National Time Center.
~ # nano -w /etc/ntp.conf
Copy the code
3. Finally, add the time synchronization service NTPD to the boot.
~ # rc-update add ntpd default
Copy the code
Enjoy Yourself!
Reference documentation
[1], Linux network card naming rules
[2], NTP server configuration under Gentoo
[3] Nodiratime, noatime