MTBUFS Testing Using ZFS
MTBUFS (multi-terabyte UFS) was first released in Solaris 9 update 4. Lori Alt (a member of the ZFS project team) developed MTBUFS after some very innovative thinking and careful review of the UFS data structures and employing EFI disk labels which allowed greater than a terabyte of storage per disk. This allowed her to extend UFS to 16 terabytes. Genius!!
But, how do you test this capability when you only have a few gigabytes of storage? Luckily the first prototype of ZFS was available which allowed us to create sparse volumes up to 16 exabytes in size. We still did real 16 terabyte MTBUFS testing using SVM of course, but ZFS greatly expanded the number of test cases we could perform. Here's how you create a 16 terabyte MTBUFS file system on a much smaller disk:
1) Create a sparse (256 terabyte) zvolume using a 33 gigabyte disk
$ zpool create testpool c0t6d0
$ zfs list
NAME USED AVAIL REFER MOUNTPOINT
testpool 31.5K 33.5G 8K /testpool
$ zfs create -s -V 256T testpool/testvol
$ zfs list
NAME USED AVAIL REFER MOUNTPOINT
testpool 43.0K 33.5G 8K /testpool
testpool/testvol 7.00K 33.5G 7.00K -
$ zfs list -o volsize testpool/testvol
VOLSIZE
256T
2) Create a 16 terabyte MTBUFS file system
$ newfs /dev/zvol/dsk/testpool/testvol
newfs: construct a new file system /dev/zvol/rdsk/testpool/testvol: (y/n)? y
Warning: 4112 sector(s) in last cylinder unallocated
/dev/zvol/rdsk/testpool/testvol: 34359738352 sectors in 5592406 cylinders
of 48 tracks, 128 sectors
16777216.0MB in 39108 cyl groups (143 c/g, 429.00MB/g, 448 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 878752, 1757472, 2636192, 3514912, 4393632, 5272352, 6151072, 7029792
Initializing cylinder groups:
...............................................................................
...............................................................................
...............................................................................
...............................................................................
......................................................................
super-block backups for last 10 cylinder groups at:
34351197472, 34352076192, 34352954912, 34353833632, 34354712352,
34355591072, 34356461600, 34357340320, 34358219040, 34359097760
Note the space used for the MTBUFS metadata.
$ zfs list
NAME USED AVAIL REFER MOUNTPOINT
testpool 2.47G 31.0G 8K /testpool
testpool/testvol 2.47G 31.0G 2.47G -
Test out the MTBUFS file system
$ mkdir /mtbufs
$ mount /dev/zvol/dsk/testpool/testvol /mtbufs
$ df -lk | grep mtbufs
/dev/zvol/dsk/testpool/testvol 17177052768 65560 17005216688 1% /mtbufs
$ cd /mtbufs
$ mkfile 2G testfile
$ zfs list
NAME USED AVAIL REFER MOUNTPOINT
testpool 4.47G 29.0G 8K /testpool
testpool/testvol 4.47G 29.0G 4.47G -
$ ls -l
total 4196402
drwxr-xr-x 3 root root 512 Nov 21 14:44 ./
drwxr-xr-x 45 root root 1024 Nov 21 14:30 ../
drwx------ 2 root root 8192 Nov 21 14:15 lost+found/
-rw------T 1 root root 2147483648 Nov 21 14:49 testfile
Now as long as the file system data doesn't exceed the available zpool space, we can do as much testing as we like. Enjoy!
BTW. Note the MTBUFS magic number in usr/src/uts/common/sys/fs/ufs_fs.h
#define FS_MAGIC 0x011954 #define MTB_UFS_MAGIC 0xdecade
Lori decided not to use her birthday.


Posted by 198.3.32.46 on November 30, 2005 at 11:09 AM MST #
Posted by Leon Koll on December 12, 2005 at 02:51 PM MST #