- 浏览: 1318342 次
- 性别:
- 来自: 广州
文章分类
- 全部博客 (351)
- Java General (37)
- .net General (2)
- Linux Toy (55)
- Oracle (81)
- Mysql (11)
- Programer Career (12)
- Oh, my living ! (2)
- Shell Script (8)
- Web Service (0)
- Linux Server (22)
- Php/Python/Perl (3P) (2)
- Javascript General (5)
- Saleforce Apex Dev (2)
- Web General (5)
- Xen & VM tech. (17)
- PSP (13)
- OpenSolaris (34)
- php (1)
- RAI/flex/action script (16)
- asterisk/CTI (7)
- 交互设计 (6)
- English (3)
- Lucene (1)
最新评论
-
GuolinLee:
markmark
JVM调优总结 -Xms -Xmx -Xmn -Xss -
di1984HIT:
写的太好啊。
JVM调优总结 -Xms -Xmx -Xmn -Xss -
javajdbc:
javajdbc 写道
JVM调优总结 -Xms -Xmx -Xmn -Xss -
javajdbc:
...
JVM调优总结 -Xms -Xmx -Xmn -Xss -
alvin198761:
非常感谢,国外的被封杀了,你这里还有一份
How to Convert An Image-Based Guest To An LVM-Based Guest
Mounting a filesystem located on a partition of an image of a disk
- 博客分类:
- Linux Toy
Mounting a filesystem located on a partition of an image of a disk
Need
Mounting a filesystem located on a partition of an image of a disk
Context
The following describes the circumstances under which the following solution makes sense:
- It is understood by the entire disk image, the images that include the disk partition table. For example a picture of the device / dev / sda includes partitions as possible in sda sda1, sda2, etc.
- The image must be flat, that is to be extracted with tools like dd and not as Encas tools that generate the images in a proprietary format that includes headers with target information.
- Note: This solution has been tested on GNU / Linux Debian Lenny with images of disks partitioned with NTFS format
Solution
You must create a virtual block device to read the information on the disk and then create other virtual blocks for each partition as the movement indicated in the partition table. Losetup tool to be used in operating systems to GNU / Linux Debian Lenny is in the package mount. This tool allows you to create loop devices. According to [2] loop kind of a device, also known as disk VND (vnode) or lofi (loopback interface file) is a pseudo device that lets you access a file as if it were a block device.
1. How is understood in the present context, it is assumed that already have images of the discs, and these images are not complete on disc on a specific partition.
* For more information on how to create these images to see the [solution regarding this need]]
2.It takes time as an example the following image of a disc from an application server with the Windows operating system and you have two partitions, the first identified as C: contains information from the operating system and the second D contains data from the user.
-r-------- 1 root root 68G 2008-09-16 15:46 appserver1_disk2.dd
3. It assigns a block device, which is not currently in use, the image using the losetup, the switch-fy the image file. For more information on this command to see [1].
# losetup -f appserver1_disk2.dd
4. To find out which device has been assigned the command is executed with the option losetp -a
# losetup -a
/dev/loop0: [0811]:12 (/media/disk/appserver1_disk2.dd)
* It is noted that the device was assigned /dev/loop0
5. We can see the partition table of this device by using the command fdisk with the option-l parameter as the virtual device / dev/loop0. Besides using the-u option to partition sizes ARE given in sectors and not in the cylinder. This seráútil in subsequent steps done by what means.
# fdisk -lu /dev/loop0
Disk /dev/loop0: 72.8 GB, 72833695744 bytes
255 heads, 32 sectors/track, 17433 cylinders, total 142253312 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x0b3a0b3a
Device Boot Start End Blocks Id System
/dev/loop0p1 * 32 30722399 15361184 7 HPFS/NTFS
/dev/loop0p2 30722400 142245119 55761360 7 HPFS/NTFS
* Se observan dos particiones /dev/loop0p1 que inicia en el sector 32 y /dev/loop0p2 en el sector 30722400
* Se observa que los sectores son de 512 bytes
6. So far there is a block device in / dev/loop0 which has two poarticiones / dev/loop0p1 and / dev/loop0p2, however these devices related to the partitions do not exist as such in the file system, is simply the way it appoints Partitions fdisk identified. To access the information on the disk be mounted partitions and to achieve this using the command losetup using the-o parameter that receives as the displacement or offset in bytes from where begins the partition that you want to be represented with a new device type loop.
7. It is estimated the offset (in bytes) of the / dev/loop0p1 and / dev/loop0p2 which began as fdisk-lu in the sector 32 and sector 30722400, respectively, and with 512-byte sectors.
$ echo $(( 512*32 ))
16384
$ echo $(( 512*30722400 ))
15729868800
* The partition / dev/loop0p1 starts at byte 16,384
* The partition / dev/loop0p2 starts at byte 15729868800
8. Devices are generated for each partition blocks with the command losetup in the same manner as was done to the image of the disc but this time must be specified on the device offset the initial / dev/loop0 which is the disk that contains partitions that are want to mount.
# losetup -fo 16384 /dev/loop0
# losetup -fo 15729868800 /dev/loop0
9. Checking the allocation of devices with the command losetup-a
# losetup -a
/dev/loop0: [0811]:12 (/media/disk/appserver1_disk2.dd)
/dev/loop1: [000d]:2285 (/dev/loop0), offset 16384
/dev/loop2: [000d]:2285 (/dev/loop0), offset 15729868800
* It is noted that the first partition to offset 16,384, previously referred to it as it is now possible loop0p1 referenced thorough device / dev/loop1 equally device / dev/loop2 represents the second partition with offset 15729868800 bytes on / dev / loop0
10. devices now have 3 blocks / dev/loop0, / dev/loop1 and / dev/loop2 where / dev/loop0 represents incluytendo entire disk partition table and that from now on will not be very useful can be said that he was transition in order to get the other devices / dev/loop1 and / dev/loop2 which now represent partition with NTFS format and can be mounted as follows:
# mkdir /mnt/appserver1/disk1p1 /mnt/appserver1/disk1p2
# mount /dev/loop1 /mnt/appserver1/disk1p1
# mount /dev/loop2 /mnt/appserver1/disk1p2
* If you're riding the images to make a forensic analysis recommends sse mount with the-r command to mount mounted read-only mode.
11. Finally it is possible to view the contents of these partitions on your point of assembly as any other file system
# ls /mnt/appserver1/disk1p1
发表评论
-
Cygwin 中 xwin 的启动参数
2010-11-20 14:21 2745不知为何现在装的cygwin xwin没有startxwin ... -
三种数据库,取随机记录的方法
2010-09-16 12:23 1243mysql:select * from tablename o ... -
用 grep 恢复误删的文本文件
2010-08-26 14:34 2009作为长期的电脑使用者,肯定会有误删文件的经历,在 Mac ... -
使用TELNET手工操作 SMTP/POP 收发邮件
2010-08-09 21:44 2477说明:手工录入的用蓝色字体表示,#后的为注释,不可录入。= ... -
关于 port forward 的一个实例
2010-07-07 09:25 1583tomcat 服务于 8080端口,但不想在前面加 apach ... -
ubuntu 半虚拟化domU的安装方法
2010-06-05 21:12 2510ubuntu还没有通过http://方法安装,不像redh ... -
mount 硬盘镜像的一般问题。
2010-06-01 12:33 25851. 要搞清楚文件是 是由整个分区来的,还是整个硬盘来的 ... -
通过 ulimit 改善系统性能
2010-05-22 09:07 1387http://www.ibm.com/developer ... -
lvm 的一些笔记
2010-03-22 22:50 2892今天,不得不面对lvm了,毕竞是公司用的. ... -
mencoder来提取电影mp3文件
2009-12-16 21:45 2064假如在欣赏电影过程中出现了一段美妙的插曲(特别是印度电影,一般 ... -
netcat usage sample
2009-11-28 18:33 1285This page documents various t ... -
dd 建立一个没有内容的大文件
2009-11-22 09:36 1987dd if=/dev/zero of=sparse-file ... -
将光盘镜像CentOS-5.3-i386-bin-DVD.iso设置成为yum源
2009-09-28 07:43 3737#mkdir /centos5.3.dvd (随便起个文件夹名 ... -
拷贝指定的文件出来但保持目录结构
2009-09-18 08:39 3074抽取当前目录以下的所有logo1.* 或 logo2.* 到 ... -
定制 bt4 frefinal live cd ( ubuntu)
2009-08-21 10:01 2608Customising the BackTrack 4 Pre ... -
linux 下查看 iso 文件信息
2009-08-21 09:55 2280root@feng-desktop:/media/sda5/i ... -
copy file over ssh with tar
2009-08-15 08:57 1449tar is usually used for achiv ... -
copy file using cpio
2009-08-11 17:38 1469http://bradthemad.org/tech/note ... -
copy file using tar
2009-08-11 17:22 1192We assume /source/dir is a file ... -
VLC webcam 准实时视频
2008-10-28 23:19 2426#!/bin/bash file=/root/video_$( ...
相关推荐
write a new filesystem irrespective of whether an existing filesystem is present. The -e and -ef options allow files/directories to be specified which are excluded from the output filesystem. The -e ...
8.5.8 Creating a File System On a Disk 228 8.5.9 Additional Commands to Manage Disks 229 Chapter 9 Managing Devices 235 9.1 Solaris Device Driver Introduction 235 9.2 Analyzing Lack of Device Support ...
- **Formatting and Partitions**: Covers topics like the Master Boot Record (MBR), boot sectors, partition tables, extended and logical partitions, partition types, and partitioning a hard disk. ...
Reading the output of a sequence of commands 38 Reading "n" characters without pressing Return 40 Field separators and iterators 41 Comparisons and tests 44 Chapter 2: Have a Good Command 49 ...
在设计悬置系统时,会涉及到“打击中心”(centre of percussion)和“扭矩”(torquer)的概念,这些概念对于优化悬置系统的性能非常重要。 关键词中提到了“悬置系统”、“振动”、“惯性矩阵”和“刚度矩阵”。...
8.8. Mounting a disk image using the loop device 8.8.1. ...on Linux 8.8.2. ...on FreeBSD 8.9. Simulating a Symmetric Multiprocessor (SMP) Machine 8.10. Setting Up Networking in DLX Linux 8.11. ...
USB Safely Remove是一个可以将USB设备安全删除的辅助工具,对于频繁添加或者移除USB设备的用户非常有用,能够有效帮助您解决无法删除...* Automatic mounting and dismounting a TrueCrypt volume stored on a device
1.1.1.1 Ensure mounting of cramfs filesystems is disabled (Scored) .............................. 20 1.1.1.2 Ensure mounting of freevxfs filesystems is disabled (Scored)............................ 22...
- **Overview of Ubuntu**: This chapter provides an introduction to Ubuntu Linux, covering its history, philosophy, and the reasons for its popularity among both individuals and organizations....
Height of Center Dimensionof overall Dimensionof base mounting Diameter of anchor bolt hole Size of Axis stretch Size of key H L×HD A×B K D×E F×G 132 515×315 216×178 12 38×80 10×33 3.4 ...
- **Pin Assignment**: A layout of the pins on the package, indicating their physical locations. - **PAD Coordinates**: Specific coordinates for the pads on the package, useful for PCB design. - **...
【船级社】 DNV Foundation and mounting of machinery 2019-07.pdf
With this tool, I can just mount an ISO as a CD-ROM, and go from there, instead of waiting to burn an ISO to disc. Just a little time-saver there. <br><top><br> Feature Requests <br>Please ...
1,IEC 61760-1:2020 Surface mounting technology - Part 1:Standard method for the specification of surface mounting components(SMDs) 2,IEC 61760-2:2021 Surface mounting technology - Part 2:...
housing, an insulated base and a 10–32 UNF threaded mounting hole suitable for use in a variety of environmental conditions. The main difference between Type 4533-B and Type 4534-B is the position of...
Kubernetes eases the pain of container orchestration with a lot of killer features, such as container scaling, mounting storage systems, and service discovery. Chapter 4, Working with Storage and ...
Kubernetes eases the pain of container orchestration with a lot of killer features, such as container scaling, mounting storage systems, and service discovery. Chapter 4, Working with Storage and ...