Sometimes we need to test on a XFS filesystem, just create a fake one using a file.
1.Create a 500MB temp file
# dd if=/dev/zero of=openkbtest count=999999
999999+0 records in
999999+0 records out
511999488 bytes (512 MB) copied, 0.89366 seconds, 573 MB/s
# ls -altr openkbtest
-rw-r--r-- 1 root root 511999488 Aug 16 14:31 openkbtest
2.Format the file to XFS filesystem
# /sbin/mkfs -t xfs -q openkbtest
3.Create a directory which will be the mount point
$ mkdir testmount
4.Check loopback device number,most likely we can start with loop0 if it is not used by others.
$ cat /proc/mounts|grep loop
$ cd /dev
[dev]$ ls -altr|grep loop
brw-r----- 1 root disk 7, 0 Jun 14 15:04 loop0
brw-r----- 1 root disk 7, 1 Jun 14 15:04 loop1
brw-r----- 1 root disk 7, 2 Jun 14 15:04 loop2
brw-r----- 1 root disk 7, 3 Jun 14 15:04 loop3
brw-r----- 1 root disk 7, 4 Jun 14 15:04 loop4
brw-r----- 1 root disk 7, 5 Jun 14 15:04 loop5
brw-r----- 1 root disk 7, 6 Jun 14 15:04 loop6
brw-r----- 1 root disk 7, 7 Jun 14 15:04 loop7
5.Mount it
# mount -o loop=/dev/loop0 /data/tmp/openkbtest /data/xxx/testmount
# cat /proc/mounts|grep loop
/dev/loop0 /data/xxx/testmount xfs rw,noquota 0 0
No comments:
Post a Comment