当前位置:网站首页>Parted command
Parted command
2022-07-02 01:35:00 【Reef of】
Although we can use fdisk Command to partition the hard disk quickly , But for higher than 2TB Hard disk partition , This command is powerless , You need to use parted command
parted Commands can be partitioned and formatted directly on the command line , however parted Interactive mode is the more common command mode , The way to enter the interactive mode is as follows :
[[email protected] ~]# parted Hard disk device file name # Then it will enter interactive mode for example : [[email protected] ~]# parted /dev/sda [[email protected] ~]# parted /dev/sda GNU Parted 3.1 Use /dev/sda Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) # Entered interactive mode , You need to enter an interactive command Common steps of creating partition mount : [[email protected] ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 893.8G 0 disk ├─sda1 8:1 0 512M 0 part /boot ├─sda2 8:2 0 65G 0 part / ├─sda3 8:3 0 8G 0 part [SWAP] ├─sda4 8:4 0 1K 0 part └─sda5 8:5 0 820.3G 0 part /home sdb 8:16 0 1.8T 0 disk [[email protected] ~]# echo -e "mklabel gpt\nmkpart primary 1 100%\nquit\n" | parted /dev/sdb # notes :———————————————————————————————— Before this command echo As input , That is, entering parted The command that interacts with the system after the command , There is a line break in the middle , As an interactive command input, it is like this mklabel gpt # Create a new disk volume label gpt mkpart primary 1 100% # Create a partition , Capacity 100%, The default is create 1 quit # sign out ———————————————————————————————————— [[email protected] ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 893.8G 0 disk ├─sda1 8:1 0 512M 0 part /boot ├─sda2 8:2 0 65G 0 part / ├─sda3 8:3 0 8G 0 part [SWAP] ├─sda4 8:4 0 1K 0 part └─sda5 8:5 0 820.3G 0 part /home sdb 8:16 0 1.8T 0 disk └─sdb1 8:17 0 1.8T 0 part [[email protected] ~]# mkfs.ext4 /dev/sdb1 [[email protected] ~]# mount /dev/sdb1 /disk1/ [[email protected] ~]# blkid /dev/sda1: UUID="46e19b44-67ee-4aa5-9251-540bfe66a280" TYPE="xfs" /dev/sda2: UUID="b7c41386-7cba-43ce-bac5-c2a65f9026fd" TYPE="xfs" /dev/sda3: UUID="86df7f15-8813-4e5b-be2b-6f4493a34f03" TYPE="swap" /dev/sda5: UUID="473fb6a5-bf51-4027-b099-48c39e7fd549" TYPE="xfs" /dev/sdb1: UUID="01c8de08-059f-414a-b005-d8700eb67084" TYPE="ext4" PARTLABEL="primary" PARTUUID="db1d94c5-6f5c-442b-8c87-c892fb194ae8" [[email protected] ~]# vim /etc/fstab # # /etc/fstab # Created by anaconda on Mon Jan 10 07:05:59 2022 # # Accessible filesystems, by reference, are maintained under '/dev/disk' # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info # UUID=b7c41386-7cba-43ce-bac5-c2a65f9026fd / xfs defaults 0 0 UUID=46e19b44-67ee-4aa5-9251-540bfe66a280 /boot xfs defaults 0 0 UUID=86df7f15-8813-4e5b-be2b-6f4493a34f03 swap swap pri=0,defaults 0 0 UUID=473fb6a5-bf51-4027-b099-48c39e7fd549 /home xfs defaults,noatime,nobarrier 0 0 UUID=01c8de08-059f-414a-b005-d8700eb67084 /disk1 xfs defaults 0 0 # add to # Save and exit [[email protected] ~]# df -hT Filesystem Type Size Used Avail Use% Mounted on devtmpfs devtmpfs 16G 0 16G 0% /dev tmpfs tmpfs 16G 0 16G 0% /dev/shm tmpfs tmpfs 16G 25M 16G 1% /run tmpfs tmpfs 16G 0 16G 0% /sys/fs/cgroup /dev/sda2 xfs 65G 2.3G 63G 4% / /dev/sda1 xfs 506M 136M 371M 27% /boot /dev/sda5 xfs 820G 560M 820G 1% /home tmpfs tmpfs 3.2G 0 3.2G 0% /run/user/0 /dev/sdb1 ext4 1.8T 77M 1.7T 1% /disk1
parted Interactive commands say bright check NUMBER Do a simple file system test cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER Copy the file system to another partition help [COMMAND] Show all command help mklabel,mktable LABEL-TYPE Create a new disk volume label ( Partition table ) mkfs NUMBER FS-TYPE Establish a file system on the partition mkpart PART-TYPE [FS-TYPE] START END Create a partition mkpartfs PART-TYPE FS-TYPE START END Create partitions , And establish a file system move NUMBER START END Mobile partition name NUMBER NAME Name the partition print [devices|free|list,all|NUMBER] Show partition table 、 Mobile devices 、 Free space 、 All divisions quit sign out rescue START END Fix missing partitions resize NUMBER START END Change partition size rm NUMBER Delete partition select DEVICE Select the device you want to edit set NUMBER FLAG STATE Change partition mark toggle [NUMBER [FLAG]] Switch the state of partition table unit UNIT Set the default units Version Display version
边栏推荐
- Another programmer "deleted the library and ran away", deleted the code of the retail platform, and was sentenced to 10 months
- [Obsidian] wechat is sent to Obsidian using remotely save S3 compatibility
- Docker安装Oracle_11g
- Have you stepped on the nine common pits in the e-commerce system?
- [Floyd] post disaster reconstruction
- LeetCode、3无重复最长子序列
- Basic usage of shell script
- [rust web rokcet Series 2] connect the database and add, delete, modify and check curd
- 电子协会 C语言 1级 32、计算2的幂
- Load and domcontentloaded in JS
猜你喜欢
Edge computing accelerates live video scenes: clearer, smoother, and more real-time
游戏思考15:全区全服和分区分服的思考
卷积神经网络(包含代码与相应图解)
Appium inspector can directly locate the WebView page. Does anyone know the principle
学习笔记3--高精度地图关键技术(上)
Exclusive delivery of secret script move disassembly (the first time)
matlab 使用 audiorecorder、recordblocking录制声音,play 播放声音,audiowrite 保存声音
TSINGSEE青犀平台如何实现同一节点同时播放多个视频?
MPLS experiment operation
Learning note 3 -- Key Technologies of high-precision map (Part 1)
随机推荐
基于SSM实现微博系统
uTools
机器学习基本概念
Luogu p1775 stone merger (weakened version)
k线图形态这样记(口诀篇)
微信小程序中使用tabBar
Finally got byte offer, 25-year-old inexperienced experience in software testing, to share with you
电子协会 C语言 1级 32、计算2的幂
Part 29 supplement (XXIX) basis of ECMAScript
企业应该选择无服务器计算吗?
How can I batch produce the same title for the video?
Error creating bean with name ‘stringRedisTemplate‘ defined in class path re
6-3 vulnerability exploitation SSH environment construction
[rust web rokcet Series 1] Hello, world and get, post, put, delete
Recommend an online interface mock tool usemock
Study note 2 -- definition and value of high-precision map
KS006基于SSM实现学生成绩管理系统
学习笔记2--高精度地图定义及价值
[rust web rokcet Series 2] connect the database and add, delete, modify and check curd
What are the affordable Bluetooth headsets? Student party parity Bluetooth headset recommendation