Product SiteDocumentation Site

2.2.4. Exercise 4

Make an XFS filesystem that uses an external log on a second device. Note: the maximum size for a log is 128MB, if the log device is larger than this the size option must be specified.
  1. Create the filesystem with an external log.
    # mkfs -t xfs -f -l logdev=/dev/sda3,size=128m /dev/sda4
    meta-data=/dev/sda4              isize=256    agcount=16, agsize=461617 blks
             =                       sectsz=512   attr=0
    data     =                       bsize=4096   blocks=7385872, imaxpct=25
             =                       sunit=0      swidth=0 blks, unwritten=1
    naming   =version 2              bsize=4096
    log      =/dev/sda3              bsize=4096   blocks=32768, version=1
             =                       sectsz=512   sunit=0 blks
    realtime =none                   extsz=65536  blocks=0, rtextents=0
    
  2. In order to mount a filesystem with an external log, the log device must be specified on the mount command line.
    # mount -o logdev=/dev/sda3 /dev/sda4 /mnt
    # mount
    /dev/sda2 on / type xfs (rw)
    proc on /proc type proc (rw)
    sysfs on /sys type sysfs (rw)
    tmpfs on /dev/shm type tmpfs (rw)
    devpts on /dev/pts type devpts (rw,mode=0620,gid=5)
    usbfs on /proc/bus/usb type usbfs (rw)
    /dev/sda4 on /mnt type xfs (rw,logdev=/dev/sda3)
    
  3. If the log device is not specified the filesystem will fail to mount:
    # mount /dev/sda4 /mnt
    mount: wrong fs type, bad option, bad superblock on /dev/sda4,
           missing codepage or other error
           In some cases useful info is found in syslog - try
           dmesg | tail
    
MediaWiki Appliance - Powered by TurnKey Linux