mount losetup 查看带文件系统的文件
来源:互联网 发布:走心机编程软件 编辑:程序博客网 时间:2024/05/13 00:52
搜索到如下的文章,关于losetup的使用;
More about loop device
A loop device is a pseudo-device that makes a file accessible as a block device. Loop devices are often used for CD ISO images and floppy disc images. Mounting a file containing a filesystem via such a loop mount makes the files within that filesystem accessible. They appear in the mount point directory using above commands.
Managing loop devices on CentOS and Fedora Linux hosts
Linux loop devices provide a way to mount ordinary files as block devices. This capability allows you to easily access an ISO image that resides on disk, mount and unmount encrypted devices (the dm-crypt and fuse encryption module may be a better solution for this), or test out new file systems using plain old files.
Linux loop devices are managed through the losetup utility, which has options to add, list, remove and locate unused loop devices. To associate a loop device with a file, you will first need to locate an unused loop device in /dev. This can be accomplished by running losetup with the “-f” (find an unused loop device) option:
$ losetup -f
/dev/loop0
Once you identify an available loop device, you can associate the loop device with a file by running losetup with the name of the loop device, and the file to associate with the loop device:
$ losetup /dev/loop0 /root/foo
To verify the device is attached, you can run losetup with the “-a” (show all loop devices) or “-j” (show loop devices associate with the corresponding file) option:
$ losetup -a
/dev/loop0: [0801]:12779871 (/root/foo)
$ losetup -j /root/foo
/dev/loop0: [0801]:12779871 (/root/foo)
To access the contents of a loop device, you can use the mount utility to mount the loop device to a directory that resides in an existing file system:
$ mount /dev/loop0 /mnt
This of course assumes that the underlying file contains a valid label and file system (you can run fdisk or parted to create a label, and then use your favorite mkfs variation to create a file system). Once you finish using a loop device, you can remove it by running losetup with the “-d” (remove loop device) option:
$ umount /mnt
$ losetup -d /dev/loop0
$ losetup -a
I have come to rely on loop devices for all sorts of purposes, and their simplicity makes them so so useful!
- mount losetup 查看带文件系统的文件
- losetup和mount -o loop
- encrypted filesystemsdmsetup losetup and mount
- losetup分区过的镜像文件
- 文件系统mount的过程
- 文件系统mount的过程
- 创建Image, losetup和mount的使用, 并为Image设备加卷标
- 文件系统的mount参数分析
- losetup 命令的用法
- losetup 命令的用法
- losetup
- 通过losetup虚拟出块设备(文件系统)
- LINUX下挂载(mount)查看树莓派镜像文件
- Autofs实现文件系统的自动mount
- HDFS文件系统如何查看文件对应的block
- 如何mount带LVM分区的硬盘
- linux下将一个文件mount为一个文件系统
- Linux如何查看mount的源路径?
- FTP数字代码的意义
- PHP环境搭建 环境搭建
- ViewPager延时加载(懒加载)
- android.intent.action.MAIN 和android.intent.category.LAUNCHER
- linux 安装 MySQLdb for python
- mount losetup 查看带文件系统的文件
- shell编程expect
- java 动态代理
- 阅读openjdk源代码
- gsub、sub、replace区别
- J2EE Web应用的轻量级解决方案:SSH(Spring+Struts+Hibernate)解析
- 关于jquery 1.9以上多次点击checkbox无法选择的bug解决
- linux oracle11g安装 weblogic11g安装地址
- Android 开源框架Universal-Image-Loader完全解析(二)--- 图片缓存策略详解