当前位置:网站首页>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
边栏推荐
- Develop those things: how to use go singleton mode to ensure the security of high concurrency of streaming media?
- The role of artificial intelligence in network security
- Learn basic K-line diagram knowledge in three minutes
- 10 minutes to get started quickly composition API (setup syntax sugar writing method)
- Daily work and study notes
- SAP ui5 beginner tutorial 20 - explanation of expression binding usage of SAP ui5
- Experimental reproduction of variable image compression with a scale hyperprior
- [rust web rokcet Series 1] Hello, world and get, post, put, delete
- [Maya] the error of importing Maya into Metahuman
- Matlab uses resample to complete resampling
猜你喜欢
k线图形态这样记(口诀篇)
[IVX junior engineer training course 10 papers] 04 canvas and a group photo of IVX and me
II Basic structure of radio energy transmission system
6-3漏洞利用-SSH环境搭建
学习笔记2--高精度地图定义及价值
【图像增强】基于Frangi滤波器实现血管图像增强附matlab代码
Data visualization in medical and healthcare applications
Feature extraction and detection 16 brisk feature detection and matching
Principle of finding combinatorial number and template code
Learning note 3 -- Key Technologies of high-precision map (Part 1)
随机推荐
Learn about servlets
Based on Simulink and FlightGear, the dynamic control of multi rotor UAV in equilibrium is modeled and simulated
Design and control of multi rotor aircraft (VII) -- sensor calibration and measurement model
Have you stepped on the nine common pits in the e-commerce system?
[IVX junior engineer training course 10 papers] 04 canvas and a group photo of IVX and me
It's already 30. Can you learn programming from scratch?
Edge extraction edges based on Halcon learning_ image. Hdev routine
成功实现边缘编码需要了解的六大经验教训
uTools
6-2 vulnerability exploitation - inevitable problems of FTP
Single chip microcomputer -- hlk-w801 transplant NES simulator (III)
2022年6月国产数据库大事记
Using tabbar in wechat applet
[rust web rokcet Series 2] connect the database and add, delete, modify and check curd
Look at the industrial Internet from a new perspective and seek the correct ways and methods of industrial Internet
We should make clear the branch prediction
Docker安装Oracle_11g
6-3漏洞利用-SSH环境搭建
How does schedulerx help users solve the problem of distributed task scheduling?
Android: how can golden nine and silver ten squeeze into the first-line big factories from small and medium-sized enterprises? The depth of interview questions in large factories