CN108037896A - 一种Linux下对机械硬盘批量格式化并分区处理的方法 - Google Patents

一种Linux下对机械硬盘批量格式化并分区处理的方法 Download PDF

Info

Publication number
CN108037896A
CN108037896A CN201711302962.2A CN201711302962A CN108037896A CN 108037896 A CN108037896 A CN 108037896A CN 201711302962 A CN201711302962 A CN 201711302962A CN 108037896 A CN108037896 A CN 108037896A
Authority
CN
China
Prior art keywords
hard disk
mechanical hard
ment
multidomain treat
batch
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201711302962.2A
Other languages
English (en)
Inventor
徐东阳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201711302962.2A priority Critical patent/CN108037896A/zh
Publication of CN108037896A publication Critical patent/CN108037896A/zh
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • G06F3/0619Improving the reliability of storage systems in relation to data integrity, e.g. data losses, bit errors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

本发明涉及一种Linux下对机械硬盘批量格式化并分区处理的方法,通过采用编写指令,批量的完成对搭载机械硬盘的单台服务器上所有机械硬盘进行格式化并分区处理,以便于后续对逻辑磁盘进行BurnIn等加压测试,可大大减少了研发阶段测试准备时间,极大的降低逐盘格式分区处理可能产生的操作失误造成的数据丢失等损失。

Description

