快讯
HOME
快讯
正文内容
linux nand 分区 图 Linux磁盘分区及文件系统格式化和挂载
发布时间 : 2024-10-06
作者 : 小编
访问数量 : 23
扫码分享至微信

Linux磁盘分区及文件系统格式化和挂载

1. 磁盘在Linux系统中的表示方法

硬盘的类型: IDE接口 hda hdb .....

hda1 hda2 hda3 .......

SATA接口 SCSI接口 USB

sda sdb

sda1 sda2 sda3 ......

所有磁盘设备及分区都以文件的形式存储在/dev/,但是这些文件不能直接使用,如果要往这些分区内写入数据就需要挂载分区。

2、挂载点

所谓的挂载点就是文件系统中存在的一个目录,通常情况下,创建在/mnt目录下,挂载成功后,访问挂载点就是访问新的存储设备。

挂载点应该是空目录,否则原来该挂载点中存在的文件将会被隐藏。而且,挂载点在实施挂载操作之前就应该存在。

2、查询设备名

#df -hT 查看系统中所有已挂载文件系统的使用情况

#fdisk -l 查看系统的磁盘信息

打开百度APP,查看更多高清图片

磁盘分区

1、基本磁盘分区:

(1)最多可以分为四个主分区(包含扩展分区:只能有一个,将剩余的所有空间包含在内)。

(2)主分区和扩展分区的编号:1-4为主分区和扩展分区的编号。

(3)扩展分区不能直接使用,必须在扩展分区上建立逻辑分区并格式化后才能使用。

(4)逻辑分区编号从5开始。

(5)对新加的磁盘进行分区:(分2个主分区,1个扩展分区,2个逻辑分区)

fdisk 磁盘设备名

a toggle a bootable flag

b edit bsd disklabel

c toggle the dos compatibility flag

d delete a partition 删除分区

g create a new empty GPT partition table

G create an IRIX (SGI) partition table

l list known partition types 显示所有分区类型

m print this menu

n add a new partition 新建分区

o create a new empty DOS partition table

p print the partition table 显示分区表

q quit without saving changes

s create a new empty Sun disklabel

t change a partition's system id 修改分区类型

u change display/entry units

v verify the partition table

w write table to disk and exit 保存并出退出

x extra functionality (experts only)

(6)对磁盘进行格式化:mkfs -t 分区类型(ext2 ext3 ext4) 磁盘分区名

mkfs -t ext4 /dev/sdb1

(7)新建挂载点,并将分区进行挂载。

mount [-t 文件系统类型] 设备分区名 挂载点

mount -t ext4 /dev/sdb1 /mnt/sdb1

如何查看已经挂载成功:mount (mount | grep sdb1)

取消挂载:umount 挂载点

(8)挂载光驱设备

光驱设备在Linux系统中的表示方法:/dev/sr0

光驱设备文件系统类型:iso9660

将光盘挂载到/mnt/cdrom目录:

(9)永久挂载:使用mount命令挂载只是临时的,如果重启系统后就失效了。

/etc/fstab

[root@www cdrom]# vim /etc/fstab

[root@www cdrom]# mount -a

动态磁盘分区(LVM卷)

3、挂载文件系统

挂载由mount命令来完成,可以灵活的挂载各种类型的文件系统。

命令格式:mount [选项] [设备名] [挂载点]

4、卸载文件系统

文件系统可以被挂载,不用时可以被卸载。卸载文件系统的命令是umount,这个命令可以把文件系统从Linux系统中的挂载点上分离,将原来建立的文件系统和挂载点的连接断掉。

命令格式:umount [设备名或者挂载点]

在卸载一个文件系统的时候,需要指定要卸载的文件系统的挂载点或者设备名。例如:

#umount /dev/sdb1 //指定设备名卸载

#umount /mnt/sdb1 //指定挂载点卸载

如果卸载文件系统提示:“busy状态,不可卸载时”,使用fuser命令查看正在使用该文件系统的用户信息。

命令格式:fuser [options] 文件系统名或者文件名

