当前位置:网站首页>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% /disk1parted 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
边栏推荐
- Design and control of multi rotor aircraft (VII) -- sensor calibration and measurement model
- Daily work and study notes
- 技术大佬准备就绪,话题C位由你决定
- Just using the way and method of consuming the Internet to land and practice the industrial Internet will not bring long-term development
- Réseau neuronal convolutif (y compris le Code et l'illustration correspondante)
- Leetcode, 3 repeatless longest subsequence
- 并发编程的三大核心问题
- TSINGSEE青犀平台如何实现同一节点同时播放多个视频?
- Design and implementation of radio energy transmission system
- About asp Net core uses a small detail of datetime date type parameter
猜你喜欢

Self drawing of menu items and CListBox items

卷积神经网络(包含代码与相应图解)

Three core problems of concurrent programming

卷積神經網絡(包含代碼與相應圖解)
![[Maya] the error of importing Maya into Metahuman](/img/46/46bd1c2d507c9e48ef8c066c54231d.jpg)
[Maya] the error of importing Maya into Metahuman

学习笔记24--多传感器后融合技术

Learn basic K-line diagram knowledge in three minutes

Hcip day 14 (MPLS protocol)

Appium inspector can directly locate the WebView page. Does anyone know the principle
![[IVX junior engineer training course 10 papers to get certificates] 01 learn about IVX and complete the New Year greeting card](/img/99/53b0ae47bada8b0d4db30d0517fe3d.jpg)
[IVX junior engineer training course 10 papers to get certificates] 01 learn about IVX and complete the New Year greeting card
随机推荐
6-3漏洞利用-SSH环境搭建
[Maya] the error of importing Maya into Metahuman
机器学习基本概念
Ks006 student achievement management system based on SSM
Based on Simulink and FlightGear, the dynamic control of multi rotor UAV in equilibrium is modeled and simulated
Docker安装Oracle_11g
微信小程序中使用tabBar
[rust web rokcet Series 1] Hello, world and get, post, put, delete
MySQL application day02
Design and implementation of radio energy transmission system
Develop those things: how to use go singleton mode to ensure the security of high concurrency of streaming media?
A problem about function template specialization
【图像增强】基于Frangi滤波器实现血管图像增强附matlab代码
GL Studio 5 installation and experience
电子协会 C语言 1级 32、计算2的幂
Using tabbar in wechat applet
人工智能在网络安全中的作用
GL Studio 5 安装与体验
Brief introduction to the development of mobile network
三分钟学会基础k线图知识