Using/dev/zero to create a virtual hard disk/dev/zero is a special device in Linux, each time you read it, It outputs a byte (all of them are "0" in the editor). Now we can create a 10 m data file, then run the file command to view [root @ xx ~]. # Dd if =/dev/zero of = hd. img bs = 1 k count = 10000 [root @ xx ~] # File hd. img the file command hd. img is a data file. Now we use loop device to mount it into a virtual hard disk [root @ xx ~] # Losetup/dev/loop1 hd. img [root @ xx ~] # Losetup-a www.2cto.com, hd. img corresponds to loop1. Now we can use/dev/loop1 to operate hd. img, which is like a real device. It can be used for partitioning, file system creation, and other [root @ xx ~] # Fdisk/dev/loop1 use fdisk for partitioning, create a file system, and view the attributes of hd. img with file [root @ xx ~] # Mkfs-t ext2/dev/loop1 [root @ xx ~] # File hd. img of course, the last step is to mount the author mudan88