深入Linux:学会设置分区(linux设置分区)

With the development of Linux operating system,how to set up partition in Linux is becoming more and more important for those who desire to deeply conquer the former. Based on my long experience of the field, this article will illustrate my own way of setting up Linux partition.

Firstly, use fdisk to set up partition sizes. Fdisk is a program making it possible to help us create, delete, modify and check the partitions. When using it, we need to enter the following code line: fdisk –l, which helps show the information about the existing partitions. For example, the following statements shows the size, start and end sectors of the partition:

Command:fdisk –l

Disk /dev/sda: 500GB

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

Partition Table:msdos

Number Start End Size Type File system Flags

1 32.3kB 500GB 500GB primary ext4 lba

2 500GB 500GB 32.3kB Free space

Secondly, employ parted to create partition. To set up partition on different file system, parted is a must tool. With it we can easily create partitions on popular file systems like ext2, ext3, FAT16, FAT32 and others.Again, the following statement can be used when creating partition:

Command: parted /dev/sda

(parted) mkpart primary ext4 20GB 40GB

(parted) print

Number Start End Size File system Name Flags

1 32.3kB 20GB 20GB primary ext4 lba

2 20GB 40GB 20GB primary ext4

3 40GB 500GB 500GB primary ext4

Finally, resize the created partition. When the partition is being set up, the size is fixed. But with the help of gparted, the size of partition can be accelerated. The code line should be typed in terminal:

Command: gparted /dev/sda

(gparted) resize

The size of partition can be adjusted through the pop-up window.

All in all, it’s not difficult to set up partitions in Linux. With fdisk, parted and gparted, it is a breeze to create, modify, resize and check partitions. However, please pay attention to the warning message caused by wrong operations and make sure you understand what the code lines mean before operating.

香港服务器首选树叶云,2H2G首月10元开通。
树叶云(shuyeidc.com)提供简单好用,价格厚道的香港/美国云服务器和独立服务器。IDC+ISP+ICP资质。ARIN和APNIC会员。成熟技术团队15年行业经验。

文章来源网络,作者:运维,如若转载,请注明出处:https://shuyeidc.com/wp/170525.html<

(0)
运维的头像运维
上一篇2025-03-22 10:43
下一篇 2025-03-22 10:44

相关推荐

  • HostSailor荷兰服务器怎么样?荷兰服务器租用推荐

    2026 年 HostSailor 荷兰服务器凭借超低延迟、合规的 GDPR 数据保护及极具竞争力的价格,是欧洲站群、跨境电商及 AI 算力部署的首选方案,在 2026 年的全球云计算版图中,荷兰阿姆斯特丹依然是连接欧亚非的绝对枢纽,HostSailor 作为深耕该区域的头部服务商,其核心优势在于不仅提供了物理……

    2026-05-02
    0
  • hosteonsVPS测评,实测体验好吗?hosteonsVPS怎么样

    Hosteons VPS 在 2026 年是否值得入手?结论是:对于追求极致性价比且业务主要面向东南亚或北美市场的中小开发者,其低价方案具备显著优势,但需警惕其高端线路的波动性,建议优先选择其位于新加坡或洛杉矶的入门级节点进行部署,在 2026 年云计算市场高度内卷的背景下,Hosteons 作为老牌 VPS……

    2026-05-02
    0
  • tragicservers是什么,tragicservers租用多少钱

    2026 年选择 tragicservers 的核心结论是:其凭借针对高并发游戏场景优化的独立节点架构与动态带宽调度技术,在低延迟稳定性与性价比之间取得了最佳平衡,尤其适合需要 24 小时不间断运行的竞技类项目,2026 年 tragicservers 性能深度解析与行业定位随着 2026 年云计算架构的进一步……

    2026-05-02
    0
  • 瑞典荷兰hosthatchVPS测评,hosthatchVPS怎么样?hosthatchVPS测评

    在 2026 年,若追求极致性价比与欧洲低延迟,瑞典 HostHatch VPS 是建站首选,而荷兰节点则在数据隐私与抗 DDoS 能力上略胜一筹,具体选择需结合业务落地地域与合规需求,HostHatch 2026 核心架构与性能实测随着 2026 年全球数据中心向绿色能源与 NVMe 全闪存架构转型,Host……

    2026-05-02
    0
  • CloudCone VPS测评,2美元/月性能如何?CloudCone VPS测评怎么样

    CloudCone 2 美元/月 VPS 实测结论:该方案在 2026 年仍具备极高的性价比,适合个人开发者搭建轻量级应用或学习 Linux 环境,但受限于共享带宽与 I/O 性能,不建议用于高并发生产环境或大型数据库服务,在 2026 年的 VPS 市场中,CloudCone 依然以其极低的入门门槛占据着特定……

    2026-05-02
    0

发表回复

您的邮箱地址不会被公开。必填项已用 * 标注