SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
add warning on unmount a folder
Chris Lu65a29ad42ab3
diff --git a/weed/shell/command_remote_unmount.go b/weed/shell/command_remote_unmount.goindex 55b9bce056..c2857dbbf0 100644--- a/weed/shell/command_remote_unmount.go+++ b/weed/shell/command_remote_unmount.go@@ -31,7 +31,9 @@ func (c *commandRemoteUnmount) Help() string {remote.mount -dir=/xxx -remote=s3_1/bucket# unmount the mounted directory and remove its cache- remote.unmount -dir=/xxx+ # Make sure you have stopped "weed filer.remote.sync" first!+ # Otherwise, the deletion will also be propagated to the remote storage!!!+ remote.unmount -dir=/xxx -iHaveStoppedRemoteSync`}@@ -41,6 +43,7 @@ func (c *commandRemoteUnmount) Do(args []string, commandEnv *CommandEnv, writerremoteMountCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)dir := remoteMountCommand.String("dir", "", "a directory in filer")+ hasStoppedRemoteSync := remoteMountCommand.Bool("iHaveStoppedRemoteSync", false, "confirm to stop weed filer.remote.sync first")if err = remoteMountCommand.Parse(args); err != nil {return nil@@ -59,6 +62,9 @@ func (c *commandRemoteUnmount) Do(args []string, commandEnv *CommandEnv, writerreturn fmt.Errorf("directory %s is not mounted", *dir)}+ if !*hasStoppedRemoteSync {+ return fmt.Errorf("make sure \"weed filer.remote.sync\" is stopped to avoid data loss")+ }// purge mounted dataif err = c.purgeMountedData(commandEnv, *dir); err != nil {return fmt.Errorf("purge mounted data: %v", err)