2015年(68)
分类: 系统运维
2015-08-31 19:41:41
1)应用场景:
有一大小为3T的硬盘,使用一硬盘合从一台windows机器上copy数据,然后将硬盘挂到一台rhel6上使用。
2)过程
2.1 安装ntfs-3g,ntfsprogs
要在rhel6上使用ntfs分区,需要安装ntfs-3g,ntfsprogs
安装epel源:
[root@localhost ~]# wget
[root@localhost ~]# rpm -ivh epel-release-6-8.noarch.rpm
安装ntfs-3g, ntfs-3g:
[root@localhost ~]# yum install ntfsprogs
[root@localhost ~]# yum install ntfs-3g
2.2 分区
将3T的硬盘挂到rhel6并进行分区,mbr分区表不支持3T的硬盘,需使用parted进行分区
[root@localhost ~]# fdisk -l
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801cylinders
Units = cylinders of 16065 * 512 = 8225280bytes
Sector size (logical/physical): 512 bytes /512 bytes
I/O size (minimum/optimal): 512 bytes / 512bytes
Disk identifier: 0xf6aaf454
Device Boot Start End Blocks Id System
/dev/sda1 * 1 26 204800 83 Linux
Partition 1 does not end on cylinderboundary.
/dev/sda2 26 1071 8392704 82 Linux swap / Solaris
/dev/sda3 1071 60802 479788032 83 Linux
WARNING: GPT (GUID Partition Table)detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.
Disk /dev/sdb: 3000.6 GB, 3000592982016 bytes
255 heads, 63 sectors/track, 364801cylinders
Units = cylinders of 16065 * 512 = 8225280bytes
Sector size (logical/physical): 512 bytes /4096 bytes
I/O size (minimum/optimal): 4096 bytes /4096 bytes
Disk identifier: 0xe7fad028
Device Boot Start End Blocks Id System
/dev/sdb1 1 267350 2147483647+ ee GPT
Partition 1 does not start on physicalsector boundary.
使用parted 分区:
[root@localhost ~]# parted /dev/sdb
GNU Parted 2.1
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to viewa list of commands.
(parted) print
Model: ATA WDC WD30EZRX-00D (scsi)
Disk /dev/sdb: 3001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
(parted) mkpart
Partition name? []? p1
File system type? [ext2]? ntfs
Start? 0
End? 1500G
Warning: The resulting partition is notproperly aligned for best performance.
Ignore/Cancel? i
(parted) mkpart
Partition name? []? p2
File system type? [ext2]? ntfs
Start? 1500G
End? 3000G
(parted) print
Model: ATA WDC WD30EZRX-00D (scsi)
Disk /dev/sdb: 3001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Number Start End Size File system Name Flags
1 17.4kB 1500GB 1500GB p1
2 1500GB 3001GB 1501GB p2
Number Start End Size File system Name Flags
(parted) quit
[root@localhost ~]# parted -l /dev/sdb
Model: ATA ST3500630SV (scsi)
磁盘 /dev/sda:500GB
扇区大小 (逻辑/物理):512B/512B
分割区:msdos
编号 起始点 结束点 大小 类型 文件系统 旗标
1 1049kB 211MB 210MB primary ext4 启动
2 211MB 8805MB 8594MB primary linux-swap(v1)
3 8805MB 500GB 491GB primary ext4
Model: ATA WDC WD30EZRX-00D (scsi)
磁盘 /dev/sdb:3001GB
扇区大小 (逻辑/物理):512B/4096B
分割区:gpt
编号 起始点 结束点 大小 文件系统 名称 旗标
1 17.4kB 1500GB 1500GB p1
2 1500GB 3001GB 1501GB p2
[root@localhost ~]# ls /dev/sdb*
/dev/sdb /dev/sdb1 /dev/sdb2
2.3 格式化:
[root@localhost ~]# mkntfs -f /dev/sdb1
Cluster size has been automatically set to4096 bytes.
Creating NTFS volume structures.
mkntfs completed successfully. Have a niceday.
[root@localhost ~]# mkntfs -f /dev/sdb2
Cluster size has been automatically set to4096 bytes.
Creating NTFS volume structures.
mkntfs completed successfully. Have a niceday.
[root@localhost ~]# parted -l /dev/sdb
Model: ATA ST3500630SV (scsi)
磁盘 /dev/sda:500GB
扇区大小 (逻辑/物理):512B/512B
分割区:msdos
编号 起始点 结束点 大小 类型 文件系统 旗标
1 1049kB 211MB 210MB primary ext4 启动
2 211MB 8805MB 8594MB primary linux-swap(v1)
3 8805MB 500GB 491GB primary ext4
Model: ATA WDC WD30EZRX-00D (scsi)
磁盘 /dev/sdb:3001GB
扇区大小 (逻辑/物理):512B/4096B
分割区:gpt
编号 起始点 结束点 大小 文件系统 名称 旗标
1 17.4kB 1500GB 1500GB ntfs p1
2 1500GB 3001GB 1501GB ntfs p2
格式化完成后,就可以装到硬盘盒上从windows机器上copy数据了,拷完后再挂回rhel6:
挂载:
[root@localhost ~]#mount -t ntfs-3g -o rw /dev/sdb1 /mnt/dp1