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 != "" {
|
||||
switch c.FileSystemType {
|
||||
case fsTypeExt4, fsTypeXFS:
|
||||
case fsTypeExt4, fsTypeXFS, fsTypeExt2:
|
||||
default:
|
||||
result = multierror.Append(result, fmt.Errorf("unsupported Filesystem Type: %q", c.FileSystemType))
|
||||
}
|
||||
|
@ -44,6 +44,7 @@ type fsType string
|
||||
const (
|
||||
metadataFileName = "metadata.db"
|
||||
fsTypeExt4 fsType = "ext4"
|
||||
fsTypeExt2 fsType = "ext2"
|
||||
fsTypeXFS fsType = "xfs"
|
||||
devmapperSnapshotFsType = "containerd.io/snapshot/devmapper/fstype"
|
||||
)
|
||||
@ -468,6 +469,13 @@ func mkfs(ctx context.Context, fs fsType, fsOptions string, path string) error {
|
||||
fsOptions,
|
||||
path,
|
||||
}
|
||||
case fsTypeExt2:
|
||||
mkfsCommand = "mkfs.ext2"
|
||||
args = []string{
|
||||
"-E",
|
||||
fsOptions,
|
||||
path,
|
||||
}
|
||||
case fsTypeXFS:
|
||||
mkfsCommand = "mkfs.xfs"
|
||||
args = []string{
|
||||
|
Loading…
Reference in New Issue
Block a user