Parted分区大容量磁盘

创建了新的虚拟磁盘10T , 挂载后分区格式化
一.fdisk无法创建大容量的分区
Fileserver:~ # fdisk /dev/sdb

Welcome to fdisk (util-linux 2.29.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table.
The size of this disk is 9.8 TiB (10737418240000 bytes). DOS partition table format can not be used on drives for volumes larger than 2199023255040 bytes for 512-byte sectors. Use GUID partition table format (GPT).
Created a new DOS disklabel with disk identifier 0x0506ad6d.
Command (m for help): m

Help:
  DOS (MBR)
   a   toggle a bootable flag
   b   edit nested BSD disklabel
   c   toggle the dos compatibility flag
  Generic
   d   delete a partition
   F   list free unpartitioned space
   l   list known partition types
   n   add a new partition
   p   print the partition table
   t   change a partition type
   v   verify the partition table
   i   print information about a partition
  Misc
   m   print this menu
   u   change display/entry units
   x   extra functionality (experts only)
  Script
   I   load disk layout from sfdisk script file
   O   dump disk layout to sfdisk script file
  Save & Exit
   w   write table to disk and exit
   q   quit without saving changes

  Create a new label
   g   create a new empty GPT partition table
   G   create a new empty SGI (IRIX) partition table
   o   create a new empty DOS partition table
   s   create a new empty Sun partition table

Command (m for help): p
Disk /dev/sdb: 9.8 TiB, 10737418240000 bytes, 20971520000 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x0506ad6d

Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1): 
First sector (2048-4294967295, default 2048): 
Last sector, +sectors or +size{K,M,G,T,P} (2048-4294967294, default 4294967294): 

Created a new partition 1 of type 'Linux' and of size 2 TiB.

Command (m for help): p
Disk /dev/sdb: 9.8 TiB, 10737418240000 bytes, 20971520000 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x0506ad6d

Device     Boot Start        End    Sectors Size Id Type
/dev/sdb1        2048 4294967294 4294965247   2T 83 Linux

看起来只能创建2T的分区。
Command (m for help): q


二.使用Parted进行分区

Fileserver:~ # parted /dev/sdb
GNU Parted 3.1
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) help                                                             
  align-check TYPE N                        check partition N for TYPE(min|opt) alignment
  help [COMMAND]                           print general help, or help on COMMAND
  mklabel,mktable LABEL-TYPE               create a new disklabel (partition table)
  mkpart PART-TYPE [FS-TYPE] START END     make a partition
  name NUMBER NAME                         name partition NUMBER as NAME
  print [devices|free|list,all|NUMBER]     display the partition table, available devices, free space, all found partitions, or a particular partition
  quit                                     exit program
  rescue START END                         rescue a lost partition near START and END
  resize NUMBER END                        change end sector of partition NUMBER
  rm NUMBER                                delete partition NUMBER
  select DEVICE                            choose the device to edit
  disk_set FLAG STATE                      change the FLAG on selected device
  disk_toggle [FLAG]                       toggle the state of FLAG on selected device
  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                                  display the version number and copyright information of GNU Parted
(parted) mklabel GPT
(parted) p                                                                
Model: Msft Virtual Disk (scsi)
Disk /dev/sdb: 10.7TB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start  End  Size  File system  Name  Flags

(parted) mkpart                                                           
Partition name?  []?                                                      
File system type?  [ext2]?                                                
Start? 0.000                                                              
End? 9000000     先划9000G练手                                                         
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? Ignore
(parted) p                                                                
Model: Msft Virtual Disk (scsi)
Disk /dev/sdb: 10.7TB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name  Flags
 1      17.4kB  9000GB  9000GB

(parted) quit                                                             
Information: You may need to update /etc/fstab.

三.查看分区结果
Fileserver:~ # fdisk -l
Disk /dev/sdb: 9.8 TiB, 10737418240000 bytes, 20971520000 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 7C734145-C793-4C60-BEB6-60BC58EA2BBA

Device     Start         End     Sectors  Size Type
/dev/sdb1     34 17578125000 17578124967  8.2T Microsoft basic data

四.格式化分区
Fileserver:~ # mkfs.ext4 /dev/sdb1
mke2fs 1.42.11 (09-Jul-2014)
/dev/sdb1 alignment is offset by 3072 bytes.
This may result in very poor performance, (re)-partitioning suggested.
Discarding device blocks: done                            
Creating filesystem with 2197265620 4k blocks and 274661376 inodes
Filesystem UUID: d9848b2b-09d7-4c4d-95cf-ca5afdf1467a
Superblock backups stored on blocks: 
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
    4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
    102400000, 214990848, 512000000, 550731776, 644972544, 1934917632

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information:   

