centos6系统下mount 装载4T移动硬盘

问题产生的背景,数据存储在一个4T移动硬盘中,现需要将其复制到CENTOS6的系统中,完成这项工作,需要解决以下几个问题
1、由于移动硬盘原来是工作在WINDOWS系统下的,它的文件格式是NTFS格式,所以首先要能够让CENTOS6系统能够识别NTFS格式
2、当移动硬盘接入CENTOS6主机时,要明确通过USB口连接的4T移动硬盘,挂载在哪个目录下
3、由于硬盘大于2T,需要对GPT格式的硬盘进行识别。
下面介绍下MBR 和 GPT的方面的知识
MBR的全称是Master Boot Record(主引导记录),MBR早在1983年IBM PC DOS 2.0中就已经提出。之所以叫“主引导记录”,是因

为它是存在于驱动器开始部分的一个特殊的启动扇区。这个扇区包含了已安装的操作系统的启动加载器和驱动器的逻辑分区信息。

主引导扇区是硬盘的第一扇区。它由三个部分组成,主引导记录MBR、硬盘分区表DPT和硬盘有效标志。在总共512字节的主引导扇区

里MBR占446个字节,偏移地址0000H--0088H),它负责从活动分区中装载,并运行系统引导程序;第二部分是Partition table区(

DPT分区表),占64个字节;第三部分是Magic number,占2个字节。MBR最大支持2.2TB磁盘,它无法处理大于2.2TB容量的磁盘。

MBR还只支持最多4个主分区,但可以创建所谓“扩展分区”,并在其中创建逻辑分区。

GPT的全称是Globally Unique Identifier Partition Table,意即GUID分区表,它的推出是和UEFI BIOS相辅相成的,鉴于MBR的磁

盘容量和分区数量已经不能满足硬件发展的需求,GPT首要的任务就是突破了2.2T分区的限制,最大支持18EB的分区。

4、通过parted命令进行查阅
5、具体要求命令如下:
首先进行ntfs-3g软件包的安装,它是用来识别ntfs文件格式的
[root@localhost61 clusteruser]# yum install ntfs-3g
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
epel/metalink                                                                                               | 6.4

kB     00:00     
 * base: mirrors.zju.edu.cn
 * epel: mirrors.ustc.edu.cn
 * extras: mirrors.zju.edu.cn
 * updates: mirrors.zju.edu.cn
base                                                                                                        | 3.7

kB     00:00     
extras                                                                                                      | 3.4

kB     00:00     
updates                                                                                                     | 3.4

kB     00:00     
Resolving Dependencies
--> Running transaction check
---> Package ntfs-3g.x86_64 2:2017.3.23-1.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================

================
 Package                      Arch                        Version                                  Repository       

          Size
===================================================================================================================

================
Installing:
 ntfs-3g                      x86_64                      2:2017.3.23-1.el6                        epel             

         250 k

Transaction Summary
===================================================================================================================

================
Install       1 Package(s)

Total download size: 250 k
Installed size: 718 k
Is this ok [y/N]: y
Downloading Packages:
ntfs-3g-2017.3.23-1.el6.x86_64.rpm                                                                          | 250

kB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : 2:ntfs-3g-2017.3.23-1.el6.x86_64                                                                     

           1/1
  Verifying  : 2:ntfs-3g-2017.3.23-1.el6.x86_64                                                                     

           1/1

Installed:
  ntfs-3g.x86_64 2:2017.3.23-1.el6                                                                                  

               

Complete!

Disk /dev/mapper/vg_hadoopdatanode98-lv_home: 5932.8 GB, 5932792676352 bytes
255 heads, 63 sectors/track, 721287 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdb: 4000.8 GB, 4000787029504 bytes
256 heads, 63 sectors/track, 484501 cylinders
Units = cylinders of 16128 * 512 = 8257536 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x9bbdea98

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1      266306  2147483647+  ee  GPT


查看分区情况
[root@localhost61 ttt]# cat /proc/partitions
major minor  #blocks  name

   8        0 5858918400 sda
   8        1     512000 sda1
   8        2 5858404352 sda2
 253        0   52428800 dm-0
 253        1   12230656 dm-1
 253        2 5793742848 dm-2
   8       16 3907018583 sdb
   8       17     131072 sdb1
   8       18 3906885632 sdb2

确认硬盘装载点
[root@localhost61 ttt]# fdisk -l

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sda: 5999.5 GB, 5999532441600 bytes
255 heads, 63 sectors/track, 729401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1      267350  2147483647+  ee  GPT

Disk /dev/mapper/vg_hadoopdatanode98-lv_root: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_hadoopdatanode98-lv_swap: 12.5 GB, 12524191744 bytes
255 heads, 63 sectors/track, 1522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000



安装用于GPT的parted组件
[root@localhost61 ttt]# yum install parted


[root@localhost61 ttt]# parted /dev/sdb print
Model: Seagate BUP BK (scsi)
Disk /dev/sdb: 4001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start   End     Size    File system  Name                          Flags
 1      17.4kB  134MB   134MB                Microsoft reserved partition  msftres
 2      135MB   4001GB  4001GB  ntfs         Basic data partition

安装ntfs格式的移动硬盘
[root@localhost61 clusteruser]# mount -t ntfs-3g /dev/sdb2 ./ttt
The disk contains an unclean file system (0, 0).
The file system wasn't safely closed on Windows. Fixing.

你可能感兴趣的:(运维)