Linux can use solid state. The method of mounting a solid state drive is: 1. Disassemble the chassis, find the m.2 ssd slot, insert the solid state drive and tighten the screws; 2. Pass "sudo fdisk -l " command to view hard disk information and create a mounting directory; 3. Format the hard disk to be mounted and edit the "/etc/fstab" file; 4. Execute the "sudo reboot" command to restart the service.
#The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.
Can Linux use solid state?
Ubuntu system mounts solid state drive
Applicable scenarios:
Ubuntu operating system is installed On a mechanical hard drive, a solid-state drive needs to be mounted to speed up code compilation.
(1) Install solid state drive
Tools: Phillips screwdriver and screws
Instructions: Disassemble the chassis, find the m.2 ssd slot, insert the solid state drive and tighten the screws.
(2) Check your own hard disk information
Command: sudo fdisk –l
Instructions: Check the disk capacity size, it is determined that sda is the mechanical hard drive that has been partitioned to install the operating system, and nvme0n1 is the solid-state drive that needs to be mounted.
(3) Create a mounting directory (actually it is a folder in ubuntu)
Command: mkdir directory
Instructions : Use mkdir disk here. After running the command, a folder named disk will appear in home.
(4) Format the hard disk that needs to be mounted
Command: sudo mkfs.ext4 /dev/nvme0n1
Instructions: Prompt to confirm the format, enter Y.
done appears, that is, formatting is completed
(5) Record the UUID of the hard disk to be mounted
Command: sudo blkid
is displayed as shown below:
#Instructions: Copy the UUID of nvme0n1 of the hard disk to be mounted, which will be used below.
(6) Edit the /etc/fstab file
Command sudo nano /etc/fstab
Instructions: Start editing now, because you are using nano edit command, so move the up and down keys on the keyboard to the last line, enter #/dev/nvme0n1
UUID=paste home/mi/disk ext4 defaults 0 0 (the account directory name/mi is missing and the mount is unsuccessful)
(7) Then restart
Command: sudo reboot
(8) Check whether the mounting is successful
Open the home directory, find the disk directory, and the disk icon will appear It is mounted successfully.
You can also command to view
Command: df -h
(9) Add root permissions to the folder
In the terminal, enter sudo chmod 777 -r /home/mi/disk
(10) Command descriptions used and common Linux commands
fdisk: Used to check the number of hard disks and partitions attached to the machine.
mkdir: used to create directories.
mkfs: Used to create a linux file system on a specific partition.
blkid: Used to query the file system type, LABEL, UUID and other information used by the system's block device.
nano/vim: Text editor.
reboot: Restart.
df: Used to display the current disk usage statistics of the file system on the Linux system.
Related recommendations: "Linux Video Tutorial"
The above is the detailed content of Can linux use solid state?. For more information, please follow other related articles on the PHP Chinese website!