【举例1】查看哪个进程打开了当前目录下的cdrom文件夹。

[root@localhost~]# fuser /mnt/cdrom

/mnt/cdrom: 71992c

杀死进程的方法:

(1)#kill -9 71992

(2)#fuser -km /mnt/cdrom

5、使用U盘备份文件(ntfs-3g)

(1)连接U盘

(2)查询系统为U盘分配的设备名

(3)挂载U盘

(4)备份文件

(5)卸载U盘

6、扩充系统的硬盘空间

管理员root发现Linux系统硬盘资源不足,因此在服务器上新增加了一块硬盘,想在Linux系统下使用它。通常遵循以下步骤:

(1)向系统中添加一块硬盘

(2)由系统识别硬盘名

(3)对新硬盘进行分区

(4)对分区进行格式化

(5)创建文件系统

(6)挂载使用

7、命令行下提高工作效率的方法

(1)Linux下Shell命令补全功能,按TAB键

(2)命令别名alias

(3)命令历史history

(4)文件系统的自动挂载

#vim /etc/fstab

第1字段:需要挂载的设备文件名。

第2字段:挂载点,必须是一个目录,而且必须用绝对路径。

对于交换分区,这个字段定义为swap。

第3字段:文件系统的类型。如果是ext3文件系统,则写成ext3;如

果是FAT32文件系统,则写成vfat;如果是光盘,可以写成

auto由系统自动检测或iso9660。

第4字段:挂载选项。一般都是采用“defaults”。

第5字段:文件系统是否需要dump备份,1表示需要,0表示忽略。

第6字段:在系统启动时是否检查这个文件系统以及检查的顺序,

0表示不检查,1表示优先检查,2表示其次检查。

如果想要学习更多IT知识,可以移步我们官网,上面有很多免费在线课程哦。

fdisk:Linux 下管理磁盘分区的利器

人人都喜欢用 fdisk,它是 Linux 下管理磁盘分区的最佳利器之一。它可以操作最大 2TB 的分区。

-- Magesh Maruthamuthu

一块硬盘可以被划分成一个或多个逻辑磁盘,我们将其称作分区。我们对硬盘进行的划分信息被储存于建立在扇区 0 的分区表(MBR 或 GPT)中。

Linux 需要至少一个分区来当作根文件系统,所以我们不能在没有分区的情况下安装 Linux 系统。当我们创建一个分区时,我们必须将它格式化为一个适合的文件系统,否则我们就没办法往里面储存文件了。

要在 Linux 中完成分区的相关工作,我们需要一些工具。Linux 下有很多可用的相关工具,我们曾介绍过 Parted 命令 。不过,今天我们的主角是 fdisk。

人人都喜欢用 fdisk,它是 Linux 下管理磁盘分区的最佳利器之一。它可以操作最大 2TB 的分区。大量 Linux 管理员都喜欢使用这个工具,因为当下 LVM 和 SAN 的原因,并没有多少人会用到 2TB 以上的分区。并且这个工具被世界上许多的基础设施所使用。如果你还是想创建比 2TB 更大的分区,请使用 parted 命令 或 cfdisk 命令。

对磁盘进行分区和创建文件系统是 Linux 管理员的日常。如果你在许多不同的环境中工作,你一定每天都会重复几次这项操作。

Linux 内核是如何理解硬盘的?

作为人类,我们可以很轻松地理解一些事情;但是电脑就不是这样了,它们需要合适的命名才能理解这些。

在 Linux 中,外围设备都位于 /dev 挂载点,内核通过以下的方式理解硬盘:

/dev/hdX[a-z]: IDE 硬盘被命名为 hdX/dev/sdX[a-z]: SCSI 硬盘被命名为 sdX/dev/xdX[a-z]: XT 硬盘被命名为 xdX/dev/vdX[a-z]: 虚拟硬盘被命名为 vdX/dev/fdN: 软盘被命名为 fdN/dev/scdN or /dev/srN: CD-ROM 被命名为 /dev/scdN 或 /dev/srN

什么是 fdisk 命令?

fdisk 的意思是 固定磁盘(Fixed Disk) 或 格式化磁盘(Format Disk),它是命令行下允许用户对分区进行查看、创建、调整大小、删除、移动和复制的工具。它支持 MBR、Sun、SGI、BSD 分区表,但是它不支持 GUID 分区表(GPT)。它不是为操作大分区设计的。

fdisk 允许我们在每块硬盘上创建最多四个主分区。它们中的其中一个可以作为扩展分区,并下设多个逻辑分区。1-4 扇区作为主分区被保留,逻辑分区从扇区 5 开始。

如何在 Linux 下安装 fdisk?

fdisk 作为核心组件内置于 Linux 中,所以你不必手动安装它。

如何用 fdisk 列出可用磁盘?

在执行操作之前,我们必须知道的是哪些磁盘被加入了系统。要想列出所有可用的磁盘,请执行下文的命令。这个命令将会列出磁盘名称、分区数量、分区表类型、磁盘识别代号、分区 ID 和分区类型。

$ sudo fdisk -l

Disk /dev/sda: 30 GiB, 32212254720 bytes, 62914560 sectors

Units: sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disklabel type: dos

Disk identifier: 0xeab59449

Device Boot Start End Sectors Size Id Type

/dev/sda1 * 20973568 62914559 41940992 20G 83 Linux

Disk /dev/sdb: 10 GiB, 10737418240 bytes, 20971520 sectors

Units: sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/sdc: 10 GiB, 10737418240 bytes, 20971520 sectors

Units: sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/sdd: 10 GiB, 10737418240 bytes, 20971520 sectors

Units: sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/sde: 10 GiB, 10737418240 bytes, 20971520 sectors

Units: sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

如何使用 fdisk 列出特定分区信息?

如果你希望查看指定分区的信息,请使用以下命令:

$ sudo fdisk -l /dev/sda

Disk /dev/sda: 30 GiB, 32212254720 bytes, 62914560 sectors

Units: sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disklabel type: dos

Disk identifier: 0xeab59449

Device Boot Start End Sectors Size Id Type

/dev/sda1 * 20973568 62914559 41940992 20G 83 Linux

如何列出 fdisk 所有的可用操作?

在 fdisk 中敲击 m,它便会列出所有可用操作:

$ sudo fdisk /dev/sdc

Welcome to fdisk (util-linux 2.30.1).

Changes will remain in memory only, until you decide to write them.

Be careful before using the write command.

Device does not contain a recognized partition table.

Created a new DOS disklabel with disk identifier 0xe944b373.

Command (m for help): m

Help:

DOS (MBR)

a toggle a bootable flag

b edit nested BSD disklabel

c toggle the dos compatibility flag

Generic

d delete a partition

F list free unpartitioned space

l list known partition types

n add a new partition

p print the partition table

t change a partition type

v verify the partition table

i print information about a partition

Misc

m print this menu

u change display/entry units

x extra functionality (experts only)

Script

I load disk layout from sfdisk script file

O dump disk layout to sfdisk script file

Save & Exit

w write table to disk and exit

q quit without saving changes

Create a new label

g create a new empty GPT partition table

G create a new empty SGI (IRIX) partition table

o create a new empty DOS partition table

s create a new empty Sun partition table

如何使用 fdisk 列出分区类型?

在 fdisk 中敲击 l,它便会列出所有可用分区的类型:

$ sudo fdisk /dev/sdc

Welcome to fdisk (util-linux 2.30.1).

Changes will remain in memory only, until you decide to write them.

Be careful before using the write command.

Device does not contain a recognized partition table.

Created a new DOS disklabel with disk identifier 0x9ffd00db.

Command (m for help): l

0 Empty 24 NEC DOS 81 Minix / old Lin bf Solaris

