Wednesday, November 3, 2010

How to setup loop device?

■ Requirement : How to setup loop device?
■ OS Environment : Linux[RHEL, Centos]
■ Implementation Steps : 

         In Unix-like operating systems, a loop device, vnd (vnode disk), or lofi (loopback file interface) is a pseudo-device that makes a file accessible as a block device.


$losetup /dev/loop0 example.img
$ mount /dev/loop0 /home/you/dir


     The second command mounts the device on the directory /home/you/dir. The overall effect of executing these two commands is that the content of the file is used as a file system rooted at the mount point.

The mount utility is usually capable of handling the entire procedure:

mount -o loop example.img /home/you/dir

No comments:

Post a Comment