LINUX.ORG.RU

История изменений

Исправление kostik87, (текущая версия) :

Если помнишь какие разделы были и типы файловых систем, то попробуй что-нибудь смонтировать.

#!/bin/sh
for ((sector=16100; sector<=17000 ; sector++)) 
do
   offset=$(($sector*512))
   cmd="mount -t ntfs-3g /dev/sda /mnt/tmp/ -o ro,offset=$offset"
   echo "sector: $sector offset: $offset";
   $cmd 2>/dev/null && echo "partition found @ offset $offset!" && break
done
fdisk -l /dev/sda

Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 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: 0x5e9ea2f8

Устр-во   Загрузочный     Start Конец    Blocks  Id System
/dev/sda1                 16065 976768064 488376000   f W95 Ext'd (LBA)
/dev/sda5                 16128 976768064 488375968+  7 HPFS/NTFS/exFAT
./script.sh
sector: 16100 offset: 8243200
sector: 16101 offset: 8243712
sector: 16102 offset: 8244224
sector: 16103 offset: 8244736
sector: 16104 offset: 8245248
sector: 16105 offset: 8245760
sector: 16106 offset: 8246272
sector: 16107 offset: 8246784
sector: 16108 offset: 8247296
sector: 16109 offset: 8247808
sector: 16110 offset: 8248320
sector: 16111 offset: 8248832
sector: 16112 offset: 8249344
sector: 16113 offset: 8249856
sector: 16114 offset: 8250368
sector: 16115 offset: 8250880
sector: 16116 offset: 8251392
sector: 16117 offset: 8251904
sector: 16118 offset: 8252416
sector: 16119 offset: 8252928
sector: 16120 offset: 8253440
sector: 16121 offset: 8253952
sector: 16122 offset: 8254464
sector: 16123 offset: 8254976
sector: 16124 offset: 8255488
sector: 16125 offset: 8256000
sector: 16126 offset: 8256512
sector: 16127 offset: 8257024
sector: 16128 offset: 8257536
partition found @ offset 8257536!
mount | grep sda
/dev/sda on /mnt/tmp type fuseblk (ro,nosuid,nodev,allow_other,blksize=4096)
losetup -a
/dev/loop0: [2101]:13 (/mnt/usr/usr.sq)
/dev/loop1: [2103]:22 (/mnt/opt/opt.sq)
/dev/loop2: [2101]:14 (/mnt/usr/src.sq)
/dev/loop3: [2101]:11 (/mnt/usr/portage.sq)
/dev/loop5: [0005]:7210 (/dev/sda), offset 8257536

Исходная версия kostik87, :

Если помнишь какие разделы были и типы файловых систем, то попробуй что-нибудь смонтировать.

#!/bin/sh
for ((sector=16100; sector<=17000 ; sector++)) 
do
   offset=$(($sector*512))
   cmd="mount -t ntfs-3g /dev/sda /mnt/tmp/ -o ro,offset=$offset"
   echo "sector: $sector offset: $offset";
   $cmd 2>/dev/null && echo "partition found @ offset $offset!" && break
done
fdisk -l /dev/sda

Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 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: 0x5e9ea2f8

Устр-во   Загрузочный     Start Конец    Blocks  Id System
/dev/sda1                 16065 976768064 488376000   f W95 Ext'd (LBA)
/dev/sda5                 16128 976768064 488375968+  7 HPFS/NTFS/exFAT
./script.sh
sector: 16100 offset: 8243200
sector: 16101 offset: 8243712
sector: 16102 offset: 8244224
sector: 16103 offset: 8244736
sector: 16104 offset: 8245248
sector: 16105 offset: 8245760
sector: 16106 offset: 8246272
sector: 16107 offset: 8246784
sector: 16108 offset: 8247296
sector: 16109 offset: 8247808
sector: 16110 offset: 8248320
sector: 16111 offset: 8248832
sector: 16112 offset: 8249344
sector: 16113 offset: 8249856
sector: 16114 offset: 8250368
sector: 16115 offset: 8250880
sector: 16116 offset: 8251392
sector: 16117 offset: 8251904
sector: 16118 offset: 8252416
sector: 16119 offset: 8252928
sector: 16120 offset: 8253440
sector: 16121 offset: 8253952
sector: 16122 offset: 8254464
sector: 16123 offset: 8254976
sector: 16124 offset: 8255488
sector: 16125 offset: 8256000
sector: 16126 offset: 8256512
sector: 16127 offset: 8257024
sector: 16128 offset: 8257536
partition found @ offset 8257536!