Home >System Tutorial >LINUX >How to partition a Linux disk and view the initial disk status: further steps

How to partition a Linux disk and view the initial disk status: further steps

PHPz
PHPzforward
2024-01-26 22:30:24833browse

Linuxc disk partition and mounting

Check the initial c drive situation:

Method 1: Check the files starting with sd under /dev (ls-/dev/), there is no sdbc disk.

Method 2: Use the fdisk-l command to view the c drive information in the system.

There is no sdbc disk at this time.

1. Create a new c drive

Create a second hard disk sdb.

Turn off the guest machinelinux installation partitionRed flag linux installation, click "Edit Virtual Machine", click "Disk", click "Add", click "Hard Disk", click "Next"

Click "Next"

Click "Next"

Set the maximum C drive size (can be customized according to the notebook video memory), click "Next", and click "Finish".

Click "OK".

linux 安装分区_分区安装win10系统_分区安装系统

Start the client machineLinux installation partition, right-click on the desktop to open the terminal, use the fdisk-l command to find /dev/sdb, that is, the c drive is added successfully.

2: c drive partition

1. Partition /dev/sdb

Command: fdiskc disk device name

#fdisk/dev/sdb (Partition the sdbc disk and download the linux operating system, press the m key for help)

分区安装系统_分区安装win10系统_linux 安装分区

Enter "n" to add a new partition, enter "p" to create a new primary partition (enter "e" to create a new expanded partition), set the partition number (default is 1), start track (default is 2048) and press Enter. , define the space you added (it cannot exceed the remaining space of the c drive, otherwise it will be invalid). After completion, enter "p" to view the partition table. /dev/sdb1 will be displayed, indicating that partition 1 is successfully created.

Enter "w" to save the partition and exit.

3. Low format

Low format command: mkfs

#mkfs-t (specify file type) ext4/dev/sdb1 (low format partition)

Note that expanding the area cannot be done at a low level.

linux 安装分区_分区安装win10系统_分区安装系统

4.Mount partition

Create a new empty directory as a mount point (an entry point for reading and writing the c drive partition)

mount-t (mounted file type) ext4/dev/sdb1 (c drive partition to be mounted)/mnt/sdb1 (mount point/mounted directory)

#mkdir/mnt/sdb1

#mount-text4/dev/sdb1/mnt/sdb

How to confirm that it has been mounted successfully:

Method 1:

分区安装系统_分区安装win10系统_linux 安装分区

mount views the mounting of all file systems (c drive partition) of the system

#mount|grepsdb1

Method 2:

#df-hT Check the mounted status of the c drive partition

Unmount command: umount/mnt/sdb1

Note: Do not operate in the /mnt/sdb1 directory (exit the directory where the mount point is located each time you operate)

The above is the detailed content of How to partition a Linux disk and view the initial disk status: further steps. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:itcool.net. If there is any infringement, please contact admin@php.cn delete