我将循环驱动器的源移动到其安装点并卸载它。然后源头就消失了。
请注意,将源移动到其安装点(或其他位置)后,源显示为已删除:
$ 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)? - 卸载后文件去了哪里?