国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > Linux > 正文

Linux系統是如何掛載iscsi存儲的?

2020-06-13 11:39:43
字體:
來源:轉載
供稿:網友

Linux掛載iscsi存儲的方式

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

掛載步驟:

1:檢查iscsi rpm包

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

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

4:映射邏輯卷到Linux系統中

5:設置開機自動映射

6:對映射出來的磁盤進行分區

7:分區之后進行格式化

8:掛載分區

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

1、檢查iscsi rpm包

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

安裝rpm包

復制內容到剪貼板

Linux,掛載,iscsi存儲

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

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

Linux,掛載,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.   

Linux,掛載,iscsi存儲

4、映射邏輯卷到Linux系統中

復制內容到剪貼板
  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.   

Linux,掛載,iscsi存儲

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、對映射出來的磁盤進行分區

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

parted /dev/sdb  對/dev/sdb進行分區

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

mklabel gpt   

mkpart primary 0% 100%

print    從中可以看出這個磁盤分區格式已經變了成GPT了

Linux,掛載,iscsi存儲

7、分區之后進行格式化

復制內容到剪貼板
  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.   

Linux,掛載,iscsi存儲

8、掛載分區

復制內容到剪貼板
  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/   
  1. [root@qionghai11g Packages]# rpm -Uvh iscsi-initiator-utils-6.2.0.873-2.el6.x86_64.rpm     

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 琼中| 宿迁市| 柞水县| 齐河县| 尖扎县| 漾濞| 娱乐| 双鸭山市| 东阳市| 洛南县| 怀远县| 增城市| 黑水县| 辽阳市| 甘洛县| 长葛市| 定陶县| 乌兰察布市| 和平区| 方正县| 阳曲县| 阳信县| 岢岚县| 化州市| 惠来县| 上蔡县| 察隅县| 交城县| 衡山县| 十堰市| 宣威市| 志丹县| 防城港市| 义乌市| 栾城县| 天台县| 娄烦县| 田东县| 辽宁省| 武山县| 宁海县|