force 1-1 logical to physical sectors
copy our VBR code to backup VBR
This commit is contained in:
@@ -69,7 +69,7 @@ if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
||||
|
||||
# get first partition, this is sloppy might need to review this...
|
||||
firstpart=$(lsblk -ilp -o NAME $ld | tr '\n' ' ' | awk '{print $3}')
|
||||
mkfs.fat -v -F32 -n 'STEVIAFS' $firstpart
|
||||
mkfs.fat -v -F32 -s 1 -n 'STEVIAFS' $firstpart
|
||||
|
||||
# copy MBR while preserving partition table
|
||||
if ! dd if=$mbr_file of=$ld bs=1 count=440; then
|
||||
@@ -100,6 +100,12 @@ if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# write backup VBR
|
||||
if ! dd if=$firstpart of=$firstpart bs=$disk_sector_size count=1 seek=6; then
|
||||
echo "Failed to copy VBR (sector 1) to backup VBR." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#stage2 to sectors 1-64
|
||||
if ! dd if=$stage2_file of=$ld bs=$disk_sector_size seek=1; then
|
||||
echo "Failed to write Stage2 to disk." >&2
|
||||
|
||||
Reference in New Issue
Block a user