日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

什么是parted

發布時間:2024/5/15 编程问答 36 豆豆
生活随笔 收集整理的這篇文章主要介紹了 什么是parted 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1. 什么是parted

parted是一個磁盤分區管理管理工具,它比fdisk更加靈活,功能也更豐富,同時還支持GUID分區表(GUID Partition Table), 這在IA64平臺上管理磁盤時非常有用。

2. parted的作用

parted同時支持交互模式和非交互模式. 它除了能夠進行分區的添加,刪除等常見操作外,還可以移動分區, 制作文件系統, 調整文件系統大小, 復制文件系統.

3. 使用parted

刪除一個分區

命令格式:

parted device rm partition

實例: 刪除分區/dev/sda1

[root@dev3-28 ~]# parted /dev/sda printModel: MAXTOR ATLAS10K5_73SCA (scsi) Disk /dev/sda: 73.6GB Sector size (logical/physical): 512B/512B Partition Table: msdosNumber Start End Size Type File system Flags1 32.3kB 10.0GB 10.0GB primary ext3 4 12.1GB 73.6GB 61.5GB extended 5 12.1GB 20.4GB 8390MB logical ext3 6 20.4GB 32.1GB 11.6GB logical ext3 7 32.1GB 73.6GB 41.5GB logical ext3 Information: Don't forget to update /etc/fstab, if necessary. [root@dev3-28 ~]# parted /dev/sda rm 1 Information: Don't forget to update /etc/fstab, if necessary. [root@dev3-28 ~]# parted /dev/sda printModel: MAXTOR ATLAS10K5_73SCA (scsi) Disk /dev/sda: 73.6GB Sector size (logical/physical): 512B/512B Partition Table: msdosNumber Start End Size Type File system Flags4 12.1GB 73.6GB 61.5GB extended 5 12.1GB 20.4GB 8390MB logical ext3 6 20.4GB 32.1GB 11.6GB logical ext3 7 32.1GB 73.6GB 41.5GB logical ext3 Information: Don't forget to update /etc/fstab, if necessary.

添加一個分區

命令格式:

parted device mkpart part-type [fs-type] start end

實例: 添加一個大小為3GB的主分區

[root@dev3-28 ~]# parted /dev/sda mkpart primary 32.3kB 3GB [root@dev3-28 ~]# parted /dev/sda print -s Model: MAXTOR ATLAS10K5_73SCA (scsi) Disk /dev/sda: 73.6GB Sector size (logical/physical): 512B/512B Partition Table: msdosNumber Start End Size Type File system Flags1 32.3kB 3002MB 3002MB primary ext3 4 12.1GB 73.6GB 61.5GB extended 5 12.1GB 20.4GB 8390MB logical ext3 6 20.4GB 32.1GB 11.6GB logical ext3 7 32.1GB 73.6GB 41.5GB logical ext3

制作文件系統

命令格式:

parted device mkfs

實例: 對剛剛添加的分區制作文件系統。

[root@dev3-28 ~]# parted /dev/sda mkfs Warning: The existing file system will be destroyed and all data on the partition will be lost. Do you want to continue? Yes/No? y Partition number? 1 File system? [ext2]? Information: Don't forget to update /etc/fstab, if necessary. [root@dev3-28 ~]# parted /dev/sda print -s Model: MAXTOR ATLAS10K5_73SCA (scsi) Disk /dev/sda: 73.6GB Sector size (logical/physical): 512B/512B Partition Table: msdosNumber Start End Size Type File system Flags1 32.3kB 3002MB 3002MB primary ext2 4 12.1GB 73.6GB 61.5GB extended 5 12.1GB 20.4GB 8390MB logical ext3 6 20.4GB 32.1GB 11.6GB logical ext3 7 32.1GB 73.6GB 41.5GB logical ext3

調整文件系統大小

命令格式:

parted device resize partition start end

實例: 將分區/dev/sda1的大小增加到5GB。

[root@dev3-28 ~]# parted /dev/sda resize 1 32.3kB 5GB Warning: You should reinstall your boot loader before rebooting. Read section 4 of the Parted User documentation for more information. Information: Don't forget to update /etc/fstab, if necessary. [root@dev3-28 ~]# parted /dev/sda print -s Model: MAXTOR ATLAS10K5_73SCA (scsi) Disk /dev/sda: 73.6GB Sector size (logical/physical): 512B/512B Partition Table: msdosNumber Start End Size Type File system Flags1 32.3kB 5001MB 5001MB primary ext2 4 12.1GB 73.6GB 61.5GB extended 5 12.1GB 20.4GB 8390MB logical ext3 6 20.4GB 32.1GB 11.6GB logical ext3 7 32.1GB 73.6GB 41.5GB logical ext3

移動分區

命令格式:

parted device move partition start end

實例: 移動分區/dev/sda1

[root@dev3-28 ~]# parted /dev/sda move 1 5001MB End? [10.0GB]? Warning: You should reinstall your boot loader before rebooting. Read section 4 of the Parted User documentation for more information. Information: Don't forget to update /etc/fstab, if necessary. [root@dev3-28 ~]# parted /dev/sda print -s Model: MAXTOR ATLAS10K5_73SCA (scsi) Disk /dev/sda: 73.6GB Sector size (logical/physical): 512B/512B Partition Table: msdosNumber Start End Size Type File system Flags1 5001MB 10.0GB 5001MB primary ext2 4 12.1GB 73.6GB 61.5GB extended 5 12.1GB 20.4GB 8390MB logical ext3 6 20.4GB 32.1GB 11.6GB logical ext3 7 32.1GB 73.6GB 41.5GB logical ext3

注意: 不同于fdisk命令的使用w功能來確認來寫入分區表信息, parted命令執行后立即生效,因此輸入時需要謹慎.

總結

以上是生活随笔為你收集整理的什么是parted的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。