Fixdisk repeatedly unable to find partition 1

/df

Well-Known Member
That output represents the partition scheme that is stored in the MBR (label: dos means the partition structure is MBR). If that output is given to sfdisk, the partition scheme will be re-created, including writing an equivalent MBR in the first sector (note that the first partition starts at sector 8) [re-edit].
 
Last edited:

sine24

Member
Does this mean that your command

PARTDIR=/var/lib/humaxtv_backup/partition
mkdir -p "$PARTDIR" && /sbin/sfdisk /dev/sda --dump >"$PARTDIR/sda.dump"

will backup MBR somewhere on the hard drive?

If the drive doesn't work like in the OP case does your second command still restore the mbr?
 

/df

Well-Known Member
Obvs not on the hard drive as it wouldn't be accessible if the drive's partition table got trashed (among other possible failures).

/var/lib/humaxtv_backup/partition is (or will be made by mkdir -p) a directory in the system's flash storage (/dev/mtdblock2), like the storage in a USB stick but soldered into the settop box's circuit board.

In the command that you quote, you can replace /sbin/sfdisk /dev/sda --dump with the complicated command that you ran. Then the output will be saved and could potentially be used to restore the MBR.

A paranoid user could also copy the saved data to an off-line backup, say an actual USB stick.
 

xyz321

Well-Known Member
When a disk is formatted with the GPT format by the telnet menu there is a two stage process in creating the GPT and then a non-standard MBR which is recognisable to the Humax app. (see /bin/tmenu).

Will the sfdisk dump command above, save the MBR and the GPT in this situation?
 

/df

Well-Known Member
Good point. You'd hope so, since sfdisk is the program used in /bin/tmenu to create the dummy MBR and the CF version is supposed to handle GPT and MBR disks, but obviously a test would give confidence. From man sfdisk I suspect that this hope is misplaced, as the defined input format doesn't mention any way of specifying a nested label (aka hybrid MBR). And the confirmation is here.

Apparently we would need to save two dumps and then restore them in reverse order.
 
Last edited:
Top