The ups and downs of installing dual-system Ubuntu on win11

Previously it was always installed on one hard drive, this is two disks.

My computer is HP Shadow Elf 8 Pro

1. Preparations before installation

1.1 Remember to close Bitlocker first

Enter win+s and enter in the search box: device encryption settings

Insert image description here
Insert image description here

1.2 BIOS settings (for HP computers, press F10 when starting up)

When I turn on my computer, I press F10 to enter BIOS mode. The interface of the game laptop is different from ordinary ones.

Enter the interface, click on the startup options, hold down the mouse on the USB flash drive/USB hard disk and pull it up to the first one to prioritize USB startup.
Insert image description here

1.3 Allocate hard disk space

1. If your computer has a single hard disk, allocate space from the last disk to Ubuntu. Select the disk, right-click, select Compress Volume, and enter the amount of compressed space.
2. If your computer has dual hard drives, you need to first separate a blank partition on the C drive (the Windows system startup disk, which is the first hard disk) to install the Ubuntu startup items. . Then allocate space from the last disk to Ubuntu. Select the disk, right-click, select Compress Volume, and enter the amount of compressed space.
The startup item here can allocate 512M or 1024M or 2048M
Insert image description here

2. Install Ubuntu

2.1 (See another article about how to create a system disk)

At this

Insert image description here

Insert image description here

2.2 Select Simplified Chinese (default) and click to install Ubuntu

Insert image description here

2.3 Keyboard layout (default)

Insert image description here

2.4 Choose minimal installation

If you want to engage in deep learning and run code, the minimum is the minimum. Otherwise, you can install it normally. Check other options according to your own needs. I did not check them:
It is recommended to select the two arrows pointing to
Insert image description here

2.5 Select the installation type. It is recommended to choose other options and partition by yourself.

Note: When installing dual systems here, you must choose other options.
When installing a virtual machine in VMware, you must choose the first one to install Ubuntu and Windows to coexist a>
Insert image description here

2.6 Partition

Insert image description here

2.6.1 EFI system partition

A single hard disk can be partitioned into a free partition. For dual hard disks, add a logical partition to the first system disk for the EFI system partition. The remaining partitions are operated in the same way as single and double hard disks.
500M or 1024M or 2048M can be allocated here
Insert image description here

2.6.2 swap exchange space (logical partition)

It serves as the virtual memory of Ubuntu. The general size is about 1 times the physical memory of the computer. It can be divided into 16G, logical partition, and the starting position of the space, which is used for "swap" or "swap space".
Insert image description here

2.6.3 Root directory/ (primary partition)

/: This is the root directory of ubuntu, used to install systems and software. It is equivalent to the C drive of Windows, the main partition, and the starting position of the space. It is used for "ext4 log file system". The mount point is "/" (according to your Adjust the free space. If there is enough space, you can give more. After all, Ubuntu installation software is installed in the root directory by default)

Insert image description here

2.6.4 /home (logical partition)

Equivalent to other Windows disks, the remaining space is allotted to it, the logical partition, the starting position of the space, used for the "ext4 log file system", and the mount point is "/home".

Insert image description here

2.7 Select the location to install startup items

Select the 2.6.1 EFI system partition number for installation. Next is the time zone username and password.

Insert image description here

Finally the installation was successful.

3 A series of settings after installation

3.1 Set startup options

Dual system boot menu
After the dual systems are installed and used normally, there is another problem, that is, the first item in the default dual system boot menu is Ubuntu, and the one I often use is In win11, if you are not careful when the boot menu appears, the system will automatically enter the default options, so you need to change the order. Since Ubuntu is installed after win11 is installed, the boot menu is formed by Ubuntu. This requires modifying the configuration information in Ubuntu. The modification method is as follows:

1. Enter the ubuntu system, hold down the Ctrl Alt T key, and open the command terminal.

2. Enter the command: sudo gedit /etc/default/grub to open the grub file. The 6th line of code is: GRUB_DEFAULT=0, 0 means that it is the first item to start by default, because the item number of the boot menu starts from 0. And my win11 startup item is ranked in the third position, which means that the win11 startup item number is 2, so change 0 to 2 and save.

3. Enter the command: sudo update-grub to update the grub configuration file.

Restart the computer again, and you will find that the above change does not adjust the position of the startup items, but places the highlighted selection bar on the win11 startup items by default. In this way, if you do not press any keys within a few seconds, Start the win11 system directly.

At this point, my win11 and Ubuntu dual systems have been installed correctly. Maybe my own understanding and analysis are wrong in some places, but this is some experience that I have gained while studying online. I want to share it so that others who have the same needs as me can learn from it, learn together, and make progress together!

3.2 Ubuntu changes the Chinese name of the folder in the main folder to English

3.2.1 Method 1

Open the terminal and enter two lines of commands in the terminal:

export LANG=en_US
 
xdg-user-dirs-gtk-update

An interface will pop up, select the option with the word "update" or "Update Name"

A dialog box pops up asking whether to convert the directory into an English path. After selecting, it prompts success!
This is the page
Insert image description here

If you want to change back to Chinese, enter the command in the terminal:

export LANG=zh_CN
 
或者
 
export LANG=zh_CN.utf-8
 
xdg-user-dirs-gtk-update

At this time, a dialog box will pop up again asking, select oldupdate or keep the old name.

A dialog box pops up asking whether to convert the directory into a Chinese path. After selecting, it prompts success!

3.2.2 Method 2

1. Turn on language support in system settings
Insert image description here

2. Drag Chinese to English
Insert image description here
3. Click Apply to the entire system
Insert image description here
4. Log out and log in again, you will be asked whether to keep the old folder name, select "Update Name"

Insert image description here

5. Follow steps 2 and 3 to change the language back to Chinese, log out, and log in. This time select "Keep old name".

3.3 Solve the problem of time inconsistency between Ubuntu22.04 and win11 dual systems

There has always been a problem of time inconsistency when switching systems between Ubuntu and Windows dual systems.

This problem still exists between ubuntu22.04 and win11 dual systems.
It can be solved through the following three-step command.
Enter three commands in the ubuntu terminal:

sudo apt-get install ntpdate
sudo ntpdate time.windows.com
sudo hwclock --localtime --systohc

Effective in actual testing.

Guess you like

Origin blog.csdn.net/qq_42817360/article/details/133720040