diff -crB lxd-0.25/lxd/api_1.0.go lxd-0.25-micky/lxd/api_1.0.go
*** lxd-0.25/lxd/api_1.0.go	2015-12-21 23:33:56.000000000 +0100
--- lxd-0.25-micky/lxd/api_1.0.go	2015-12-25 17:45:27.947154133 +0100
***************
*** 161,166 ****
--- 161,171 ----
  			if err != nil {
  				return InternalError(err)
  			}
+ 		} else if key == "storage.lvm_fstype" {
+ 			err := storageLVMSetFsTypeConfig(d, value.(string))
+ 			if err != nil {
+ 				return InternalError(err)
+ 			}
  		} else if key == "storage.zfs_pool_name" {
  			err := storageZFSSetPoolNameConfig(d, value.(string))
  			if err != nil {
diff -crB lxd-0.25/lxd/daemon.go lxd-0.25-micky/lxd/daemon.go
*** lxd-0.25/lxd/daemon.go	2015-12-21 23:33:56.000000000 +0100
--- lxd-0.25-micky/lxd/daemon.go	2015-12-25 18:44:36.688528093 +0100
***************
*** 1076,1081 ****
--- 1076,1083 ----
  		return true
  	case "storage.lvm_thinpool_name":
  		return true
+ 	case "storage.lvm_fstype":
+ 		return true
  	case "storage.zfs_pool_name":
  		return true
  	case "images.remote_cache_expiry":
diff -crB lxd-0.25/lxd/storage_lvm.go lxd-0.25-micky/lxd/storage_lvm.go
*** lxd-0.25/lxd/storage_lvm.go	2015-12-21 23:33:56.000000000 +0100
--- lxd-0.25-micky/lxd/storage_lvm.go	2015-12-26 18:15:17.111773958 +0100
***************
*** 160,165 ****
--- 160,174 ----
  	return nil
  }
  
+ func storageLVMSetFsTypeConfig(d *Daemon, fstype string) error {
+ 	err := d.ConfigValueSet("storage.lvm_fstype", fstype)
+ 	if err != nil {
+ 		return err
+ 	}
+ 
+ 	return nil
+ }
+ 
  func containerNameToLVName(containerName string) string {
  	lvName := strings.Replace(containerName, "-", "--", -1)
  	return strings.Replace(lvName, shared.SnapshotDelimiter, "-", -1)
***************
*** 291,297 ****
  		return err
  	}
  
! 	err = s.tryMount(lvpath, destPath, "ext4", 0, "discard")
  	if err != nil {
  		s.ContainerDelete(container)
  		return fmt.Errorf("Error mounting snapshot LV: %v", err)
--- 300,324 ----
  		return err
  	}
  
! 	var fstype string
! 	fstype, err = s.d.ConfigValueGet("storage.lvm_fstype")
! 	if err != nil {
! 		return fmt.Errorf("Error checking server config, err=%v", err)
! 	}
! 
! 	// Generate a new xfs's UUID
! 	if fstype == "xfs" {
! 		output, err := exec.Command(
! 			"xfs_admin",
! 			"-U", "generate",
! 			lvpath).CombinedOutput()
! 		if err != nil {
! 			s.ContainerDelete(container)
! 			return fmt.Errorf("Error mounting snapshot LV: %v\noutput:'%s'", err, string(output))
! 		}
! 	}
! 
! 	err = s.tryMount(lvpath, destPath, fstype, 0, "discard")
  	if err != nil {
  		s.ContainerDelete(container)
  		return fmt.Errorf("Error mounting snapshot LV: %v", err)
***************
*** 385,391 ****
  func (s *storageLvm) ContainerStart(container container) error {
  	lvName := containerNameToLVName(container.Name())
  	lvpath := fmt.Sprintf("/dev/%s/%s", s.vgName, lvName)
! 	err := s.tryMount(lvpath, container.Path(), "ext4", 0, "discard")
  	if err != nil {
  		return fmt.Errorf(
  			"Error mounting snapshot LV path='%s': %v",
--- 412,424 ----
  func (s *storageLvm) ContainerStart(container container) error {
  	lvName := containerNameToLVName(container.Name())
  	lvpath := fmt.Sprintf("/dev/%s/%s", s.vgName, lvName)
! 
! 	fstype, err := s.d.ConfigValueGet("storage.lvm_fstype")
! 	if err != nil {
! 		return fmt.Errorf("Error checking server config, err=%v", err)
! 	}
! 
! 	err = s.tryMount(lvpath, container.Path(), fstype, 0, "discard")
  	if err != nil {
  		return fmt.Errorf(
  			"Error mounting snapshot LV path='%s': %v",
***************
*** 666,672 ****
  		}
  	}
  
! 	err = s.tryMount(lvpath, container.Path(), "ext4", 0, "discard")
  	if err != nil {
  		return fmt.Errorf(
  			"Error mounting snapshot LV path='%s': %v",
--- 699,723 ----
  		}
  	}
  
! 	var fstype string
! 	fstype, err = s.d.ConfigValueGet("storage.lvm_fstype")
! 	if err != nil {
! 		return fmt.Errorf("Error checking server config, err=%v", err)
! 	}
! 
! 	// Generate a new xfs's UUID
! 	if fstype == "xfs" {
! 		output, err := exec.Command(
! 			"xfs_admin",
! 			"-U", "generate",
! 			lvpath).CombinedOutput()
! 		if err != nil {
! 			s.ContainerDelete(container)
! 			return fmt.Errorf("Error mounting snapshot LV: %v\noutput:'%s'", err, string(output))
! 		}
! 	}
! 
! 	err = s.tryMount(lvpath, container.Path(), fstype, 0, "discard")
  	if err != nil {
  		return fmt.Errorf(
  			"Error mounting snapshot LV path='%s': %v",
***************
*** 720,726 ****
  		}
  	}()
  
! 	err = s.tryMount(lvpath, tempLVMountPoint, "ext4", 0, "discard")
  	if err != nil {
  		shared.Logf("Error mounting image LV for untarring: %v", err)
  		return fmt.Errorf("Error mounting image LV: %v", err)
--- 771,795 ----
  		}
  	}()
  
! 	var fstype string
! 	fstype, err = s.d.ConfigValueGet("storage.lvm_fstype")
! 	if err != nil {
! 		return fmt.Errorf("Error checking server config, err=%v", err)
! 	}
! 
! 	// Generate a new xfs's UUID
! 	if fstype == "xfs" {
! 		output, err := exec.Command(
! 			"xfs_admin",
! 			"-U", "generate",
! 			lvpath).CombinedOutput()
! 		if err != nil {
! 			s.ContainerDelete(container)
! 			return fmt.Errorf("Error mounting snapshot LV: %v\noutput:'%s'", err, string(output))
! 		}
! 	}
! 
! 	err = s.tryMount(lvpath, tempLVMountPoint, fstype, 0, "discard")
  	if err != nil {
  		shared.Logf("Error mounting image LV for untarring: %v", err)
  		return fmt.Errorf("Error mounting image LV: %v", err)
***************
*** 837,849 ****
  
  	lvpath := fmt.Sprintf("/dev/%s/%s", s.vgName, lvname)
  
! 	output, err = s.tryExec(
! 		"mkfs.ext4",
! 		"-E", "nodiscard,lazy_itable_init=0,lazy_journal_init=0",
! 		lvpath)
  
  	if err != nil {
! 		s.log.Error("mkfs.ext4", log.Ctx{"output": string(output)})
  		return "", fmt.Errorf("Error making filesystem on image LV: %v", err)
  	}
  
--- 906,928 ----
  
  	lvpath := fmt.Sprintf("/dev/%s/%s", s.vgName, lvname)
  
! 	fstype, err := s.d.ConfigValueGet("storage.lvm_fstype")
! 
! 	switch fstype {
! 	case "xfs":
! 		output, err = s.tryExec(
! 			"mkfs.xfs",
! 			lvpath)
! 	default:
! 		// default = ext4
! 		output, err = s.tryExec(
! 			"mkfs.ext4",
! 			"-E", "nodiscard,lazy_itable_init=0,lazy_journal_init=0",
! 			lvpath)
! 	}
  
  	if err != nil {
! 		s.log.Error("mkfs", log.Ctx{"output": string(output)})
  		return "", fmt.Errorf("Error making filesystem on image LV: %v", err)
  	}
  
