深入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.

四川成都云服务器租用托管【创新互联】提供各地服务器租用,电信服务器托管、移动服务器托管、联通服务器托管,云服务器虚拟主机租用。成都机房托管咨询:13518219792
创新互联(www.cdcxhl.com)拥有10多年的服务器租用、服务器托管、云服务器、虚拟主机、网站系统开发经验、开启建站+互联网销售服务,与企业客户共同成长,共创价值。

新闻标题:深入Linux:学会设置分区(linux设置分区)
分享网址:http://www.shufengxianlan.com/qtweb/news14/323114.html

网站建设、网络推广公司-创新互联,是专注品牌与效果的网站制作,网络营销seo公司;服务项目有等

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联