如果使用保险丝安装到非空的安装点会发生什么?

ber*_*436 21 linux fuse

融合我是新手.当我尝试运行FUSE客户端程序时,我收到此错误:

fuse: mountpoint is not empty
fuse: if you are sure this is safe, use the 'nonempty' mount option
Run Code Online (Sandbox Code Playgroud)

我知道mountpoint是逻辑上附加FUSE文件系统的目录.如果我登上这个地方会发生什么?有什么危险?只是该目录将被覆盖?基本上:如果挂载到非空目录会发生什么?

hek*_*mgl 18

您需要确保由fuse挂载的设备上的文件与非空挂载点中已存在的文件具有相同的路径和文件名.否则这会导致混淆.如果您确定,请传递-o nonempty给mount命令.

您可以使用以下命令尝试正在发生的事情..(Linux摇滚!)..而不会破坏任何东西..

// create 10 MB file 
dd if=/dev/zero of=partition bs=1024 count=10240

// create loopdevice from that file
sudo losetup /dev/loop0 ./partition

// create  filesystem on it
sudo e2mkfs.ext3 /dev/loop0

// mount the partition to temporary folder and create a file
mkdir test
sudo mount -o loop /dev/loop0 test
echo "bar" | sudo tee test/foo

# unmount the device
sudo umount /dev/loop0

# create the file again
echo "bar2" > test/foo

# now mount the device (having file with same name on it) 
# and see what happens
sudo mount -o loop /dev/loop0 test
Run Code Online (Sandbox Code Playgroud)


DaJ*_*aJF 7

显然什么也没发生,它以非破坏性的方式失败并给你一个警告。

我最近也遇到过这种情况。解决此问题的一种方法是将非空挂载点中的所有文件移动到其他地方,例如:

mv /nonEmptyMountPoint/* ~/Desktop/mountPointDump/
Run Code Online (Sandbox Code Playgroud)

这样您的挂载点现在是空的,您的mount命令将起作用。


Vas*_*007 7

只需添加-o nonempty命令行,如下所示:

s3fs -o nonempty  <bucket-name> </mount/point/>
Run Code Online (Sandbox Code Playgroud)