1 FAT12 27 Hidden NTFS Win 82 Linux swap / So c1 DRDOS/sec (FAT-

2 XENIX root 39 Plan 9 83 Linux c4 DRDOS/sec (FAT-

3 XENIX usr 3c PartitionMagic 84 OS/2 hidden or c6 DRDOS/sec (FAT-

4 FAT16 <32M 40 Venix 80286 85 Linux extended c7 Syrinx

5 Extended 41 PPC PReP Boot 86 NTFS volume set da Non-FS data

6 FAT16 42 SFS 87 NTFS volume set db CP/M / CTOS / .

7 HPFS/NTFS/exFAT 4d QNX4.x 88 Linux plaintext de Dell Utility

8 AIX 4e QNX4.x 2nd part 8e Linux LVM df BootIt

9 AIX bootable 4f QNX4.x 3rd part 93 Amoeba e1 DOS access

a OS/2 Boot Manag 50 OnTrack DM 94 Amoeba BBT e3 DOS R/O

b W95 FAT32 51 OnTrack DM6 Aux 9f BSD/OS e4 SpeedStor

c W95 FAT32 (LBA) 52 CP/M a0 IBM Thinkpad hi ea Rufus alignment

e W95 FAT16 (LBA) 53 OnTrack DM6 Aux a5 FreeBSD eb BeOS fs

f W95 Ext'd (LBA) 54 OnTrackDM6 a6 OpenBSD ee GPT

10 OPUS 55 EZ-Drive a7 NeXTSTEP ef EFI (FAT-12/16/

11 Hidden FAT12 56 Golden Bow a8 Darwin UFS f0 Linux/PA-RISC b

12 Compaq diagnost 5c Priam Edisk a9 NetBSD f1 SpeedStor

14 Hidden FAT16 <3 61 SpeedStor ab Darwin boot f4 SpeedStor

16 Hidden FAT16 63 GNU HURD or Sys af HFS / HFS+ f2 DOS secondary

17 Hidden HPFS/NTF 64 Novell Netware b7 BSDI fs fb VMware VMFS

18 AST SmartSleep 65 Novell Netware b8 BSDI swap fc VMware VMKCORE

1b Hidden W95 FAT3 70 DiskSecure Mult bb Boot Wizard hid fd Linux raid auto

1c Hidden W95 FAT3 75 PC/IX bc Acronis FAT32 L fe LANstep

1e Hidden W95 FAT1 80 Old Minix be Solaris boot ff BBT

如何使用 fdisk 创建一个磁盘分区?

如果你希望新建磁盘分区,请参考下面的步骤。比如我希望在 /dev/sdc 中新建四个分区(三个主分区和一个扩展分区),只需要执行下文的命令。

首先,请在操作 “First sector” 的时候先按下回车,然后在 “Last sector” 中输入你希望创建分区的大小(可以在数字后面加 KB、MB、G 和 TB)。例如,你希望为这个分区扩容 1GB,就应该在 “Last sector” 中输入 +1G。当你创建三个分区之后,fdisk 默认会将分区类型设为扩展分区,如果你希望创建第四个主分区,请输入 p 来替代它的默认值 e。

$ sudo fdisk /dev/sdc

Welcome to fdisk (util-linux 2.30.1).

Changes will remain in memory only, until you decide to write them.

Be careful before using the write command.

Command (m for help): n

Partition type

p primary (0 primary, 0 extended, 4 free)

e extended (container for logical partitions)

Select (default p): Enter

Using default response p.

Partition number (1-4, default 1): Enter

First sector (2048-20971519, default 2048): Enter

Last sector, +sectors or +size{K,M,G,T,P} (2048-20971519, default 20971519): +1G

Created a new partition 1 of type 'Linux' and of size 1 GiB.

Command (m for help): p

Disk /dev/sdc: 10 GiB, 10737418240 bytes, 20971520 sectors

Units: sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disklabel type: dos

Disk identifier: 0x8cc8f9e5

Device Boot Start End Sectors Size Id Type

/dev/sdc1 2048 2099199 2097152 1G 83 Linux

Command (m for help): w

The partition table has been altered.

Calling ioctl() to re-read partition table.

Syncing disks.

如何使用 fdisk 创建扩展分区?

请注意,创建扩展分区时,你应该使用剩下的所有空间,以便之后在扩展分区下创建逻辑分区。

$ sudo fdisk /dev/sdc

Welcome to fdisk (util-linux 2.30.1).

Changes will remain in memory only, until you decide to write them.

Be careful before using the write command.

Command (m for help): n

Partition type

p primary (3 primary, 0 extended, 1 free)

e extended (container for logical partitions)

Select (default e): Enter

Using default response e.

Selected partition 4

First sector (6293504-20971519, default 6293504): Enter

Last sector, +sectors or +size{K,M,G,T,P} (6293504-20971519, default 20971519): Enter

Created a new partition 4 of type 'Extended' and of size 7 GiB.

Command (m for help): p

Disk /dev/sdc: 10 GiB, 10737418240 bytes, 20971520 sectors

Units: sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disklabel type: dos

Disk identifier: 0x8cc8f9e5

Device Boot Start End Sectors Size Id Type

/dev/sdc1 2048 2099199 2097152 1G 83 Linux

/dev/sdc2 2099200 4196351 2097152 1G 83 Linux

/dev/sdc3 4196352 6293503 2097152 1G 83 Linux

/dev/sdc4 6293504 20971519 14678016 7G 5 Extended

Command (m for help): w

The partition table has been altered.

Calling ioctl() to re-read partition table.

Syncing disks.

如何用 fdisk 查看未分配空间?

上文中,我们总共创建了四个分区(三个主分区和一个扩展分区)。在创建逻辑分区之前,扩展分区的容量将会以未分配空间显示。

使用以下命令来显示磁盘上的未分配空间,下面的示例中显示的是 7GB:

$ sudo fdisk /dev/sdc

Welcome to fdisk (util-linux 2.30.1).

Changes will remain in memory only, until you decide to write them.

Be careful before using the write command.

Command (m for help): F

Unpartitioned space /dev/sdc: 7 GiB, 7515144192 bytes, 14678016 sectors

Units: sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

Start End Sectors Size

6293504 20971519 14678016 7G

Command (m for help): q

如何使用 fdisk 创建逻辑分区?

创建扩展分区后,请按照之前的步骤创建逻辑分区。在这里,我创建了位于 /dev/sdc5 的 1GB 逻辑分区。你可以查看分区表值来确认这点。

$ sudo fdisk /dev/sdc

Welcome to fdisk (util-linux 2.30.1).

Changes will remain in memory only, until you decide to write them.

Be careful before using the write command.

Command (m for help): n

All primary partitions are in use.

Adding logical partition 5

First sector (6295552-20971519, default 6295552): Enter

Last sector, +sectors or +size{K,M,G,T,P} (6295552-20971519, default 20971519): +1G

Created a new partition 5 of type 'Linux' and of size 1 GiB.

Command (m for help): p

Disk /dev/sdc: 10 GiB, 10737418240 bytes, 20971520 sectors

Units: sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disklabel type: dos

Disk identifier: 0x8cc8f9e5

Device Boot Start End Sectors Size Id Type

/dev/sdc1 2048 2099199 2097152 1G 83 Linux

/dev/sdc2 2099200 4196351 2097152 1G 83 Linux

/dev/sdc3 4196352 6293503 2097152 1G 83 Linux

/dev/sdc4 6293504 20971519 14678016 7G 5 Extended

/dev/sdc5 6295552 8392703 2097152 1G 83 Linux

Command (m for help): w

The partition table has been altered.

Calling ioctl() to re-read partition table.

Syncing disks.

如何使用 fdisk 命令删除分区?

如果我们不再使用某个分区,请按照下面的步骤删除它。

请确保你输入了正确的分区号。在这里,我准备删除 /dev/sdc2 分区:

$ sudo fdisk /dev/sdc

Welcome to fdisk (util-linux 2.30.1).

Changes will remain in memory only, until you decide to write them.

Be careful before using the write command.

Command (m for help): d

Partition number (1-5, default 5): 2

Partition 2 has been deleted.

Command (m for help): p

Disk /dev/sdc: 10 GiB, 10737418240 bytes, 20971520 sectors

Units: sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disklabel type: dos

Disk identifier: 0x8cc8f9e5

Device Boot Start End Sectors Size Id Type

/dev/sdc1 2048 2099199 2097152 1G 83 Linux

/dev/sdc3 4196352 6293503 2097152 1G 83 Linux

/dev/sdc4 6293504 20971519 14678016 7G 5 Extended

/dev/sdc5 6295552 8392703 2097152 1G 83 Linux

Command (m for help): w

The partition table has been altered.

Calling ioctl() to re-read partition table.

Syncing disks.

如何在 Linux 下格式化分区或建立文件系统?

在计算时,文件系统控制了数据的储存方式,并通过 索引节点(Inode Tables) 来检索数据。如果没有文件系统,操作系统是无法找到信息储存的位置的。

在此,我准备在 /dev/sdc1 上创建分区。有三种方式创建文件系统:

$ sudo mkfs.ext4 /dev/sdc1

$ sudo mkfs -t ext4 /dev/sdc1

$ sudo mke2fs /dev/sdc1

mke2fs 1.43.5 (04-Aug-2017)

Creating filesystem with 262144 4k blocks and 65536 inodes

Filesystem UUID: c0a99b51-2b61-4f6a-b960-eb60915faab0

Superblock backups stored on blocks:

32768, 98304, 163840, 229376

Allocating group tables: done

Writing inode tables: done

Creating journal (8192 blocks): done

Writing superblocks and filesystem accounting information: done

当你在分区上建立文件系统时,以下重要信息会同时被创建:

Filesystem UUID: UUID 代表了通用且独一无二的识别符,UUID 在 Linux 中通常用来识别设备。它 128 位长的数字代表了 32 个十六进制数。Superblock: 超级块储存了文件系统的元数据。如果某个文件系统的超级块被破坏,我们就无法挂载它了(也就是说无法访问其中的文件了)。Inode: Inode 是类 Unix 系统中文件系统的数据结构,它储存了所有除名称以外的文件信息和数据。Journal: 日志式文件系统包含了用来修复电脑意外关机产生下错误信息的日志。

如何在 Linux 中挂载分区?

在你创建完分区和文件系统之后,我们需要挂载它们以便使用。我们需要创建一个挂载点来挂载分区,使用 mkdir 来创建一个挂载点。

$ sudo mkdir -p /mnt/2g-new

如果你希望进行临时挂载,请使用下面的命令。在计算机重启之后,你会丢失这个挂载点。

$ sudo mount /dev/sdc1 /mnt/2g-new

如果你希望永久挂载某个分区,请将分区详情加入 fstab 文件。我们既可以输入设备名称,也可以输入 UUID。

使用设备名称来进行永久挂载:

# vi /etc/fstab

/dev/sdc1 /mnt/2g-new ext4 defaults 0 0

使用 UUID 来进行永久挂载(请使用 blkid 来获取 UUID):

$ sudo blkid

/dev/sdc1: UUID="d17e3c31-e2c9-4f11-809c-94a549bc43b7" TYPE="ext2" PARTUUID="8cc8f9e5-01"

/dev/sda1: UUID="d92fa769-e00f-4fd7-b6ed-ecf7224af7fa" TYPE="ext4" PARTUUID="eab59449-01"

/dev/sdc3: UUID="ca307aa4-0866-49b1-8184-004025789e63" TYPE="ext4" PARTUUID="8cc8f9e5-03"

/dev/sdc5: PARTUUID="8cc8f9e5-05"

# vi /etc/fstab

UUID=d17e3c31-e2c9-4f11-809c-94a549bc43b7 /mnt/2g-new ext4 defaults 0 0

使用 df 命令亦可:

$ df -h

Filesystem Size Used Avail Use% Mounted on

udev 969M 0 969M 0% /dev

tmpfs 200M 7.0M 193M 4% /run

/dev/sda1 20G 16G 3.0G 85% /

tmpfs 997M 0 997M 0% /dev/shm

tmpfs 5.0M 4.0K 5.0M 1% /run/lock

tmpfs 997M 0 997M 0% /sys/fs/cgroup

tmpfs 200M 28K 200M 1% /run/user/121

tmpfs 200M 25M 176M 13% /run/user/1000

/dev/sdc1 1008M 1.3M 956M 1% /mnt/2g-new

via: https://www.2daygeek.com/linux-fdisk-command-to-manage-disk-partitions/

作者: Magesh Maruthamuthu 选题: lujun9972 译者: zhs852 校对: wxy

本文由 LCTT 原创编译, Linux中国 荣誉推出

点击“了解更多”可访问文内链接

相关问答

Linux 的磁盘 分区 格式有何区别?

1.磁盘分区格式说明linux分区不同于windows,linux下硬盘设备名为(IDE硬盘为hdx(x为从a—d)因为IDE硬盘最多四个,SCSI,SATA,USB硬盘为sdx(x为a—z)),....

Linux 能在线 分区 吗?

是的,Linux可以在线分区。使用fdisk、parted或gdisk等分区工具,可以在不卸载或重新启动系统的情况下重新分区磁盘。这些工具允许在挂载文件系统的同时创...

linux 读写要怎么 分区 ?

在Linux中,可以使用fdisk命令来进行硬盘的分区。具体步骤如下:打开终端,输入fdisk目标硬盘,例如fdisk/dev/hdd。按"p"键打印分区表,查看目标硬盘是否...

Linux 和Windows的 分区 有什么区别?

其实linux与windows分区是一样的,都有主分区、扩展分区、逻辑分区,只是他们的目录结构不一样,所以导致表现形式也不一样。winodws是森林型目录结构,它有很多...

深入理解硬盘的 Linux分区 ?

linux的系统分区一般指做系统时分的区如根分区,交换分区,boot分区硬盘分区,后面增加硬盘了可以分区挂载不同的目录。linux的系统分区一般指做系统时分的区如...

Linux分区 指的是啥啊?

磁盘分区格式名称,和Windows的NTFS类似,都是一种分区格式,只不过是Linux用的分区,一般是EXT4或者EXT3的,因为版权问题,Windows不能识别,所以分区工具一般...

虚拟机上装 linux 怎样磁盘 分区 - 悠悠的喵星人 的回答 - 懂得

1、最简单的方法,直接使用默认分区,因为是虚拟机,不需要太多设置的。2、必须进行的分区方法。Linux的分区必须有两个分区,一个是/根分区,一个是swap...

如何在 Linux 操作系统中新建磁盘 分区 ?

Linux下可以用fdisk命令新建分区,方法如下:1、首先用fdisk-l命令查看硬盘信息,硬盘有剩余空间就可以对其进行分区。2、假设/dev/sdb没有使用,用fdisk/d...

linux 怎么 分区 最好? - 132****0621 的回答 - 懂得

/BOOT分区100M足矣/SWAP分区一般为你机器内存的2倍/根分区剩下的都给根分区你要用它来做什么?其实你要它来做什么才是重要的。做不同的事,服...

Linux 系统如何安装和 分区 ?

1.找到你想使用linux发行版本。2.进入该官方网站。3.找到guide文档,按照上面操作。4.分期注意把磁盘格式化为linux的系统格式。5.linux分期是在/下的,分区...

 纪花村  汾阳爆炸 
王经理: 180-0000-0000(微信同号)
10086@qq.com
北京海淀区西三旗街道国际大厦08A座
©2024  上海羊羽卓进出口贸易有限公司  版权所有.All Rights Reserved.  |  程序由Z-BlogPHP强力驱动
网站首页
电话咨询
微信号

QQ

在线咨询真诚为您提供专业解答服务

热线

188-0000-0000
专属服务热线

微信

二维码扫一扫微信交流
顶部