测试iscsi服务是否正常
[root@FocusBackup ~]# service iscsi restart
停止iscsi:[确定]
[root@FocusBackup ~]# chkconfig iscsi on
[root@FocusBackup ~]# iscsiadm -m discovery -t sendtargets -p 10.5.83.131
正在启动iscsid:[确定]
10.5.83.131:3260,1 iqn.2006-01.com.openfiler:tsn.vmlocalbackup
[root@FocusBackup ~]# iscsiadm -m node -T iqn.2006-01.com.openfiler:tsn.vmlocalbackup -p 10.5.83.131 -l
Logging in to [iface: default, target: iqn.2006-01.com.openfiler:tsn.vmlocalbackup, portal: 10.5.83.131,3260] (multiple)
Login to [iface: default, target: iqn.2006-01.com.openfiler:tsn.vmlocalbackup, portal: 10.5.83.131,3260] successful.
查看硬盘设备
[root@FocusBackup ~]# fdisk -l
Disk /dev/sda: 322.1 GB, 322122547200 bytes
255 heads, 63 sectors/track, 39162 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: 0x000a4673
Device BootStartEndBlocksIdSystem
/dev/sda1*12620480083Linux
Partition 1 does not end on cylinder boundary.
/dev/sda22613321048576082Linux swap / Solaris
/dev/sda313322610919902361683Linux
/dev/sda426109391631048576005Extended
/dev/sda526109 3916310485657683Linux
Disk /dev/sdb: 2199.0 GB, 2199023254528 bytes
255 heads, 63 sectors/track, 267349 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: 0x000bfa7a
Device BootStartEndBlocksIdSystem
/dev/sdb11267349214748081183Linux
Disk /dev/sdd: 1099.5 GB, 1099511627776 bytes
255 heads, 63 sectors/track, 133674 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/sdd doesn't contain a valid partition table
Disk /dev/sdc: 2199.0 GB, 2199023254528 bytes
255 heads, 63 sectors/track, 267349 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: 0x26e7758c
Device BootStartEndBlocksIdSystem
/dev/sdc11267349214748081183Linux
WARNING: GPT (GUID Partition Table) detected on '/dev/sde'! The util fdisk doesn't support GPT. Use GNU Parted.
Disk /dev/sde: 6597.0 GB, 6596969103360 bytes
255 heads, 63 sectors/track, 802035 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 BootStartEndBlocksIdSystem
/dev/sde112673502147483647+eeGPT
对超过2TB的硬盘进行分区需要使用parted
[root@FocusBackup ~]# parted /dev/sde
GNU Parted 2.1
使用/dev/sde
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel gpt
警告: The existing disk label on /dev/sde will be destroyed and all data on this disk will be lost. Do you want to continue?
是/Yes/否/No? y
(parted) print
Model: OPNFILER VIRTUAL-DISK (scsi)
Disk /dev/sde: 6597GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
NumberStartEndSizeFile systemName标志
(parted) mkpart primary 0KB 6597GB
警告: You requested a partition from 0.00B to 6597GB.
The closest location we can manage is 17.4kB to 6597GB.
Is this still acceptable to you?
是/Yes/否/No? y
警告: The resulting partition is not properly aligned for best performance.
忽略/Ignore/放弃/Cancel? i
(parted) print
Model: OPNFILER VIRTUAL-DISK (scsi)
Disk /dev/sde: 6597GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
NumberStartEndSizeFile systemName标志
117.4kB6597GB6597GBprimary
(parted) quit
信息: You may need to update /etc/fstab.
对创建好的大分区进行格式化
[root@FocusBackup ~]# fdisk -l
Disk /dev/sda: 322.1 GB, 322122547200 bytes
255 heads, 63 sectors/track, 39162 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: 0x000a4673
Device BootStartEndBlocksIdSystem
/dev/sda1*12620480083Linux
Partition 1 does not end on cylinder boundary.
/dev/sda22613321048576082Linux swap / Solaris
/dev/sda313322610919902361683Linux
/dev/sda426109391631048576005Extended
/dev/sda5261093916310485657683Linux
Disk /dev/sdb: 2199.0 GB, 2199023254528 bytes
255 heads, 63 sectors/track, 267349 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: 0x000bfa7a
Device BootStartEndBlocksIdSystem
/dev/sdb11267349214748081183Linux
Disk /dev/sdd: 1099.5 GB, 1099511627776 bytes
255 heads, 63 sectors/track, 133674 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/sdc: 2199.0 GB, 2199023254528 bytes
255 heads, 63 sectors/track, 267349 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: 0x26e7758c
Device BootStartEndBlocksIdSystem
/dev/sdc11267349214748081183Linux
WARNING: GPT (GUID Partition Table) detected on '/dev/sde'! The util fdisk doesn't support GPT. Use GNU Parted.
Disk /dev/sde: 6597.0 GB, 6596969103360 bytes
255 heads, 63 sectors/track, 802035 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 BootStartEndBlocksIdSystem
/dev/sde112673502147483647+eeGPT
[root@FocusBackup ~]# mkfs.ext4 /dev/sde1
mke2fs 1.41.12 (17-May-2010)
文件系统标签=
操作系统:Linux
块大小=4096 (log=2)
分块大小=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
402653184 inodes, 1610588151 blocks
80529407 blocks (5.00%) reserved for the super user
第一个数据块=0
Maximum filesystem blocks=4294967296
49152 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
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
正在写入inode表:完成
Creating journal (32768 blocks):完成
Writing superblocks and filesystem accounting information:完成
This filesystem will be automatically checked every 37 mounts or
180 days, whichever comes first.Use tune2fs -c or -i to override.
写入开机启动项,完成挂载操作
可以使用vi /etc/fstab
也可以使用vi /etc/rc.local