五.扩容分区
Fileserver:~ # lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sdb      8:16   0  9.8T  0 disk 
└─sdb1   8:17   0  8.2T  0 part 

Fileserver:~ # parted /dev/sdb
GNU Parted 3.1
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p                                                                
Model: Msft Virtual Disk (scsi)
Disk /dev/sdb: 10.7TB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name  Flags
 1      17.4kB  9000GB  9000GB  ext4

(parted) rm 1          #删除                                                   
(parted) p                                                               
Model: Msft Virtual Disk (scsi)
Disk /dev/sdb: 10.7TB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start  End  Size  File system  Name  Flags

(parted) mkpart opt 0.000 10000000              #创建                           
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? Ignore                                                     
(parted) p                                                                
Model: Msft Virtual Disk (scsi)
Disk /dev/sdb: 10.7TB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size     File system  Name  Flags
 1      17.4kB  10.0TB  10000GB  ext4         opt

(parted) q                                                                
Information: You may need to update /etc/fstab.

Fileserver:~ # e2fsck -f /dev/sdb1                  #检查
e2fsck 1.42.11 (09-Jul-2014)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sdb1: 11/274661376 files (0.0% non-contiguous), 17356797/2197265620 blocks
Fileserver:~ # resize2fs /dev/sdb1               #扩展分区大小
resize2fs 1.42.11 (09-Jul-2014)
Resizing the filesystem on /dev/sdb1 to 2441406245 (4k) blocks.
The filesystem on /dev/sdb1 is now 2441406245 blocks long.

Fileserver:~ # lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sdb      8:16   0  9.8T  0 disk 
└─sdb1   8:17   0  9.1T  0 part 

六.加入/etc/fstab自动挂载
Fileserver:~ # blkid              #查看UUID
/dev/sda1: UUID="b73fc08c-5be7-4e57-8f96-95910dc78724" TYPE="swap" PARTUUID="000b0496-01"
/dev/sda2: UUID="2d34979e-fcfb-4966-b11b-7a76506c4850" TYPE="xfs" PARTUUID="000b0496-02"
/dev/sdb1: UUID="d9848b2b-09d7-4c4d-95cf-ca5afdf1467a" TYPE="ext4" PARTLABEL="opt" PARTUUID="9905a1e8-428b-45f8-9677-612b78fbe416"
Fileserver:~  # echo "UUID=d9848b2b-09d7-4c4d-95cf-ca5afdf1467a /app/files ext4 defaults 0 0" >> /etc/fstab

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/web/10597.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

使用html和css实现个人简历表单的制作

根据下列要求,做出下图所示的个人简历(表单) 表单要求 Ⅰ、表格整体的边框为1像素,单元格间距为0,表格中前六列列宽均为100像素,第七列 为200像素,表格整体在页面上居中显示; Ⅱ、前…

git提交代码异常报错error:bad signature 0x00000000

报错信息 error:bad signature 0x00000000 异常原因 git 提交过程中异常关机或重启,造成当前项目工程中的.git/index 文件损坏,无法提交 解决步骤 删除.git/index文件 rm -f .git/index 重启git git reset

Java 【数据结构】 哈希(Hash超详解)HashSetHashMap【神装】

登神长阶 第十神装 HashSet 第十一神装 HashMap 目录 👔一.哈希 🧥1.概念 🩳2.Object类的hashCode()方法: 👚3.String类的哈希码: 👠4.注意事项: 🎷二.哈希桶 🪗1.哈希桶原理 &#x…

Bert基础(二十二)--Bert实战:对话机器人

一 、概念简介 1.1 生成式对话机器人 1.1.1什么是生成式对话机器人? 生成式对话机器人是一种能够通过自然语言交互来理解和生成响应的人工智能系统。它们能够进行开放域的对话,即在对话过程中,机器人可以根据用户的需求和上下文信息,自主地生成新的、连贯的回复,而不仅…

如何使用CertCrunchy从SSL证书中发现和识别潜在的主机名称

关于CertCrunchy CertCrunchy是一款功能强大的网络侦查工具,该工具基于纯Python开发,广大研究人员可以利用该工具轻松从SSL证书中发现和识别潜在的主机信息。 支持的在线源 该工具支持从在线源或给定IP地址范围获取SSL证书的相关数据,并检索…

大数据测试

1、前言 大数据测试是对大数据应用程序的测试过程,以确保大数据应用程序的所有功能按预期工作。大数据测试的目标是确保大数据系统在保持性能和安全性的同时,平稳无差错地运行。 大数据是无法使用传统计算技术处理的大型数据集的集合。这些数据集的测试涉…

