fsck: can't read disk label error

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:

Code:
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:

Code:
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
 
This is the output of bsdlabel ada0s1 (from live CD):

Code:
# /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
 
Further info:

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

Code:
# 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)

Code:
# 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
 
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
 
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.
 
Hi,
Thank you for your reply.
I just deleted swap partition, and I got same error:

Code:
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.
 
Hi, I rebooted and gpart showed me only ada0s1a partition with 74G.
Anyway, I have filesystem dump, I proceed with restore.
Thank you
 
Back
Top