网络知识 百科 linux删除分区命令(linux格式化分区命令)

linux删除分区命令(linux格式化分区命令)

linux删除分区命令, linux系统中删除分区命令是什么?以下是详细介绍:

在linux系统中删除分区的命令是:fdisk命令。

1.fdisk命令介绍:

fdisk-partition table manipulator for Linux,翻译成中文就是磁盘分区表操作工具的意思,其实就是一个分区工具。Fdsik可以将磁盘分成几个区域,

同时,它还可以指定每个分区的文件系统。

比如linux,fat32,linux,linux swap,fat16及其Unix操作系统的文件系统;当然,当我们使用fdisk对磁盘操作进行分区时,它并不是一个终点。

我们还需要格式化分区所需的文件系统;可以使用这样的隔板;这类似于DOS中的fdisk。

2.fdisk操作硬盘的命令格式:

[root@localhost beinan]# fdisk设备

通过fdisk -l了解/dev/hda或/dev/sda设备;如果要再次添加或删除

可以使用一些分区

[root@localhost beinan]# fdisk /dev/hda

[root@localhost beinan]# fdisk /dev/sda

3.fdisk的描述:

通过fdisk设备,当你进入相应设备的操作时,会有如下提示。

[root@localhost beinan]# fdisk /dev/sda

Command (m表示帮助):这里按m,输出帮助;

Command action

a toggle a bootable flag

b edit bsd disklabel

c toggle the dos compatibility flag

d删除分区注意:这是删除分区的动作;

L列出已知分区类型注:L列出分区类型供我们设置对应的分区类型;

M打印这个菜单注意:M是列出帮助信息;

n添加新分区注意:添加分区;

o create a new empty DOS partition table

Print partition table Note: p List partition table;

Q: Exit without saving changes Note: Exit without saving;

s create a new empty Sun disklabel

Do not change the partition system id Note: tChange the partition type;

u change display/entry units

v verify the partition table

w写表到磁盘并退出注意:写分区表到硬盘并退出;

X Extra functions (experts only) Note: Extended application, expert functions; 12345678910111213141516171819

例如:

列出当前操作硬盘的分区,并使用p:

Command (m for help): p

Disk /dev/sda: 1035 MB, 1035730944 bytes

256 heads, 63 sectors/track, 125 cylinders

Units=cylinders of 16128 * 512=8257536 bytes

Device Boot Start End Blocks Id System

/dev/sda1 1 25 201568+ c W95 FAT32 (LBA)

/dev/sda2 26 125 806400 5 Extended

/dev/sda5 26 50 201568+ 83 Linux

/dev/sda6 51 76 200781 83 Linux123456789

通过fdisk的d指令删除一个分区:

命令(m求助):p注意:列出分区情况;

Disk /dev/sda: 1035 MB, 1035730944 bytes

256 heads, 63 sectors/track, 125 cylinders

Units=cylinders of 16128 * 512=8257536 bytes

Device Boot Start End Blocks Id System

/dev/sda1 1 25 201568+ c W95 FAT32 (LBA)

/dev/sda2 26 125 806400 5 Extended

/dev/sda5 26 50 201568+ 83 Linux

/dev/sda6 51 76 200781 83 Linux

命令(m表示帮助):d注意:执行删除分区指定;

分区号(1-6): 6注:我想删除sda6,这里输入6即可;

Command (m表示帮助):p注意:再次检查硬盘分区,看是否已经删除。

Disk /dev/sda: 1035 MB, 1035730944 bytes

256 heads, 63 sectors/track, 125 cylinders

Units=cylinders of 16128 * 512=8257536 bytes

Device Boot Start End Blocks Id System

/dev/sda1 1 25 201568+ c W95 FAT32 (LBA)

/dev/sda2 26 125 806400 5 Extended

/dev/sda5 26 50 201568+ 83 Linux

Command (m for help):1234567891011121314151617181920

注意:删除分区时要小心。请注意分区的序列号。如果删除扩展分区,扩展分区下的所有逻辑分区都将被删除。所以操作的时候要小心;如果知道自己操作错误,用q退出,不保存;分区操作错误时千万不要输入w保存退出。

linux格式化分区命令

linux删除分区命令,以上就是本文为您收集整理的linux删除分区命令最新内容,希望能帮到您!更多相关内容欢迎关注。

本文来自网络,不代表本站立场,转载请注明出处:https://www.tlcement.com/a/79043.html

linux删除分区命令

网络知识后续将为您提供丰富、全面的关于linux删除分区命令内容,让您第一时间了解到关于linux删除分区命令的热门信息。小编将持续从百度新闻、搜狗百科、微博热搜、知乎热门问答以及部分合作站点渠道收集和补充完善信息。