diff -crB lxd-0.24/lxd/api_1.0.go lxd-0.24-micky/lxd/api_1.0.go
*** lxd-0.24/lxd/api_1.0.go	2015-12-09 01:00:41.000000000 +0100
--- lxd-0.24-micky/lxd/api_1.0.go	2015-12-26 16:22:09.806926521 +0100
***************
*** 167,172 ****
--- 167,177 ----
  			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.24/lxd/daemon.go lxd-0.24-micky/lxd/daemon.go
*** lxd-0.24/lxd/daemon.go	2015-12-09 01:00:41.000000000 +0100
--- lxd-0.24-micky/lxd/daemon.go	2015-12-26 16:22:48.313313905 +0100
***************
*** 1035,1040 ****
--- 1035,1042 ----
  		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.24/lxd/storage_lvm.go lxd-0.24-micky/lxd/storage_lvm.go
*** lxd-0.24/lxd/storage_lvm.go	2015-12-09 01:00:41.000000000 +0100
--- lxd-0.24-micky/lxd/storage_lvm.go	2015-12-26 18:04:27.925121475 +0100
***************
*** 159,164 ****
--- 159,173 ----
  	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)
***************
*** 266,271 ****
--- 275,293 ----
  		return err
  	}
  
+ 	fstype, err := s.d.ConfigValueGet("storage.lvm_fstype")
+ 	// 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))
+ 		}
+ 	}
+ 
  	output, err := exec.Command("mount", "-o", "discard", lvpath, destPath).CombinedOutput()
  	if err != nil {
  		s.ContainerDelete(container)
***************
*** 552,557 ****
--- 574,591 ----
  		}
  	}
  
+ 	fstype, err := s.d.ConfigValueGet("storage.lvm_fstype")
+ 	// 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))
+ 		}
+ 	}
  	output, err := exec.Command(
  		"mount", "-o", "discard", lvpath, container.Path()).CombinedOutput()
  	if err != nil {
***************
*** 608,613 ****
--- 642,659 ----
  		}
  	}()
  
+ 	fstype, err := s.d.ConfigValueGet("storage.lvm_fstype")
+ 	// Generate a new xfs's UUID
+ 	if fstype == "xfs" {
+ 		output, err := exec.Command(
+ 			"xfs_admin",
+ 			"-U", "generate",
+ 			lvpath).CombinedOutput()
+ 		if err != nil {
+ 			shared.Logf("Error mounting image LV for untarring: '%s'", string(output))
+ 			return fmt.Errorf("Error mounting image LV: %v", err)
+ 		}
+ 	}
  	output, err := exec.Command(
  		"mount",
  		"-o", "discard",
***************
*** 708,720 ****
  	}
  
  	lvpath := fmt.Sprintf("/dev/%s/%s", s.vgName, lvname)
! 	output, err = exec.Command(
! 		"mkfs.ext4",
! 		"-E", "nodiscard,lazy_itable_init=0,lazy_journal_init=0",
! 		lvpath).CombinedOutput()
  
  	if err != nil {
! 		s.log.Error("mkfs.ext4", log.Ctx{"output": string(output)})
  		return "", fmt.Errorf("Error making filesystem on image LV: %v", err)
  	}
  
--- 754,777 ----
  	}
  
  	lvpath := fmt.Sprintf("/dev/%s/%s", s.vgName, lvname)
! 
! 	fstype, err := s.d.ConfigValueGet("storage.lvm_fstype")
! 	switch fstype {
! 	case "xfs":
! 		output, err = exec.Command(
! 			"mkfs.xfs",
! 			"-f",
! 			lvpath).CombinedOutput()
! 	default:
! 		// default = ext4
! 		output, err = exec.Command(
! 			"mkfs.ext4",
! 			"-E", "nodiscard,lazy_itable_init=0,lazy_journal_init=0",
! 			lvpath).CombinedOutput()
! 	}
  
  	if err != nil {
! 		s.log.Error("mkfs", log.Ctx{"output": string(output)})
  		return "", fmt.Errorf("Error making filesystem on image LV: %v", err)
  	}
  
