# fsck: can't read disk label error



## circus78 (Aug 30, 2014)

Hi,
I followed official handbook to grow my / partition on my FreeBSD 9.3:

https://www.freebsd.org/doc/handbook/disks-growing.html

I got no errors. After reboot, I got filesystem error and I tried to recover file system with `fsck`, but:


```
root@: fsck -t ufs -y /dev/ada0s1a
** /dev/ada0s1a

CANNOT READ BLK: 153899712
CONTINUES? yes

THE FOLLOWING DISK SECTORS COULD NOT BE READ: 153899712, 153899713, 153899714, 153899715, 153899716,
ioctl IGCINFO): Inappropriate ioctl for device
fsck_ufs: /dev/ada0s1a: can't read disk label
```

Here my `gpart` output:


```
root@: # gpart show ada0
=>           63 156365840   ada0    MBR (74G)
               63 155189223      1     freebsd   [active]   (74G)
    155189286     1176617         - free -   (574M)
```

Any suggestion? Thank you very much


----------



## circus78 (Aug 30, 2014)

This is the output of `bsdlabel ada0s1`  (from live CD):


```
# /dev/ada0s1:
8 partitions:
#          size     offset    fstype   [fsize bsize bps/cpg]
  a:  153092089          0    4.2BSD        0     0     0
  b:    2097128  153092089      swap                    
  c:   31457223          0    unused        0     0     # "raw" part, don't edit
```


----------



## circus78 (Aug 31, 2014)

Further info:


```
# gpart show ada0
=>       63  156365840  ada0  MBR  (74G)
         63  155189223     1  freebsd  [active]  (74G)
  155189286    1176617        - free -  (574M)
```


```
# gpart show ada0s1
=>        0  155189223  ada0s1  BSD  (74G)
          0  153092089       1  freebsd-ufs  (73G)
  153092089    2097128       2  freebsd-swap  (1G)
  155189217          6          - free -  (3.0k)
```


```
# bsdlabel /dev/ada0s1

# /dev/ada0s1:
8 partitions:
#          size     offset    fstype   [fsize bsize bps/cpg]
  a:  153092089          0    4.2BSD        0     0     0
  b:    2097128  153092089      swap                    
  c:   31457223          0    unused        0     0     # "raw" part, don't edit
partition a: partition extends past end of unit
partition b: offset past end of unit
partition b: partition extends past end of unit
```

How can I solve this? Thank you


----------



## wblock@ (Aug 31, 2014)

What was the partition information before using growfs()?  What was grown, and by how much?


----------



## circus78 (Aug 31, 2014)

Hi,

it was 14 GB, and I raised to 74 GB.
But I forgot swap partition, so I tried to resize to 73 GB (in order to make space for freebsd-swap), but `growfs` told me that it was impossible to reduce space.
Anyway it seems that partition size are correct (73 for / and 1 for swap)
Thank you


----------



## wblock@ (Aug 31, 2014)

Once a filesystem has been grown, it can't be decreased.  Changing the partition sizes will not change the filesystem size.  It may be enough to delete that swap partition, but some of the a filesystem might have been overwritten.

You made a backup first, right?  Then delete the swap partition: `gpart delete -i2 ada0s1`

If you are very lucky, the filesystem will be okay.  Run a full fsck(8) on it, and check the data afterwards.

Otherwise, repartition and restore from backup.


----------



## circus78 (Aug 31, 2014)

Hi,
Thank you for your reply.
I just deleted swap partition, and I got same error:


```
root@: fsck -t ufs -y /dev/ada0s1a
** /dev/ada0s1a

CANNOT READ BLK: 153899712
CONTINUES? yes

THE FOLLOWING DISK SECTORS COULD NOT BE READ: 153899712, 153899713, 153899714, 153899715, 153899716,
ioctl IGCINFO): Inappropriate ioctl for device
fsck_ufs: /dev/ada0s1a: can't read disk label
```

I have to grow again /dev/ada0s1a from 73G to 74G?
Thank you very much.


----------



## wblock@ (Aug 31, 2014)

Did you reboot after deleting the swap partition?  What is the output of `gpart show` now?


----------



## circus78 (Aug 31, 2014)

Hi, I rebooted and `gpart` showed me only ada0s1a partition with 74G.
Anyway, I have filesystem dump, I proceed with restore.
Thank you


----------



## wblock@ (Aug 31, 2014)

circus78 said:
			
		

> Hi, I rebooted and `gpart` showed me only ada0s1a partition with 74G.



Yes, but did it show the filesystem going past the end of the partition?


----------



## circus78 (Sep 4, 2014)

Sorry I missed that.


----------

