1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
| lsblk fdisk -l df -TH
parted /dev/sdb1 parted (GNU parted) 3.1 Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) help check NUMBER do a simple check on the file system cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another partition help [COMMAND] prints general help, or help on COMMAND mklabel,mktable LABEL-TYPE create a new disklabel (partition table) mkfs NUMBER FS-TYPE make a FS-TYPE file system on partititon NUMBER mkpart PART-TYPE [FS-TYPE] START END make a partition mkpartfs PART-TYPE FS-TYPE START END make a partition with a file system move NUMBER START END move partition NUMBER name NUMBER NAME name partition NUMBER as NAME print [free|NUMBER|all] display the partition table, a partition, or all devices quit exit program rescue START END rescue a lost partition near START and END resize NUMBER START END resize partition NUMBER and its file system rm NUMBER delete partition NUMBER select DEVICE choose the device to edit set NUMBER FLAG STATE change the FLAG on partition NUMBER toggle [NUMBER [FLAG]] toggle the state of FLAG on partition NUMBER unit UNIT set the default unit to UNIT version displays the current version of GNU Parted and copyright information
(parted) mklabel GPT
(parted) print
(parted) mkpart primary 0% 100%
(parted) quit
partprobe
mkfs.ext4 /dev/sdb1
mkdir /data mount /dev/sdb1 /data
vim /etc/fstab /dev/sdb1 /data ext4 defaults 0 0
fdisk -l parted -l
命令行模式: parted [option] device [command] 交互模式: parted [option] device
|