一种Linux下对机械硬盘批量格式化并分区处理的方法
技术领域
本发明涉及电子技术领域,尤其涉及一种信息处理的方法及电子设备。
背景技术
文件系统是操作系统用于明确存储设备(常见的是磁盘)或分区上的文件的方法和数据结构,其作为操作系统与驱动器之间的接口,当操作系统请求从硬盘里读取一个文件时,会请求相应的文件系统打开文件,扇区是磁盘最小的物理存储单元。现有磁盘比较多的是机械硬盘。当文件是连续的或则连续操作的文件是相邻的,磁头移动的距离短,读写速度快,效率高,当文件不连续时,磁头移动距离较大,读写速度慢且使用效率低下,影响硬盘的使用效率。对磁盘进行格式化并分区处理非常有必要。
随着现在数据量的猛增,对服务器的需求和性能要求也越来越高。在研发阶段就需要对服务器的各项性能指标进行一系列的加压测试来确保其能正常稳定的工作。但是通常的加压软件智能对逻辑磁盘进行访问和加压测试,因此就有必要在测试前对机械硬盘进行格式化、分区处理。但大数据量和成本对服务器的要求使得通常的服务器往往都会搭载有大量的硬盘。为了缩短研发周期,减少前期准备时间,就有必要对硬盘进行批量格式化分区处理。
发明内容
本发明提供一种Linux下对机械硬盘批量格式化并分区处理的方法。本方法可大大减少了研发阶段测试准备时间,极低的降低可能的操作失误造成的数据丢失等损失。
为达到上述发明目的,本发明采用如下Linux下对机械硬盘批量格式化并分区处理的方法:
通过采用编写指令,批量的完成对搭载机械硬盘的单台服务器上所有机械硬盘进行格式化并分区处理,以便于后续对逻辑磁盘进行BurnIn等加压测试,可大大减少了研发阶段测试准备时间,极大地降低可能的操作失误造成的数据丢失。
优选地,所述格式化并分区处理的步骤包括:
通过root用户进入到linux系统后,读取系统中机械硬盘;
输入编辑的指令,重新查看机械硬盘信息,将机械硬盘格式化并分区。
优选地,所述格式化步骤包括:
输入一格式化指令;
执行所述格式化指令,格式化所述机械硬盘,并按照预设分区表在所述机械硬盘确定第1存储位置、第1存储位置…第N存储位置(N≥2);
当所述机械硬盘完成格式化并生成所述预设分区表时,将所述预设分区表存储于所述存储位置。
本发明还提供一种根据上述的方法进行批量格式化并分区处理的机械硬盘,其特征在于,用于按照预设分区表将所述机械硬盘上的各物理扇区进行分区,并确定为第1存储位置、第2存储位置…第N存储位置(N≥2)。
与现有技术相比,本发明具有以下有益效果:
本发明通过采用编写指令,批量的完成对搭载机械硬盘的单台服务器上所有机械硬盘进行格式化并分逻辑区处理,以便于后续对逻辑磁盘进行BurnIn等加压测试,可大大减少了研发阶段测试准备时间,极大的降低逐盘格式分区处理可能产生的操作失误造成的数据丢失等损失。
具体实施方式
以下实施例是对本发明内容进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员所获得的所有其他实施例,都属于本发明保护的范围。
在Linux下对机械硬盘批量格式化并分区处理的方法,通过采用编写指令,批量的完成对搭载机械硬盘的单台服务器上所有机械硬盘进行格式化并分区处理,以便于后续对逻辑磁盘进行BurnIn等加压测试,可大大减少了研发阶段测试准备时间,极大地降低可能的操作失误造成的数据丢失。
首先用root用户进入到linux系统后,读取系统中机械硬盘,具体操作为:
ls/dev/sd*回车。
此时,可见sdb到sdi 8块盘均无逻辑子区。
接着输入如下指令:
for i in{b..h};do parted-s/dev/sd$i mktabel gpt mkpart 1ext4 0%100%;done,回车。
重新查看硬盘信息,可见从sdb到sdi 8块盘均被格式化并分区成一个逻辑子区。
所述格式化步骤包括:
输入一格式化指令;
执行所述格式化指令,格式化所述硬盘,并按照预设分区表在所述机械硬盘确定第1存储位置、第1存储位置…第N存储位置(N≥2);
当所述硬盘完成格式化并生成所述预设分区表时,将所述预设分区表存储于所述存储位置。
本发明还提供一种根据上述的方法进行批量格式化并分区处理的机械硬盘,其特征在于,用于按照预设分区表将所述机械硬盘上的各物理扇区进行分区,并确定为第1存储位置、第2存储位置…第N存储位置(N≥2)。
如此以来,大大减少了研发阶段测试准备时间,极低的降低了可能的操作失误造成的数据丢失等损失,且便于后续的自动化的实现。
以上实施方式仅用于更加清楚地说明本发明的技术方案,本发明的保护范围包括但不限于上述具体实施方式,任何符合本发明的权利要求书的且任何所示技术领域的普通技术人员对其所做的适当变化或替换,皆应落入本发明的专利保护范围。

Claims (4)

