Add ext2 fs support to devmapper snapshotter
Signed-off-by: Anastassios Nanos <ananos@nubificus.co.uk>
This commit is contained in:
parent
290ef2b43f
commit
adfbda464b
@ -117,7 +117,7 @@ func (c *Config) Validate() error {
|
|||||||
|
|
||||||
if c.FileSystemType != "" {
|
if c.FileSystemType != "" {
|
||||||
switch c.FileSystemType {
|
switch c.FileSystemType {
|
||||||
case fsTypeExt4, fsTypeXFS:
|
case fsTypeExt4, fsTypeXFS, fsTypeExt2:
|
||||||
default:
|
default:
|
||||||
result = multierror.Append(result, fmt.Errorf("unsupported Filesystem Type: %q", c.FileSystemType))
|
result = multierror.Append(result, fmt.Errorf("unsupported Filesystem Type: %q", c.FileSystemType))
|
||||||
}
|
}
|
||||||
|
@ -44,6 +44,7 @@ type fsType string
|
|||||||
const (
|
const (
|
||||||
metadataFileName = "metadata.db"
|
metadataFileName = "metadata.db"
|
||||||
fsTypeExt4 fsType = "ext4"
|
fsTypeExt4 fsType = "ext4"
|
||||||
|
fsTypeExt2 fsType = "ext2"
|
||||||
fsTypeXFS fsType = "xfs"
|
fsTypeXFS fsType = "xfs"
|
||||||
devmapperSnapshotFsType = "containerd.io/snapshot/devmapper/fstype"
|
devmapperSnapshotFsType = "containerd.io/snapshot/devmapper/fstype"
|
||||||
)
|
)
|
||||||
@ -468,6 +469,13 @@ func mkfs(ctx context.Context, fs fsType, fsOptions string, path string) error {
|
|||||||
fsOptions,
|
fsOptions,
|
||||||
path,
|
path,
|
||||||
}
|
}
|
||||||
|
case fsTypeExt2:
|
||||||
|
mkfsCommand = "mkfs.ext2"
|
||||||
|
args = []string{
|
||||||
|
"-E",
|
||||||
|
fsOptions,
|
||||||
|
path,
|
||||||
|
}
|
||||||
case fsTypeXFS:
|
case fsTypeXFS:
|
||||||
mkfsCommand = "mkfs.xfs"
|
mkfsCommand = "mkfs.xfs"
|
||||||
args = []string{
|
args = []string{
|
||||||
|
Loading…
Reference in New Issue
Block a user