Foxmail使用经验总结

本篇博客将详尽讲解如何利用Foxmail进行高效的邮件管理,以及一些实用的使用技巧,让邮件管理变得更为高效和有序。 1. 账户设置与管理 多账户整合:Foxmail支持多个邮件账户同时管理,用户可以将个人和工作邮箱整合在同一个界面&am…

实战中使用 QEMU 进行内网穿透

前言 阅读 https://xz.aliyun.com/t/14052 《使用 QEMU 进行内网穿透?》 https://securelist.com/network-tunneling-with-qemu/111803/ 《Network tunneling with… QEMU?》 我将此项技术应用到实战中,取得不错的效果,但是也遇到很多坑&am…

机器学习算法应用——朴素贝叶斯分类器

朴素贝叶斯分类器 朴素贝叶斯分类器(Naive Bayes Classifier)是一种基于贝叶斯定理和特征条件独立假设的分类方法。它适用于分类任务,特别是文本分类、垃圾邮件识别等领域。 原理 朴素贝叶斯分类器基于以下两个主要假设: 特征条…

JS_ES6(1)

作用域链: 作用域链是底层变量查找的机制:当函数执行时,优先查找当前函数作用域中有无需要用到的变量,如果找不到,逐级查找父级,直到全局 > 嵌套关系形成作用域链,同一作用域链从小到大查找…

taro3兼容支付宝/微信小程序的自定义拖拽排序组件

描述:列表可以完成拖拽排序 此组件是根据支付宝原生文档改编成taro-vue3的形式,只保留了拖拽的部分,其他功能都去除了,测试下来可以兼容支付宝和微信小程序。 支付宝原生文档: https://opendocs.alipay.com/support/…

BGP(border gateway protocol)边界网关协议初识篇

BGP它是一种路径矢量协议,用于决定数据包在互联网中的最佳路径。 1、工作原理: 自治系统(AS)间路由: BGP主要用于连接不同自治系统之间的路由器,其中每个自治系统(AS)代表一组具有共同路由的网…

编译 fdk-aac

文章目录 关于 fdk-aac编译 fdk-aac在 FFMpeg 编译中启用 关于 fdk-aac A standalone library of the Fraunhofer FDK AAC code from Android. github : https://github.com/mstorsjo/fdk-aac代码托管 : https://sourceforge.net/projects/opencore-am…

最新巨量X-Bogus、_signature参数逆向分析与算法还原

文章目录 1. 写在前面2. 接口分析3. 断点分析4. 扣代码补环境5. 数据解密 【🏠作者主页】:吴秋霖 【💼作者介绍】:擅长爬虫与JS加密逆向分析!Python领域优质创作者、CSDN博客专家、阿里云博客专家、华为云享专家。一路…

# 从浅入深 学习 SpringCloud 微服务架构(十六)

从浅入深 学习 SpringCloud 微服务架构(十六) 一、SpringCloudStream:自定义消息通道 1、在子工程 stream_product (子模块)中,创建 自定义的消息通道类 MyProcessor.java /*** spring_cloud_demo\stream_product…

JavaEE概述 + Maven

文章目录 一、JavaEE 概述二、工具 --- Maven2.1 Maven功能 仓库 坐标2.2 Maven之项目构建2.3 Maven之依赖管理 三、插件 --- Maven Helper 一、JavaEE 概述 Java SE、JavaEE: Java SE:指Java标准版,适用于各行各业,主要是Java…

【负载均衡式在线OJ项目day5】OJ服务模块概要

前言 经过四天的努力已经完成了编译运行这个大模块,今天将要进入OJ服务模块设计,该模块的本质就是建立一个小型网站 一.功能 为用户提供题目列表页面为用户提供网站首页(用题目列表充当首页)为用户提供指定题目的编辑页面为用户提供提交代码判题功能&a…

FFmpeg常用API与示例(二)—— 解封装与转封装

封装层 封装格式(container format)可以看作是编码流(音频流、视频流等)数据的一层外壳,将编码后的数据存储于此封装格式的文件之内。 封装又称容器,容器的称法更为形象,所谓容器,就是存放内容的器具,饮料是内容&…

【QT学习】补充:qt使用已经存在的类

1.右键项目--》添加现有文件 注意:不是添加新文件!!! 2.添加配置

掌握Android Fragment开发之魂:Fragment的深度解析(上)

Fragment是Android开发中用于构建动态和灵活界面的基石。它不仅提升了应用的模块化程度,还增强了用户界面的动态性和交互性,允许开发者将应用界面划分为多个独立、可重用的部分,每个部分都可以独立于其他部分进行操作。本文将从以下几个方面深…