TencentOS Server 3.X/TencentOS Server 4.X
1. Run the following command to edit the file /etc/default/grub.
2. Press i to switch to the edit mode, locate the line GRUB_CMDLINE_LINUX, and add kernel parameters in the format of "name=value" to the end of GRUB_CMDLINE_LINUX. For example, the kernel parameter to be added is systemd.debug-shell=1.
3. Press Esc, enter :wq, save the file, and return to the command line.
4. Run the following command to regenerate the kernel configurations.
grub2-mkconfig -o /boot/grub2/grub.cfg
5. Run the following command to restart the instance.
6. Run the following command to check whether the modification is successful.
If the returned result includes the added parameter, the addition is successful.
1. Run the following command to edit the file /etc/default/grub.
2. Press i to switch to the edit mode, locate the line GRUB_CMDLINE_LINUX_DEFAULT, and add kernel parameters in the format of "name=value" to the end of GRUB_CMDLINE_LINUX_DEFAULT. For example, the kernel parameter to be added is systemd.debug-shell=1.
3. Press Esc, enter :wq, save the file, and return to the command line.
4. Run the following command to regenerate the kernel configurations.
grub-mkconfig -o /boot/grub/grub.cfg
5. Run the following command to restart the instance.
6. Run the following command to check whether the modification is successful.
If the returned result includes the added parameter, the addition is successful.
1. Run the following command to add a kernel parameter.
grubby --update-kernel=ALL --args="systemd.debug-shell=1"
2. Run the following command to verify whether the addition is successful.
If the added parameter is included as shown in the following figure, it indicates that the addition is successful.
3. Run the following command to restart the instance.
4. Run the following command to check whether the modification is successful.
If the returned result includes the added parameter, the addition is successful.
1. Run the following command to add a kernel parameter.
grubby --update-kernel=ALL --args="systemd.debug-shell=1"
2. Run the following command to verify whether the addition is successful.
If the added parameter is included as shown in the following figure, it indicates that the addition is successful.
3. Run the following command to restart the instance.
4. Run the following command to check whether the modification is successful.
If the returned result includes the added parameter, the addition is successful.
Note:
This method applies to recent RHEL distributions, such as TencentOS Server 3.1 and TencentOS Server 3.2.
This method uses the traditional GRUB approach similar to that in CentOS 7, which reads configuration parameters from /etc/default/grub by default.
TencentOS Server 3.X/TencentOS Server 4.X
1. Run the following command to open the /etc/default/grub file.
2. Press i to switch to the edit mode, locate the line GRUB_CMDLINE_LINUX, and add kernel parameters in the format of "name=value" to the end of GRUB_CMDLINE_LINUX. For example, the kernel parameter to be added is systemd.debug-shell=1.
3. Press Esc, enter :wq, save the file, and return to the command line.
4. Run the following command to disable the BLSCFG feature.
sed -i "s/GRUB_ENABLE_BLSCFG=true/GRUB_ENABLE_BLSCFG=false/g" /etc/default/grub
5. Run the following command to regenerate the kernel configurations.
grub2-mkconfig -o /boot/grub2/grub.cfg
6. Run the following command to restart the instance.
7. Run the following command to check whether the modification is successful.
If the returned result includes the added parameter, the addition is successful.