Compiled by: nocon Thu Dec 5 21:13:41 CST 2002 http://nocon.darkflame.net Solaris disk suite concatenation mini how-to Packages -------------------------------------------------------------------------------------------- You can download from here: http://wwws.sun.com/software/solaris/get.html#4 (Includes patch: 108693-06) or On the Solaris CD: .../Solaris_8/EA/products/DiskSuite_4.2.1/ ============================================================================================= For command line DiskSuite ---------------------------------- SUNWmdnr Solstice DiskSuite Log Daemon Configuration Files (sparc) 4.2.1,REV=1999.11.04.18.29 (optoinal) SUNWmdnu Solstice DiskSuite Log Daemon (sparc) 4.2.1,REV=1999.11.04.18.29 (optoinal) SUNWmdr Solstice DiskSuite Drivers (sparc) 4.2.1,REV=1999.12.03.10.00 SUNWmdu Solstice DiskSuite Commands (sparc) 4.2.1,REV=1999.11.04.18.29 SUNWmdx Solstice DiskSuite Drivers(64-bit) (sparc) 4.2.1,REV=1999.11.04.18.29 ============================================================================================ Preliminary Information for Creating Stripes and Concatenations --------------------------------------------------------------------- * In DiskSuite terms, stripes and concatenations are "simple metadevices" in that they are composed of slices. Both stripes and concatenations enable you to expand disk storage capacity. They can be used either directly or as the building blocks for mirrors and trans metadevices. * The system must contain at least three state database replicas before you can create stripes and concatenations. (See Chapter 1, Getting Started.) * You can use multi-way stripes and concatenations (stripes or concatenations that consist of more than one slice) for any file system except the following: o Root (/) o swap (You can create multiple, single-slice swap metadevices) o /usr o /var o /opt o Any other file system accessed during a Solaris installation or upgrade * Do not stripe slices that are on the same physical disk. This practice eliminates simultaneous access and reduces performance. * If possible create metadevices from disks consisting of the same disk geometries. The historical reason is that UFS uses disk blocks based on disk geometries. Today, the issue is centered around performance: a stripe composed of disks with different geometries will only be as fast as its slowest disk. * When possible, distribute the slices of a stripe or concatenation across different controllers and busses. Using stripes that are each on different controllers increases the number of simultaneous reads and writes that can be performed. * Do not create a striped metadevice from an existing file system or data. Doing so will destroy data. Instead, use a concatenation. (You can create a striped metadevice from existing data, but you must dump and restore the data to the metadevice.) * Avoid striping slices with different sizes; this wastes disk space. If necessary, you can assign the unused portion to another slice. The slice must be repartitioned (using format(1M), fmthard(1M), or Storage Manager) to assign the unused disk space to another available slice name. -------------------------------------------------------------------------------------------------------------------------------- How to Create Initial State Database Replicas From Scratch (Command Line) ---------------------------------------------------------------------------- Choose some disks that are free: # cat /etc/vfstab [...] # #/dev/dsk/c0t1d0s0 /dev/rdsk/c0t1d0s0 /d1 ufs 2 yes - #/dev/dsk/c0t2d0s0 /dev/rdsk/c0t2d0s0 /d2 ufs 2 yes - # df -ak [...] /dev/dsk/c0t1d0s0 35292880 9 34939943 1% /d1 /dev/dsk/c0t2d0s0 35292880 9 34939943 1% /d2 # umount /d1 # umount /d2 - In this example we have 2 hard disks of 35gb (estimated) each. We will "concatenate" this drives so the system will see these as one 70gb (estimated) disk. Create the Initial State Databases on each of the two disks: # metadb -a -f c0t1d0s0 c0t2d0s0 - The -a and -f options are used together to create the initial state database replicas. Two initial state database replicas, one on each of two slices, are created. By spreading the state database replicas across controllers, you can increase metadevice performance and reliability. The metadb command checks that the replicas are active, as indicated by the -a flag. To show the new databases created: # metadb flags first blk block count a u 16 1034 /dev/dsk/c0t1d0s0 a u 16 1034 /dev/dsk/c0t2d0s0 Entrys should now be in /etc/system: # tail /etc/system [...] * Begin MDD database info (do not edit) set md:mddb_bootlist1="sd:8:16 sd:16:16" * End MDD database info (do not edit) ---------------------------------------------------------------------------------------------------- How to Create a Concatenation (Command Line) --------------------------------------------- The following examples create concatenations that do not contain any existing data: # metainit d0 2 1 c0t1d0s0 1 c0t2d0s0 d0: Concat/Stripe is setup - This example creates a concatenation, d0, consisting of two "stripes" (the number 2) each made of a single slice (the number 1 in front of each slice). The system verifies that the Concat/Stripe object has been set up. Check status: # metastat d0: Concat/Stripe Size: 143343144 blocks Stripe 0: Device Start Block Dbase c0t1d0s0 4788 Yes Stripe 1: Device Start Block Dbase c0t2d0s0 4788 Yes ------------------------------------------------------------------------------------------------------ How to Create a File System on a Metadevice (Command Line) ----------------------------------------------------------- Creating a File System on a Concatenation: # newfs /dev/md/rdsk/d0 newfs: construct a new file system /dev/md/rdsk/d0: (y/n)? y Cylinder groups must have a multiple of 4 cylinders with the given parameters Rounded cgsize up to 204 /dev/md/rdsk/d0: 143343144 sectors in 29938 cylinders of 12 tracks, 399 sectors 69991.8MB in 1497 cyl groups (20 c/g, 46.76MB/g, 5696 i/g) super-block backups (for fsck -F ufs -o b=#) at: 32, 96192, 192352, 288512, 384672, 480832, 576992, 673152, 769312, 865472, 961632, 1057792, 1153952, 1250112, 1346272, 1442432, 1532192, 1628352, [...] The fsck(1M) command verifies the new file system: # fsck /dev/md/rdsk/d0 ** /dev/md/rdsk/d0 ** Last Mounted on ** Phase 1 - Check Blocks and Sizes ** Phase 2 - Check Pathnames ** Phase 3 - Check Connectivity ** Phase 4 - Check Reference Counts ** Phase 5 - Check Cyl groups 2 files, 9 used, 70581707 free (11 frags, 8822712 blocks, 0.0% fragmentation) # ------------------------------------------------------------------------------------------------ Where to Go From Here ----------------------------------- ---------------------------------------------------------------------------------------------------------------------- If You Want to Make the File System Available? Then: =============================================== ================================================== Now Mount the file system with the mount(1M) command, specifying the metadevice name as the mount device, such as /dev/md/dsk/d0. --------------------------------------------------------------------------------------------------------------------- Automatically when the system boots Create or modify the file system's entry in /etc/vfstab file, using the metadevice block and raw device names. --------------------------------------------------------------------------------------------------------------------- As a shared (exported) resource Create a file system entry in the /etc/dfs/dfstab file. ----------------------------------------------------------------------------------------------------------------------- Here is an example of "mounting" the file system at boot: --------------------------------------------------------- Edit /etc/vfstab: # vi /etc/vfstab [...] /dev/md/dsk/d0 /dev/md/rdsk/d0 /var/mail ufs 1 yes - # After editing and saving mount the filesystem: # mount /var/mail # df -ak [...] /dev/md/dsk/d0 70581716 9 69875890 1% /var/mail # Reboot the system to test if you choose: # /etc/shutdown -i6 -g0 -y ----------------------------------------------------------------------------------------------------- References: ---------------- Download: http://wwws.sun.com/software/solaris/get.html#4 User Guide: http://docs.sun.com/db/doc/805-5961?q=disksuite Some Notes: http://www.eos.ncsu.edu/eos/info/ccc_info/services/disksuite/ DiskSuite Step by Step: http://www.livewire.ca/Service/disksuite.html