ユーザ用ツール

サイト用ツール


サイドバー

このページの翻訳:



最近の更新



Tag Cloud

01_linux:01_net:29_tgt_thin_provision

文書の過去の版を表示しています。


29 TGT で thin provision

下記はティスクで作成している解説
32_CentOSでiSCSI環境構築

TGTでシンプロビジョニングを利用する場合、TGTのバックエンドはディスクではなく、ファイルである必要があります。

Not all filesystems support FALLOC_FL_PUNCH_HOLE; if a filesystem
     doesn't support the operation, an error is returned.  The operation
     is supported on at least the following filesystems:

     *  XFS (since Linux 2.6.38)

     *  ext4 (since Linux 3.0)

     *  Btrfs (since Linux 3.7)

     *  tmpfs(5) (since Linux 3.5)

     *  gfs2(5) (since Linux 4.16)

1. Sparseファイル作成

これで500G のSparseファイル作成

# dd if=/dev/zero of=/mnt/file.img bs=1 count=0 seek=500G

見た目上500Gだが、実使用量は0になります。

# du -h --apparent-size /mnt/file.img 
500G    file.img

# du -h file.img 
0       file.img

2.SpaseディスクをLUNとして追加

# tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 --backing-store /mnt/file.img

3.シンプロビジョニングを有効にする

# tgtadm --lld iscsi --mode logicalunit --op update --tid 1 --lun 1 --params thin_provisioning=1 
01_linux/01_net/29_tgt_thin_provision.1585023750.txt.gz · 最終更新: 2020/03/24 13:22 by matsui