2

I am trying to make an ISO of a Windows Backup disc that I "burned" to my microSD card, which I did in desperation due to lack of HDD storage at the time. Now I want to get it out of there and onto the HDD again as an ISO file, instead of a partition as it originally was.

I have tried to do what I think should be sufficient but has been doubting due to Windows telling me the ISO is corrupt. So, what I did:

First I did a lot of calculating, adding sums and whatever to get the final sector, but then I realised I can just get the sector by running fdisk and getting the end sector of the partition I want, which is 1 in this case, and add 1, to get that index since I read somewhere that it is necessary (tried without as well but it failed, hence looking it up):

[~]: sudo fdisk /dev/sdc
[sudo] password for simon: 

Welcome to fdisk (util-linux 2.26.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Command (m for help): p
Disk /dev/sdc: 29.8 GiB, 32009355264 bytes, 62518272 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
Disklabel type: dos
Disk identifier: 0x1e6e3d4a

Device     Boot Start      End  Sectors  Size Id Type
/dev/sdc1  *     2048 25671679 25669632 12.2G  c W95 FAT32 (LBA)

Command (m for help): 

The partition starts at 2048 and ends at 25671679, which gives me the count for dd to be 25671680. My dd command will then be, given a sector size of 512 (also given above):

[img]: sudo dd if=/dev/sdc of=WindowsBackupDisk.iso bs=512 count=25671680
25671680+0 records in
25671680+0 records out
13143900160 bytes (13 GB) copied, 158.92 s, 82.7 MB/s

Running this command should give me a file with a size of the sum of the partition and the MBR. If I were to have more partitions, I would have just used the end sector of the last one that I wanted to include, right?

I wanted to do this because I have this on a 32GB microSD card I wish to use for something else. However, when going into Windows I try to mount it in order to verify it's integrity but it does not work. Is this because Windows can't read the format of a raw ISO like this or is it because it is corrupt?

Running file on the ISO gives me:

[img]: file WindowsBackupDisk.iso 
WindowsBackupDisk.iso: DOS/MBR boot sector MS-MBR Windows 7 english at 
offset 0x163 "Invalid partition table" at offset 0x17b "Error loading 
operating system" at offset 0x19a "Missing operating system", disk 
signature 0x1e6e3d4a; partition 1 : ID=0xc, active, start-CHS 
(0x0,32,33), end-CHS (0x3ff,254,63), startsector 2048, 25669632 sectors

What can I do to make sure that it is readable in my Windows OS? I would prefer to not install MagicISO or such programs on my Windows because I thought I could do it in Linux, but if it is the only solution then I'd like to know why so I can take this as a lesson.

Mounting partition 1:

[img]: sudo mount -o loop,offset=1048576 -t vfat WindowsBackupDisk.iso /mnt/tmp/
[sudo] password for simon: 
[img]: ls /mnt/tmp/
boot  bootmgr  bootmgr.efi  efi  reagent.xml  sources  System Volume Information

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.