linux怎样删除分区合并,CenterOS磁盘分区调整,删除,合并分区

本文介绍了如何在Linux CentOS系统中删除/u2和/u3分区并将其合并为/u4分区的详细步骤,包括取消挂载、使用fdisk删除分区、编辑/etc/fstab以及创建和挂载新分区。
摘要由CSDN通过智能技术生成

目的:将/u2和/u3分区删除后,合并为/u4分区。

f6fac4e328910bebd6a43cd18f1f5d07.png

1、先取消/u2和/u3分区的挂载

[root@fdisk ~]# umount /u2

[root@fdisk ~]# umount /u3

[root@fdisk ~]# df -h

文件系统 容量 已用 可用 已用%% 挂载点

/dev/sda5 22G 2.0G 19G 10% /

tmpfs 911M 0 911M 0% /dev/shm

/dev/sda1 194M 32M 153M 18% /boot

/dev/sda3 2.0G 35M 1.8G 2% /u1

2、进入fdisk /dev/sda磁盘删除分区格式

[root@fdisk ~]# fdisk /dev/sda

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to

switch off the mode (command 'c') and change display units to

sectors (command 'u').

Command (m for help): p

Disk /dev/sda: 32.2 GB, 32212254720 bytes

255 heads, 63 sectors/track, 3916 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

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

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

Disk identifier: 0x0007403b

Device Boot Start End Blocks Id System

/dev/sda1 * 1 26 204800 83 Linux

Partition 1 does not end on cylinder boundary.

/dev/sda2 26 281 2048000 82 Linux swap / Solaris

Partition 2 does not end on cylinder boundary.

/dev/sda3 281 536 2048000 83 Linux

Partition 3 does not end on cylinder boundary.

/dev/sda4 536 3917 27155456 5 Extended

/dev/sda5 1046 3917 23056384 83 Linux

/dev/sda6 536 736 1610064+ 83 Linux

/dev/sda7 737 1045 2482011 83 Linux #这两个虽然取消挂载,但是分区要进一步删除。

Partition table entries are not in disk order

Command (m for help): d

Partition number (1-7): 7 #这个标号是要删除的磁盘编号

Command (m for help): p #建议删一次分区,用一次p选项,避免删错

Disk /dev/sda: 32.2 GB, 32212254720 bytes

255 heads, 63 sectors/track, 3916 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

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

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

Disk identifier: 0x0007

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值