Solaris Volume Manager Administration Guide

ProcedureTo Convert a Transactional Volume to Use UFS Logging

Steps
  1. Identify transactional volumes and their associated log devices by using the metastat command and looking for Trans and Logging device in the output.


    # metastat
    d2: Trans
        State: Okay         
        Size: 2869209 blocks
        Master Device: d0
        Logging Device: d20
    
    d20: Logging device for d2
        State: Okay         
        Size: 28470 blocks
    
    d20: Concat/Stripe
        Size: 28728 blocks
        Stripe 0: (interlace: 32 blocks)
            Device              Start Block  Dbase State        Reloc  Hot Spare
            d10                        0     No    Okay         No     
            d11                        0     No    Okay         No     
            d12         

    Note the names for these devices for later use.

  2. Check to see if the Trans device is currently mounted by using the df command and searching for the name of the transactional volume in the output. If the transactional volume is not mounted, go to Step 7.


    # df | grep d2
    /mnt/transvolume   (/dev/md/dsk/d2    ): 2782756 blocks   339196 files
  3. Verify adequate free space on the transactional volume by using the df -k command.


    # df -k /mnt/transvolume
    file system            kbytes    used   avail capacity  Mounted on
    /dev/md/dsk/d2       1391387   91965 1243767     7%    /mnt/transvolume
  4. Stop all activity on the file system, either by halting applications or bringing the system to the single user mode.


    # init s
    [root@lexicon:lexicon-setup]$ init s
    INIT: New run level: S
    The system is coming down for administration.  Please wait.
    Dec 11 08:14:43 lexicon syslogd: going down on signal 15
    Killing user processes: done.
    
    INIT: SINGLE USER MODE
    
    Type control-d to proceed with normal startup,
    (or give root password for system maintenance): 
    single-user privilege assigned to /dev/console.
    Entering System Maintenance Mode
    
    Dec 11 08:15:52 su: 'su root' succeeded for root on /dev/console
    Sun Microsystems Inc.   SunOS 5.9       s81_51  May 2002
    # 
  5. Flush the log for the file system that is logged with lockfs -f.


    # /usr/sbin/lockfs -f /mnt/transvolume
     
    
  6. Unmount the file system.


    # umount /mnt/transvolume
     
    
  7. Clear the transactional volume that contains the file system.

    This operation will not affect the data on the file system.


    # metaclear d2
    d2: Trans is cleared
     

    The Logging device, identified at the beginning of this procedure, is now unused and can be reused for other purposes. The master device, also identified at the beginning of this procedure, contains the file system and must be mounted for use.

  8. Edit the /etc/vfstab file to update the mount information for the file system.

    You must change the raw and block mount points, and add logging to the options for that file system. With the transactional volume in use, the /etc/vfstab entry looks like this:


    /dev/md/dsk/d2  /dev/md/rdsk/d2 /mnt/transvolume   ufs  1   no  -

    After you update the file to change the mount point from the transactional volume d2 to the underlying device d0, and add the logging option, that part of the /etc/vfstab file looks like this:


    #device      device        mount         FS    fsck    mount   mount
    #to mount    to fsck       point         type  pass    at boot options
    #
    /dev/md/dsk/d0  /dev/md/rdsk/d0 /mnt/transvolume   ufs  1  no  logging
    
  9. Remount the file system.


    # mount /mnt/transvolume
    

    Note –

    The mount command might report an error, similar to “the state of /dev/md/dsk/d0 is not okay and it was attempted to be mounted read/write. Please run fsck and try again.” If this happens, run fsck on the raw device (fsck /dev/md/rdsk/d0 in this case), answer y to fixing the file system state in the superblock, and try again.


  10. Verify that the file system is mounted with logging enabled by examining the /etc/mnttab file and confirming that the file system has logging listed as one of the options.


    # grep mnt /etc/mnttab
    mnttab  /etc/mnttab     mntfs   dev=43c0000     1007575477
    /dev/md/dsk/d0  /mnt/transvolume    ufs  rw,intr,largefiles,
    logging,xattr,onerror=panic,suid,dev=1540000 1008085006
     
  11. If you changed to single-user mode during the process, you can now return to multiuser mode.