zl程序教程

您现在的位置是:首页 >  系统

当前栏目

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

Linux 深入 设置 分区 学会
2023-06-13 09:13:49 时间

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.


我想要获取技术服务或软件
服务范围:MySQL、ORACLE、SQLSERVER、MongoDB、PostgreSQL 、程序问题
服务方式:远程服务、电话支持、现场服务,沟通指定方式服务
技术标签:数据恢复、安装配置、数据迁移、集群容灾、异常处理、其它问题

本站部分文章参考或来源于网络,如有侵权请联系站长。
数据库远程运维 深入Linux:学会设置分区(linux设置分区)