スパースファイル試行

恥ずかしながら、スパースファイルの存在を最近知った。少し試してみたので、その際のログを記す。
ログ
1) スパースファイルを作る
[owner@localhost ~]$ dd if=/dev/zero of=./test bs=1M seek=10 count=0 
0+0 records in 
0+0 records out 
0 bytes (0 B) copied, 9.7e-05 seconds, 0.0 kB/s 
[owner@localhost ~]$ stat ./test 
File: `./test' 
Size: 10485760 Blocks: 8 IO Block: 4096 通常ファイル 
Device: fd00h/64768d Inode: 4369481 Links: 1 
Access: (0664/-rw-rw-r--) Uid: ( 500/ owner) Gid: ( 500/ owner) 
Access: 2011-04-25 12:36:54.000000000 +0900 
Modify: 2011-04-25 12:36:54.000000000 +0900 
Change: 2011-04-25 12:36:54.000000000 +0900 
[owner@localhost ~]$
2) スパースを解除する
[owner@localhost ~]$ cp --sparse=never ./test ./test1 
[owner@localhost ~]$ stat ./test1 
File: `./test1' 
Size: 10485760 Blocks: 20520 IO Block: 4096 通常ファイル 
Device: fd00h/64768d Inode: 4369533 Links: 1 
Access: (0664/-rw-rw-r--) Uid: ( 500/ owner) Gid: ( 500/ owner) 
Access: 2011-04-25 12:38:14.000000000 +0900 
Modify: 2011-04-25 12:38:14.000000000 +0900 
Change: 2011-04-25 12:38:14.000000000 +0900 
[owner@localhost ~]$
3) スパースを再作成
Change: 2011-04-25 12:38:14.000000000 +0900 
[owner@localhost ~]$ cp --sparse=always ./test1 ./test2 
[owner@localhost ~]$ stat ./test2 
File: `./test2' 
Size: 10485760 Blocks: 8 IO Block: 4096 通常ファイル 
Device: fd00h/64768d Inode: 4369553 Links: 1 
Access: (0664/-rw-rw-r--) Uid: ( 500/ owner) Gid: ( 500/ owner) 
Access: 2011-04-25 12:39:29.000000000 +0900 
Modify: 2011-04-25 12:39:29.000000000 +0900 
Change: 2011-04-25 12:39:29.000000000 +0900 
[owner@localhost ~]$
参考
以上

コメント