Monday, September 06, 2021

Recover partition table/FFS2 after overwrite?

I think I just overwrote my file system by using sd1 instead of sd2:

# pv install69.img > /dev/rsd1c

sd1 is softraid crypto device that holds the system partitions and data:

$ df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/sd1a 1.9G 143M 1.7G 8% /
/dev/sd1f 843G 734G 66.2G 92% /home
/dev/sd1b 9.7G 14.5M 9.2G 0% /tmp
/dev/sd1e 48.4G 40.8G 5.2G 89% /usr
/dev/sd1d 19.4G 16.9G 1.5G 92% /var

# disklabel sd1
# /dev/rsd1c:
type: SCSI
disk: SCSI disk
label: SR CRYPTO
duid: a1f07cee2aba3a55
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 121600
total sectors: 1953518528
boundstart: 64
boundend: 1953504000
drivedata: 0

16 partitions:
# size offset fstype [fsize bsize cpg]
a: 4208960 64 4.2BSD 2048 16384 12960 # /
b: 20980896 4209024 4.2BSD 2048 16384 12960 # /tmp
c: 1953518528 0 unused
d: 41945696 25189920 4.2BSD 2048 16384 12960 # /var
e: 104872320 67135616 4.2BSD 2048 16384 12960 # /usr
f: 1781496064 172007936 4.2BSD 8192 65536 52270 # /home


The system is currently up and running.
I'm not sure what has been overwritten. Possibly only sd1a /?
Is it possible to recover from this without loosing access to the data in /home, /var, /usr?

No comments:

Post a Comment