Article Directory
1. Check the hard disk
First, check the devices recognized by the system. In other words, I want to know how many hard drives ubuntu found. Use the command: lsblk
to display the results as follows:
There are two hard disks: nvme0n1 and nvme1n1. These two hard drives each have two partitions. Among them, the three partitions of nvme0n1 have been mounted, and the partitions are mounted under /boot/efi, /, and /home respectively. And nvme1n1 is not mounted.
Second, find nvme1n1
We use the command sudo fdisk -l, you can see the following information
from which you can know nvme1n1
3. Mount
Enter the command: sudo mount /dev/nvme1n1 /develop to mount /dev/nvme1n1 to /home. From then on, /home represents the 285.7G of the mechanical hard disk and solid-state hard disk.
Of course, you can first perform some partition settings on the hard disk, such as deleting partitions or creating new partitions, and then mount them. Use the sudo fdisk /dev/nvme1n1 command to set it up. After entering this command, there will be a detailed help document to guide the operation. But remember: After the operation is completed, it must be formatted, and it can only be mounted after formatting. Otherwise, the following error will be prompted
telpo@telpo-Dell-G15-5510:/$ sudo mount /dev/nvme1n1 /develop
mount: /develop: wrong fs type, bad option, bad superblock on /dev/nvme1n1, missing codepage or helper program, or other error.
The formatted command is: sudo mkfs -t ext4 /dev/nvme1n1
Now, lsblk again, you will find that the hard disk has been successfully mounted:
Fourth, modify the partition file
The above steps are not enough, you will find: After restarting, the hard disk is gone again. You need to modify the /etc/fstab file to ensure that the mount is still valid after reboot. The format of this file is as follows:
telpo@telpo-Dell-G15-5510:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/nvme0n1p2 during installation
UUID=87586a5f-b1ed-43b4-b960-00a89ee092cf / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/nvme0n1p1 during installation
UUID=21E3-491D /boot/efi vfat umask=0077 0 1
# /home was on /dev/nvme0n1p3 during installation
UUID=5e60a10d-485d-498f-ba81-56531597fa83 /home ext4 defaults 0 2
/swapfile none swap sw 0 0
#/develop was on/devv/nvme1n1
UUID=4d91d47f-5608-4a6c-b50a-210684e9a308 /develop ext4 defaults 0 2
That is, you need to fill in six items including file system, mount point, type, options, dump, and pass. Among them, mount point is our mount point /data/; type is our formatted file format, ext4; options is generally defaults; dump is 0, pass is also 0, unless the mount point is /. The only thing we have to think about is the UUID. Use the command: sudo blkid /dev/nvme1n1 to get the UUID:
/dev/nvme1n1: UUID=“4d91d47f-5608-4a6c-b50a-210684e9a308” BLOCK_SIZE=“4096” TYPE=“ext4”
Therefore, we add a line under the fstab file:
UUID=4d91d47f-5608-4a6c-b50a-210684e9a308 /develop ext4 defaults 0 0
Save and exit. Test it with sudo mount -a.