Created
September 3, 2015 05:38
-
-
Save kentarosasaki/c24413c8880f98e1fea7 to your computer and use it in GitHub Desktop.
ループバックデバイスを使って普通のファイルをXFSファイルシステムとしてマウントしてみる ref: http://qiita.com/kentarosasaki/items/b3808694a4aec1a83388
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo apt-get install -y xfsprogs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo mkdir -p /srv/node/images | |
$ sudo touch /srv/node/images/file.img |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo truncate -s 50G /srv/node/images/file.img |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo /sbin/mkfs.xfs -f -i size=1024 /srv/node/images/file.img | |
meta-data=/srv/node/images/file.img isize=1024 agcount=4, agsize=3276800 blks | |
= sectsz=512 attr=2, projid32bit=0 | |
data = bsize=4096 blocks=13107200, imaxpct=25 | |
= sunit=0 swidth=0 blks | |
naming =version 2 bsize=4096 ascii-ci=0 | |
log =internal log bsize=4096 blocks=6400, version=2 | |
= sectsz=512 sunit=0 blks, lazy-count=1 | |
realtime =none extsz=4096 blocks=0, rtextents=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ file /srv/node/images/file.img | |
/srv/node/images/file.img: SGI XFS filesystem data (blksz 4096, inosz 1024, v2 dirs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo mkdir -p /mnt/loop0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo mount -t xfs -o loop,noatime,nodiratime,nobarrier,logbufs=8 /srv/node/images/file.img /mnt/loop0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ df -h | grep loop0 | |
/dev/loop0 50G 33M 50G 1% /mnt/loop0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment