Merge PDF files

Merge pdf files placed in a folder:

Advertisements

Mount disk (dd) image

If you want to see contents of the dd image of disk without actually executing dd command, use following trick.

$ fdisk -l sdcard-image.img

Disk sdcard-image.img: 7948 MB, 7948206080 bytes
255 heads, 63 sectors/track, 966 cylinders, total 15523840 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: 0x29c7ef50

      Device Boot  Start     End  Blocks Id System
sdcard-image.img1 * 2048  129023   63488  c W95 FAT32 (LBA)
sdcard-image.img2 129024 7744511 3807744 83 Linux

Make note of the values shown in the Start column. Let’s say we want to see partition #1, it is starting from 20148 so actually disk will start from 2048 x 512 =  1048576 as sector size is 512. Now we will use value 1048576 for mount command.

$ mkdir p1
$ mount -o ro,loop,offset=1048576 sdcard-image.img p1

p1 folder is having contents of p1.

For p2 use

$ mkdir p2
$ mount -o ro,loop,offset=66060288 sdcard-image.img p2

As 129024 x 512 = 66060288