# Disklabel Restore Issue



## tangi (Apr 14, 2013)

Is there a command which is working like on NetBSD to restore previously saved disklabel?


```
freebsd# gpart show
=>      63  20971457  ad0s1  MBR  (10G)
        63  10485153     1  freebsd  [active]  (5G)
  10485216  10486304        - free -  (5.0G)
```


```
# save 
disklabel ad0s1 >/tmp/file
# restore
disklabel -R ad0s1 /tmp/file
```

I tried both applying disklabel file from commands

```
freebsd# disklabel -r ad0s1
# /dev/ad0s1:
8 partitions:
#          size     offset    fstype   [fsize bsize bps/cpg]
  a:   10485153          0    4.2BSD        0     0     0
  c:   10485153          0    unused        0     0     # "raw" part, don't edit
disklabel: partition c doesn't cover the whole unit!
disklabel: An incorrect partition c may cause problems for standard system utilities
```

or 


```
freebsd# disklabel -A ad0s1
# /dev/ad0s1:
type: ESDI
disk: ad0s1
label:
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 10402
sectors/unit: 10485760
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # milliseconds
track-to-track seek: 0  # milliseconds
drivedata: 0

8 partitions:
#          size     offset    fstype   [fsize bsize bps/cpg]
  a:   10485153          0    4.2BSD        0     0     0
  c:   10485153          0    unused        0     0     # "raw" part, don't edit
disklabel: partition c doesn't cover the whole unit!
disklabel: An incorrect partition c may cause problems for standard system utilities
```



None of two files can be restored.
Thank you so much.


----------



## kpa (Apr 14, 2013)

`# gpart backup` and `# gpart restore`


----------



## tangi (Apr 14, 2013)

Tried.

```
freebsd# gpart backup ad0s1
gpart: No such geom: ad0s1.
```


----------

