![将循环驱动器的源移动到其安装点时,文件系统后面会发生什么?](https://linux22.com/image/223170/%E5%B0%86%E5%BE%AA%E7%8E%AF%E9%A9%B1%E5%8A%A8%E5%99%A8%E7%9A%84%E6%BA%90%E7%A7%BB%E5%8A%A8%E5%88%B0%E5%85%B6%E5%AE%89%E8%A3%85%E7%82%B9%E6%97%B6%EF%BC%8C%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9F%E5%90%8E%E9%9D%A2%E4%BC%9A%E5%8F%91%E7%94%9F%E4%BB%80%E4%B9%88%EF%BC%9F.png)
我将循环驱动器的源移动到其安装点并卸载它。然后源头就消失了。
请注意,将源移动到其安装点(或其他位置)后,源显示为已删除:
$ losetup --all
/dev/loop0: []: (/mnt/storage/test.iso (deleted))
当我通过以下方式检查时,源之前占用的空间没有释放df -h
:
# Original Used Space
$ df -h|grep storage
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/vgtank-lvtest ext4 100M 128K 100M 1% /mnt/storage
# After Creating the File and Mounting
$ dd if=/dev/zero of=/mnt/storage/test.iso bs=64M count=1
1+0 records in
1+0 records out
67108864 bytes (67 MB, 64 MiB) copied, 0.0405464 s, 1.7 GB/s
$ losetup -f test.iso
$ mkdir test
$ mount /dev/loop0 test
$ df -h|grep storage
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/vgtank-lvtest ext4 100M 64M 36M 64% /mnt/storage
# After Moving the File and Umounting
$ mv test.iso test
$ umount test
$ df -h|grep storage
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/vgtank-lvtest ext4 100M 64M 36M 64% /mnt/storage
我在这里有两个问题:
- 为什么我们可以将
mv
一个文件复制到另一个文件系统中in used
(通过losetup)? - 卸载后文件去了哪里?