
[计算机]linux添加新盘及分区格式化-fdisk图解.doc
4页简单介绍一下在linux系统下连接磁盘阵列的方法,使用的是RedHat linux将磁盘阵列与主机连接好后,首先要查看设备[root@localhost ~]#cat /proc/scsi/scsi 如图1找到了两个,下面的是自己的硬盘,上面的是Infortrend公司的一台U12U-G4020找到了设备,下一步我们来查看一下硬盘[root@localhost ~]#fdisk –l 如图2下面分好区的是主机上的硬盘,设备/dev/sda是我们要连接的那台U12U-G4020磁盘阵列,下面我们就要对磁盘阵列进行分区及写入文件系统[root@localhost ~]#fdisk /dev/sda 如图3输入m显示help菜单Command (m for help):m 如图4写分区表Command (m for help):p 如图5、6添加一个新的分区,分区号为1写入分区表后退出Command (m for help):w 如图7下面要加载文件系统,选择ext3文件系统进行加载[root@localhost ~]#mkfs.ext3 /dev/sda 如图8文件系统已经写好了,下面我们建一个文件夹把盘阵挂载上去,文件夹建在mnt下,名为sda[root@localhost ~]#mkdir /mnt/sda[root@localhost ~]#mount /dev/sda /mnt/sda 如图9现在已经挂载好了,磁盘阵列可以开始使用了。
挂载iscsi设备的方法有些不同,也做一下简单介绍如果没有安装iscsi-initiator首先要下载适合系统内核的iscsi-initiator-utils[root@localhost ~]# yum install iscsi-initiator-utils下载好后可寻找iscsi设备,下面显示的为找到的设备[root@localhost ~]# iscsiadm -m discovery -t st -p 172.16.60.147172.16.60.147:3260,1 iqn.2002-.infortrend:raid.sn7051919.00在设备ip后所加的为上面查到的设备iqn号[root@localhost ~]# iscsiadm -m node -p 172.16.60.147 -T iqn.2002-.infortrend:raid.sn7051919.00 -l此时,重启iscsi服务[root@localhost ~]# /etc/init.d/iscsi restartStopping iSCSI initiator service: [ OK ]Starting iSCSI initiator service: [ OK ]此时查看磁盘即可发现iscsi设备[root@localhost ~]# fdisk -lDisk /dev/hda: 60.0 GB, 60011642880 bytes255 heads, 63 sectors/track, 7296 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System/dev/hda1 * 1 1020 8193118+ 7 HPFS/NTFS/dev/hda2 1021 6665 45343462+ f W95 Ext'd (LBA)/dev/hda3 6666 7296 5068507+ 12 Compaq diagnostics/dev/hda5 1021 3570 20482843+ 7 HPFS/NTFS/dev/hda6 3571 4590 8193118+ 7 HPFS/NTFS/dev/hda7 4591 4603 104391 83 Linux/dev/hda8 5690 6665 7839688+ 83 Linux/dev/hda9 4604 4667 514048+ 82 Linux swap / Solaris/dev/hda10 4668 5689 8209183+ 83 LinuxPartition table entries are not in disk orderDisk /dev/sda: 499.5 GB, 499570966528 bytes255 heads, 63 sectors/track, 60736 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System/dev/sda1 1 60735 487853856 7 HPFS/NTFS下面的操作即与其他设备的操作相同,不再重复。












