顯示具有 系統操作::檔案系統管理 標籤的文章。 顯示所有文章
顯示具有 系統操作::檔案系統管理 標籤的文章。 顯示所有文章

2016年7月4日 星期一

XFS 檔案系統與 LVM

LVM 的使用
  • 查看系統內容:
    #lvs
    #pvs
    #vgs
    

參考資料:
  • http://jamyy.us.to/blog/2015/09/7673.html
  • http://dywang.csie.cyut.edu.tw/dywang/rhel7/node60.html

2016年5月29日 星期日

在 CentOS7/RHEL7 上設定 RAID 磁碟陣列系統

設定目標:
  • 在 Centos 7 上安裝設定 RAID 服務!
快速設定流程:
  1. 利用 yum 安裝
    #yum install 
    

參考文獻:

  1. https://wiki.centos.org/HowTos/SoftwareRAIDonCentOS5

2016年5月18日 星期三

在 CentOS7/RHEL7 上設定 iSCSI (二)

Target 快速設定流程:
  1. 安裝相關套件:
    #yum install iscsi-initiator-utils
    
  2. 編輯 Initiator 名稱:
    #vim /etc/iscsi/initiatorname.iscsi
    InitiatorName=iqn.2016-05.com.example:server2
    
  3. 啟動 Initiator 服務:
    #systemctl enable iscsi
    #systemctl restart iscsi
    
  4. 利用 iscsiadm 登入 iSCSI :
    #iscsiadm -m discovery -t st -p 192.168.5.244
    #iscsiadm -m node -T iqn.2016-05.com.example:server1.disk01 -p 192.168.5.244 -l
    
  5. 掛載 iSCSI 分出來的硬碟空間:
    #lsblk
    #tail /var/log/messages
    #fdisk /dev/sdb
    #mkfs -t ext4 /dev/sdb1
    #blkid /dev/sdb1
    #vim /etc/fstab
      UUID=xxxx   /mnt/data  ext4 _netdev 0 0
    
  6. 利用 iscsiadm 登出 iSCSI :
    #iscsiadm -m node -T iqn.2016-05.com.example:server1.disk01 -p 192.168.5.244 -u
    

2016年5月17日 星期二

在 CentOS7/RHEL7 上設定 iSCSI (一)

Target 快速設定流程:
  1. 安裝相關套件:
    #yum -y install targetcli
    
  2. 打開防火牆設定:
    #firewall-cmd --permanent --add-port=3260/tcp
    #firewall-cmd --reload
    
  3. 啟動 iSCSI Target 服務:
    #systemctl enable target
    #systemctl start target
    
  4. 建立資料夾內影像檔,提供本次設定:
    #mkdir /iscsi_disks
    #dd if=/dev/zero of=/iscsi_disks/disk01.img bs=1M count=1024
    
  5. 使用專屬管理 console 介面:
    # targetcli
    
  6. 建立一個檔案名稱,連結影像檔:
    /> cd backstores/fileio
    /backstores/fileio> create server1.disk01 /iscsi_disks/disk01.img
    
  7. 建立 iSCSI target 名稱:
    /backstores/fileio> cd /iscsi
    /iscsi> create iqn.2016-05.com.example:server1.disk01
    
  8. 建立 ACL 名稱:
    /iscsi> cd iqn.2016-05.com.example:server1.disk01/tpg1/acls/
    /iscsiiqn.2016-05.com.example:server1.disk01/tpg1/acls/> create iqn.2016-05.com.example:server2
  9. 連結 LUN:
    /iscsiiqn.2016-05.com.example:server1.disk01/tpg1/acls/> cd iqn.2016-05.com.example:server1.disk01/tpg1/luns/
    /iscsiiqn.2016-05.com.example:server1.disk01/tpg1/luns/> create /backstores/fileio/server1.disk01
  10. 建立 portal:
    /iscsiiqn.2016-05.com.example:server1.disk01/tpg1/acls/> cd iqn.2016-05.com.example:server1.disk01/tpg1/portals/
    /iscsiiqn.2016-05.com.example:server1.disk01/tpg1/portals/> create 192.168.5.243
    
  11. 存檔、離開:
    /iscsiiqn.2016-05.com.example:server1.disk01/tpg1/acls/> cd / 
    /> saveconfig
    /> exit
    

2016年3月29日 星期二

XFS 檔案系統管理

Quota (磁碟配額) 的使用
  • 安裝 quota 套件:
    #yum -y install quota
    
  • 使用 xfs_quota 指令與格式
    xfs_quota [option] [mount_point]
    
    [option]
    • -x:專家模式
    • -c:配合專家模式,在後面追加下列指令:
      • print:列出目前主機內的檔案系統參數資料
      • df:與系統指令 df 功能相同
      • report:列出 quota 資料,可用參數包含 -ugr (user/group/project) 及 -bi (block/inode)
      • state:顯示目前 quota 資訊
      • limit:限制配額空間,針對 user/group 來限制
          指令格式limit [-ug] b[soft|hard]=N i[soft|hard]=N name
          bsoft/bhard : block 限制值,後面可以加上空間單位
          isoft/ihard : inode 限制值
          name:用戶/群組名稱
      • timer:設定 grace time
          指令格式timer [-ug] [-bir] Ndays
    [mount_point]
    • 檔案系統掛載點
  • 使用範例與測試:
    範例一:
    1. 編輯 /etc/fstab 檔案,加入 quota 功能:
      #vim /etc/fstab
      UUID=XXXX  /webhome  xfs  defaults,usrquota,grpquota  0  0
      
    2. 重新掛載檔案系統:
      #mount -o remount -a
      
    3. 查看所有相關的訊息:
      #xfs_quota -x -c "print"
      #xfs_quota -x -c "df -h" /home
      #xfs_quota -x -c "report -ubih" /home
      #xfs_quota -x -c "state"
      
    4. 編寫設定:
      #xfs_quota -x -c "limit -u bsoft=1024M bhard=1500M user1" /webhome
      #xfs_quota -x -c "timer -u -b 30days" /webhome
      
    5. 測試:
      #su - user1
      $dd if=/dev/zero of=/webhome/123.img bs=1M count=1300
      $ls -al /webhome/123.img
      $exit
      #xfs_quota -x -c "report -ubh" /webhome
      

2015年11月10日 星期二

BTRFS 介紹

https://www.ibm.com/developerworks/cn/linux/l-cn-btrfs/