1.一种Linux下对机械硬盘批量格式化并分区处理的方法,其特征在于,通过采用编写指令,批量的完成对搭载机械硬盘的单台服务器上所有机械硬盘进行格式化并分区处理,以便于后续对逻辑磁盘进行BurnIn等加压测试。
2.根据权利要求1所述的方法,其特征在于,所述格式化并分区处理的步骤包括:
通过root用户进入到linux系统后,读取系统中所述机械硬盘;
输入编辑的指令,重新查看所述机械硬盘信息,将所述机械硬盘格式化并分区。
3.根据权利要求1所述的方法,其特征在于,所述格式化步骤包括:
输入一格式化指令;
执行所述格式化指令,格式化所述机械硬盘,并按照预设分区表在所述机械硬盘确定第1存储位置、第2存储位置…第N存储位置(N≥2);
当所述机械硬盘完成格式化并生成所述预设分区表时,将所述预设分区表存储于所述存储位置。
4.一种根据权利要求1-3任一项所述的方法进行批量格式化并分区处理的机械硬盘,其特征在于,用于按照预设分区表将所述机械硬盘上的各物理扇区进行分区,并确定为第1存储位置、第2存储位置…第N存储位置(N≥2)。
CN201711302962.2A 2017-12-08 2017-12-08 一种Linux下对机械硬盘批量格式化并分区处理的方法 Pending CN108037896A (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711302962.2A CN108037896A (zh) 2017-12-08 2017-12-08 一种Linux下对机械硬盘批量格式化并分区处理的方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711302962.2A CN108037896A (zh) 2017-12-08 2017-12-08 一种Linux下对机械硬盘批量格式化并分区处理的方法

Publications (1)

Publication Number Publication Date
CN108037896A true CN108037896A (zh) 2018-05-15

Family

ID=62102094

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711302962.2A Pending CN108037896A (zh) 2017-12-08 2017-12-08 一种Linux下对机械硬盘批量格式化并分区处理的方法

Country Status (1)

Country Link
CN (1) CN108037896A (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102662459A (zh) * 2012-04-22 2012-09-12 复旦大学 利用固态硬盘与机械硬盘混合存储减少服务器能源消耗的方法
CN204595827U (zh) * 2015-05-12 2015-08-26 浙江诸暨奇创电子科技有限公司 一种高性能混合硬盘
CN105302681A (zh) * 2015-11-04 2016-02-03 浪潮电子信息产业股份有限公司 一种rack整机柜磁盘性能的自动化测试方法
CN106844228A (zh) * 2017-01-20 2017-06-13 深圳英飞拓科技股份有限公司 轻量级sd卡分区管理实现方法及装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102662459A (zh) * 2012-04-22 2012-09-12 复旦大学 利用固态硬盘与机械硬盘混合存储减少服务器能源消耗的方法
CN204595827U (zh) * 2015-05-12 2015-08-26 浙江诸暨奇创电子科技有限公司 一种高性能混合硬盘
CN105302681A (zh) * 2015-11-04 2016-02-03 浪潮电子信息产业股份有限公司 一种rack整机柜磁盘性能的自动化测试方法
CN106844228A (zh) * 2017-01-20 2017-06-13 深圳英飞拓科技股份有限公司 轻量级sd卡分区管理实现方法及装置

Similar Documents

Publication Publication Date Title
CN104504105B (zh) 一种实时数据库的存储方法
US10255235B2 (en) Database storage system based on jukebox and method using the system
CN106843759B (zh) 一种基于动态系统结果数据的快速读写方法
CN101556802B (zh) 一种raid阵列转换的方法及装置
US8274749B1 (en) Data wedge format table synchronization
US20140365724A1 (en) System and method for converting disk partition format
CN112579382A (zh) 一种NVMe固态硬盘坏块解析方法、装置、终端及存储介质
US20130219119A1 (en) Writing new data of a first block size to a second block size using a write-write mode
CN104133640B (zh) 从休眠快速恢复
CN108037896A (zh) 一种Linux下对机械硬盘批量格式化并分区处理的方法
CN100565467C (zh) 用于储存装置的同步备份装置与方法
CN102963321B (zh) 车辆驾驶辅助方法及装置
US8488265B2 (en) Tape storage processing
CN103514901A (zh) 光盘库、用于该光盘库的数据并行读写方法及控制装置
CN110502190B (zh) 文件读写方法
CN105205017A (zh) 一种基于pcie ssd的存储控制器
CN101727940A (zh) 磁盘转向控制方法、装置和磁盘
US20150309732A1 (en) Selectively Configuring Hard-Disk Drive System
CN107632774B (zh) 修复磁盘挂载的方法及装置
CN109783032A (zh) 一种基于异构计算的分布式存储加速方法及装置
CN112015328B (zh) 第5级独立磁盘冗余阵列的创建方法及装置
CN107102867A (zh) 一种linux系统硬盘槽位识别方法
CN112346646B (zh) 高速大容量存储器及写入、读取和擦除方法
JPS6240556A (ja) 情報処理装置
CN108009044B (zh) 一种实时校验flash数据正确性的方法

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20180515

RJ01 Rejection of invention patent application after publication