Jump to content
aelius

Mountare partitii din imagini

Recommended Posts

Posted (edited)

Daca aveti nevoie sa faceti mount la o anumita partitie dintr-o imagine.

1. Aici se poate vedea flash cardul la care urmeaza sa fac imagine:


root@hp:~# fdisk -l /dev/sdb

Disk /dev/sdb: 15.9 GB, 15931539456 bytes
230 heads, 21 sectors/track, 6442 cylinders, total 31116288 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sdb1 * 8192 31116287 15554048 b W95 FAT32

2. Aici fac imaginea utilizand dd


root@hp:~# dd if=/dev/sdb of=test.img bs=4M
3798+1 records in
3798+1 records out
15931539456 bytes (16 GB) copied, 1494.65 s, 10.7 MB/s
root@hp:~#

3. Aici verific imaginea cu fdisk


root@hp:~# fdisk -l test.img

Disk test.img: 15.9 GB, 15931539456 bytes
230 heads, 21 sectors/track, 6442 cylinders, total 31116288 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
test.img1 * 8192 31116287 15554048 b W95 FAT32

4. La punctul 3 am vazut Start si End la partitia pe care doresc sa o mountez. Voi utiliza mount + offset pentru a face acest lucru


root@hp:~# mount -o ro,offset=$((8192*512)) test.img test/
root@hp:~# df -h|grep test
/dev/loop0 15G 2.2G 13G 15% /root/test

Note:

- Poate va intrebati la ce va este utila mountarea partitiilor din imagini. In cazul in care ati pierdut date de pe un hdd, puteti face imagine la el si apoi sa analizati imaginea, astfel incat evitati sa gresiti ceva si sa nu mai puteti recupera acele date.

- Am facut o imagine la un flash card pentru a va da un exemplu la obiect.

- In loc de fdisk puteti utiliza gdisk. (in special cand lucrati cu GPT)

Man pages:

- http://linux.die.net/man/1/dd

- http://linux.die.net/man/8/fdisk

- http://linux.die.net/man/8/gdisk

Edited by aelius
  • Upvote 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...