2011.03.21 11:22

Loop Device

Loop Device

loop device는 디바이스 드라이버이다.

즉, image file이 마치 일반적인 block device인 것 처럼 만들어 마운트될 수 있게 하는 디바이스 드라이버이다.( 이미지 파일을 일반적인 block device 로 사용하는 것이라고 생각하시면 쉽습니다)

SpeedMod커널에서는, loop device를 아래와 같이 적용하고있습니다.


1. 0~3까지 /dev/block/ 내에 4개의 loop device node 를 생성해 놓고
( 단, loop0은 모드를 위해 사용하지않고 free영역으로 납겨놓습니다.)

mknod /dev/block/loop0 b 7 0
mknod /dev/block/loop1 b 7 1
mknod /dev/block/loop2 b 7 2
mknod /dev/block/loop3 b 7 3

2. 사용자로부터 CWM에서  loop device 마운트 명령을 받으면 아래와 같이 마운트한다.
예를 들어, /data영역에 대해서는 /res/odata/로 mount point를 잡고, /dev/block/loop1에 ext2로 마운합니다.
mount /dev/block/mmcblk0p2 /dev/block/loop1 /data /res/odata $DATA_FS_TYPE ext2
mount /dev/block/stl10 /dev/block/loop2 /dbdata /res/odbdata $DBDATA_FS_TYPE ext2
mount /dev/block/stl11 /dev/block/loop3 /cache /res/ocache $CACHE_FS_TYPE ext2



유닉스 계열의 운영체제에서loop device, loopback device, vnd , or lofi 는 일반적인 파일을 나타내는 device node입니다.

이러한 명칭은 장치를 통제하는 드라이버에 대해서도 사용될 수 있다.

loop device는 대부분 디렉토리에 마운트되어 사용되는 데, 디스크를 마운트하는 것과 동일한 효과를 발생시킨다.이 디스크 이미지는 그 디렉토리위에 있는 장치와 연결된 파일과 동일하다.

디렉토리에 파일을 마운트하는 과정은 다음 두 단계로 이루어진다.

1. 파일은 특정 명령어를 사용하여 loop devie node와 연결된다.

2. 다음, device node는 다른 block device관해서는 디렉토리에 마운트 된다.

예를 들어 example.img는 일반적인 파일이고/home/you/dir는 리눅스 박스상에 있는디렉토리 라면, 루트 사용자는 다음 두 개의 명령으로 파일을 디렉토리에 마운트할 수 있다.

losetup /dev/loop0 example.img

mount /dev/loop0 /home/you/dir

첫 번째 명령은 loop device node인 /dev/loop0를 일반 파일인 example.img와연결시킨다. 이런한 연결은 나중에 losetup -d /dev/loop0 명령으로 제거할 수 있다.

두 번째 명령은 장치를 /home/you/dir 디렉토리에 마운트한다.

이 두 명령의 전체 효과는 파일의 내용이 마운트된 전체 디렉토리를 저장하는

데 사용된다는 것이다.



아래 위키백과사전의 내용도 참조해보세요.


From Wikipedia, the free encyclopedia

Jump to: navigation, search

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.

Before use, a loop device must be connected to an existing file in the filesystem. The association provides the user with an API that allows the file to be used in place of a block special file (cf. device file system). Thus, if the file contains an entire file system, the file may then be mounted as if it were a disk device.

Files of this kind 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.

A loop device may allow some kind of data elaboration during this redirection. For example, the device may be the unencrypted version of an encrypted file. In such a case, the file associated with a loop device may be another pseudo-device. This is mostly useful when this device contains an encrypted file system. If supported, the loop device is in this case the decrypted version of the original encrypted file and can therefore be mounted as if it were a normal filesystem.

Contents

[hide]

[edit] Uses of loop mounting

After mounting a file containing a filesystem, the files within the filesystem can be accessed through the usual filesystem interface of the operating system, without any need for special functionality, such as reading and writing to ISO images, in applications.

Uses include managing and editing filesystem images meant for later normal use (especially CD or DVD images or installation systems) or permanent segregation of data in actual use (for example simulating removable media on a faster and more convenient hard disk or encapsulating encrypted filesystems).

Loop devices have also been utilized in order to provide a way of installing operating systems within files on a hard drive without repartitioning the drive.

[edit] Availability

Some confusion exists about the naming of the loop device under various operating systems. Various Unix-like operating systems provide the loop device functionality under different names.

In Linux, device names are encoded in the symbol table entries of their corresponding device drivers. The device is called "loop" device and device nodes are usually named /dev/loop0, /dev/loop1, etc. They can be created by the makedev script for the static device directory, or dynamically by the facilities of the device filesystem (udev). The management user interface for the loop device is losetup and is part of the util-linux package.

Sometimes, the loop device is erroneously referred to as 'loopback' device, but this term is reserved for a networking device in the Linux kernel (cf. loopback). The concept of the 'loop' device is distinct from that of 'loopback', although similar in name.

In BSD-derived systems, such as NetBSD and OpenBSD, the loop device is called "virtual node device" or "vnd", and generally located at /dev/vnd0, /dev/rvnd0 or /dev/svnd0, etc., in the file system. The vnconfig program is used for configuration.

FreeBSD followed the same conventions as other BSD systems until release version 5, in which the loop device was incorporated into the memory disk driver ("md"). Configuration is now performed using the mdconfig[1] program.

In Solaris/OpenSolaris, the loop device is called "loopback file interface" or lofi,[2] and located at /dev/lofi/1, etc. SunOS has the lofiadm configuration program. The "lofi" driver supports read-only compression and read-write encryption. There is also a 3rd party "fbk"[3] (File emulates Blockdevice) driver available for SunOS/Solaris since summer 1988.

Mac OS X implements a native image mounting mechanism as part of its random access disk device abstraction. The devices appear in /dev as regular disk devices; reads from and writes to those devices are sent to a user-mode helper process, which reads the data from the file or writes it to the file. In the user interface it is automatically activated by opening the disk image. It can handle disk, CD-ROM or DVD images in various formats.

Loop mounting is not natively available on Microsoft Windows operating systems (until version Windows 7, where this functionality is natively implemented, and available through the diskpart utility).[4] However, the facility is often added using third-party applications such as Daemon Tools and Alcohol 120%. Freely-available tools from VMware and LTR Data (ImDisk) can also be used to achieve similar functionality.

[edit]

저작자 표시 비영리 변경 금지
신고

'안드로이드정보 및 자료' 카테고리의 다른 글

SIO I/O Scheduler ( Simple I/O Scheduler)  (2) 2011.03.28
BFQ IO Scheduler  (9) 2011.03.24
Loop Device  (1) 2011.03.21
lowmemorykiller  (0) 2011.03.21
Tiny RCU.  (11) 2011.03.17
HZ 의 상수값을 높이면 반응속도가 빨라진다.  (1) 2011.03.14
Trackback 1 Comment 1
  1. Monster Beats Tour 2012.10.23 09:55 신고 address edit & del reply

    보내주세요engraving do the work is concluded be ghaarias, the enameling do the job is done be the enameler, the goldsmith looks following the gold or kundan get the function completed and eventually stone setters do operate of just surroundings the dear or semi-precious stone inside the holes inside the jewellery. hhjjkkllppuyiiuyasa http://greatmonsterbeats.com/categories/Monster-Beats-Solo-HD/



티스토리 툴바