13.3. Removing a Partition


警告

Do not attempt to remove a partition on a device that is in use.

过程 13.3. Remove a partition

  1. Before removing a partition, boot into rescue mode (or unmount any partitions on the device and turn off any swap space on the device).
  2. Start parted, where /dev/sda is the device on which to remove the partition:
    # parted /dev/sda
  3. View the current partition table to determine the minor number of the partition to remove:
    # print
  4. Remove the partition with the command rm. For example, to remove the partition with minor number 3:
    # rm 3
    The changes start taking place as soon as you press Enter, so review the command before committing to it.
  5. After removing the partition, use the print command to confirm that it is removed from the partition table. You should also view the output of /proc/partitions to make sure the kernel knows the partition is removed.
    # cat /proc/partitions
  6. The last step is to remove it from the /etc/fstab file. Find the line that declares the removed partition, and remove it from the file.
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.