Linux mount img Image file

Source: Internet
Author: User

[Email protected]:~# mount-o loop/data/kvm-pool/windows7.img/media/b/mount: You must specify the file system type

The direct mount is going to fail, let's first use fdisk-l to look at the disk information:

[email protected]:~# fdisk -l /data/kvm-pool/windows7.imgdisk /data/kvm-pool/ windows7.img: 21.5 gb, 21474836480 bytes255 heads, 63 sectors/track,  2610 cylinders, total 41943040 sectorsunits =  Fan Area  of 1 * 512  = 512 bytesSector size  (logical/physical): 512 bytes / 512  bytesi/o size  (Minimum/optimal):  512 bytes / 512 bytesdisk identifier:  0x9c75197d                        devices   Start        start             Endpoints       Blocks    Id   Systems /data/kvm-pool/windows7.img1   *        2048       206847      102400    7  hpfs/ntfs/exfat/data/ kvm-pool/windows7.img2          206848     41940991    20867072    7  hpfs/ntfs/exfat

The

can see that the disk image contains two partitions. The disk contains two partitions, and we try to mount the second partition. As you can see from the information above, the starting position of the second partition is 206848 sectors, each sector size is bytes,     so the starting position is 2048*512 (B). Then we'll mount the partition:

[Email protected]:~# mount -o loop,offset=$ ((206848*512))  /data/kvm-pool/windows7.img  /media/B/ The disk contains an unclean file system  (0, 0). The file system wasn ' t safely closed on windows. fixing. [email protected]:~# ls /media/b/autoexec.bat             hiberfil.sys  Program Files               UsersCloudMusic               pagefile.sys  Recovery                    Windowsconfig.sys               PerfLogs       $Recycle. Bindocuments and sEttings  programdata   system volume information 


This article is from the "Mu mu blog" blog, please make sure to keep this source http://slyadm.blog.51cto.com/6223864/1761449

Linux mount img Image file

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.