海诗网 知识百科 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 quit without saving changes 注:不保存退出;

s create a new empty Sun disklabel

t change a partitions system id 注:t 改变分区类型;

u change display/entry units

v verify the partition table

w write table to disk and exit 注:把分区表写入硬盘并退出;

x extra functionality (experts only) 注:扩展应用,专家功能;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指令来删除一个分区:

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 Linux

Command (m for help): d 注:执行删除分区指定;

Partition number (1-6): 6 注:我想删除sda6 ,就在这里输入6 ;

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

Command (m for help):1234567891011121314151617181920

注意:删除分区时要小心,请看好分区的序号,如果您删除了扩展分区,扩展分区之下的逻辑分区都会删除;所以操作时一定要小心;如果知道自己操作错了,用q不保存退出;在分区操作错了时,千万不要输入w保存退出。

linux分区修复命令

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

本文来自网络,不代表海诗网立场,转载请注明出处:https://www.hallse.com/n/165738.html
      

shell脚本执行linux命令(shell如何执行linux命令)

发表回复
联系我们
联系我们

在线咨询: QQ交谈

邮箱: 3587015498@qq.com

工作时间:周一至周五,9:00-17:30,节假日休息

关注微信
微信扫一扫关注我们
微信扫一扫关注我们
关注微博
返回顶部