主頁 > 知識庫 > Linux系統(tǒng)是如何掛載iscsi存儲的?

Linux系統(tǒng)是如何掛載iscsi存儲的?

熱門標簽:美團 服務器配置 解決方案 電話機器人搭建 外呼系統(tǒng) 百度競價點擊價格的計算公式 家政服務網(wǎng)絡 硅谷的囚徒呼叫中心

Linux掛載iscsi存儲的方式

iscsi 提供給Linux掛載有兩種方式,一種通過iscsi 協(xié)議的ip映射,一種通過文件共享 nfs掛載。其中通過iscsi 協(xié)議的ip映射 方式掛載到Linux中以磁盤形式展現(xiàn),ip映射之后還需要對該磁盤分區(qū),并格式化分區(qū)。

掛載步驟:

1:檢查iscsi rpm包

2:啟動iscsi服務并設置開機自啟動

3:查找存儲對外提供的邏輯卷

4:映射邏輯卷到Linux系統(tǒng)中

5:設置開機自動映射

6:對映射出來的磁盤進行分區(qū)

7:分區(qū)之后進行格式化

8:掛載分區(qū)

注意:Linux格式化完之后,邏輯卷的系統(tǒng)文件就是Linux類型的文件系統(tǒng)了,這個邏輯卷如果要掛在到window服務器上就需要將這個邏輯卷沖新格式化,格式化之后的系統(tǒng)就是window的系統(tǒng)文件類型??傊?,通過ip映射的iscsi存儲不能同時掛載到Linux和window中,如果需要做共享,那么最好是將存儲做成文件共享的lun。

1、檢查iscsi rpm包

復制內容到剪貼板
  1. rpm -qa | grep iscsi   
  2.   

安裝rpm包

復制內容到剪貼板
  1. [root@qionghai11g Packages]# rpm -Uvh iscsi-initiator-utils-6.2.0.873-2.el6.x86_64.rpm     
  2. 2、啟動iscsi服務并設置開機自啟動

    復制內容到剪貼板
    1. [root@qionghai11g Packages]# service iscsi start      
    2.     
    3. [root@qionghai11g Packages]# chkconfig --list | grep iscsi      

    3、查找存儲對外提供的邏輯卷

    復制內容到剪貼板
    1.   
    2. [root@qionghai11g ~]# iscsiadm -m discovery -t sendtargets -p 192.16.10.188:3260   
    3.   
    4. Starting iscsid:                                           [  OK  ]   
    5.   
    6. 192.16.10.188:3260,1 iqn.2004-01.com.storbridge:block02-wt   
    7.   
    8. 192.16.10.188:3260,1 iqn.2004-01.com.storbridge:block01-wt   
    9.   

    4、映射邏輯卷到Linux系統(tǒng)中

    復制內容到剪貼板
    1. [root@qionghai11g ~]# iscsiadm -m node -T iqn.2004-01.com.storbridge:block01-wt -p 192.16.10.188:3260 -l   
    2.   
    3. Logging in to [iface: default, target: iqn.2004-01.com.storbridge:block01-wt, portal: 192.16.10.188,3260] (multiple)   
    4.   
    5. Login to [iface: default, target: iqn.2004-01.com.storbridge:block01-wt, portal: 192.16.10.188,3260] successful.   
    6.   
    7. [root@qionghai11g ~]# iscsiadm -m node -T iqn.2004-01.com.storbridge:block02-wt -p 192.16.10.188:3260 -l   
    8.   
    9. Logging in to [iface: default, target: iqn.2004-01.com.storbridge:block02-wt, portal: 192.16.10.188,3260] (multiple)   
    10.   
    11. Login to [iface: default, target: iqn.2004-01.com.storbridge:block02-wt, portal: 192.16.10.188,3260] successful.   
    12.   

    5、設置開機自動映射

    復制內容到剪貼板
    1. [root@qionghai11g ~]# iscsiadm -m node -T iqn.2004-01.com.storbridge:block02-wt -p 192.16.10.188:3260 --op update -n node.startup -v automatic   
    2.   
    3. [root@qionghai11g ~]# iscsiadm -m node -T iqn.2004-01.com.storbridge:block01-wt -p 192.16.10.188:3260 --op update -n node.startup -v automatic   
    4.   

    這兩個是開機自動映射

    6、對映射出來的磁盤進行分區(qū)

    由于存儲容量是12T 大于2T,不能用不同分區(qū) fdisk ,只能用GPT分區(qū)

    parted /dev/sdb  對/dev/sdb進行分區(qū)

    print     打印信息,從中可以看出這個磁盤大小和分區(qū)格式

    mklabel gpt   

    mkpart primary 0% 100%

    print    從中可以看出這個磁盤分區(qū)格式已經(jīng)變了成GPT了

    7、分區(qū)之后進行格式化

    復制內容到剪貼板
    1. [root@oracle11g ~]# mkfs.ext3 /dev/sdb   
    2.   
    3. mke2fs 1.39 (29-May-2006)   
    4.   
    5. /dev/sdb is entire device, not just one partition!   
    6.   
    7. Proceed anyway? (y,n) y   
    8.   
    9. Filesystem label=   
    10.   
    11. OS type: Linux   
    12.   
    13. Block size=4096 (log=2)   
    14.   
    15. Fragment size=4096 (log=2)   
    16.   
    17. 1708998656 inodes, 3417968064 blocks   
    18.   
    19. 170898403 blocks (5.00%) reserved for the super user   
    20.   
    21. First data block=0   
    22.   
    23. Maximum filesystem blocks=4294967296   
    24.   
    25. 104309 block groups   
    26.   
    27. 32768 blocks per group, 32768 fragments per group   
    28.   
    29. 16384 inodes per group   
    30.   
    31. Superblock backups stored on blocks:   
    32.   
    33.          32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,   
    34.   
    35.          4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,   
    36.   
    37.          102400000, 214990848, 512000000, 550731776, 644972544, 1934917632,   
    38.   
    39.          2560000000   
    40.   
    41.     
    42.   
    43. Writing inode tables: done                              
    44.   
    45. Creating journal (32768 blocks): done   
    46.   
    47. Writing superblocks and filesystem accounting information: done      
    48.   
    49. done   
    50.   
    51. This filesystem will be automatically checked every 23 mounts or   
    52.   
    53. 180 days, whichever comes first.  Use tune2fs -c or -i to override.   
    54.   

    8、掛載分區(qū)

    復制內容到剪貼板
    1. [root@qionghai11g ~]# cd /var/www/html/   
    2.   
    3. [root@qionghai11g html]# mkdir kk1 kk2   
    4.   
    5. [root@qionghai11g mnt]# mount  /dev/sdb1 /var/www/html/kk1/   

標簽:邢臺 防城港 撫州 烏蘭察布 臨沂 韶關 南昌 北海

巨人網(wǎng)絡通訊聲明:本文標題《Linux系統(tǒng)是如何掛載iscsi存儲的?》,本文關鍵詞  ;如發(fā)現(xiàn)本文內容存在版權問題,煩請?zhí)峁┫嚓P信息告之我們,我們將及時溝通與處理。本站內容系統(tǒng)采集于網(wǎng)絡,涉及言論、版權與本站無關。
  • 相關文章
  • 收縮
    • 微信客服
    • 微信二維碼
    • 電話咨詢

    • 400-1100-266