On 2017年10月29日 11:20, Kai Hendry wrote:
> On Sat, 28 Oct 2017, at 03:58 PM, Qu Wenruo wrote:
>> Don't get confused with the name, to use "fix-dev-size" you need to run
>> "btrfs rescue fix-dev-size"
> 
> [hendry@nuc btrfs-progs]$ sudo ./btrfs rescue fix-device-size /dev/sdc1
> warning, device 2 is missing
> ERROR: devid 2 is missing or not writeable
> ERROR: fixing device size needs all device(s) present and writeable
> [hendry@nuc btrfs-progs]$ lsblk -f
> NAME   FSTYPE LABEL    UUID                                 MOUNTPOINT
> sda
> ├─sda1 vfat            0C95-8576                            /boot
> └─sda2 btrfs           c5f98288-5ab3-4236-b00e-f2cd15c0616d /
> sdb
> sdc
> └─sdc1 btrfs  extraid1 5cab2a4a-e282-4931-b178-bec4c73cdf77
> [hendry@nuc btrfs-progs]$ lsblk -f
> NAME   FSTYPE LABEL    UUID                                 MOUNTPOINT
> sda
> ├─sda1 vfat            0C95-8576                            /boot
> └─sda2 btrfs           c5f98288-5ab3-4236-b00e-f2cd15c0616d /
> sdb
> └─sdb1 btrfs  extraid1 5cab2a4a-e282-4931-b178-bec4c73cdf77
> sdc
> └─sdc1 btrfs  extraid1 5cab2a4a-e282-4931-b178-bec4c73cdf77
> [hendry@nuc btrfs-progs]$ sudo ./btrfs rescue fix-device-size /dev/sdc1
> Couldn't setup extent tree
> Couldn't setup device tree
> ERROR: could not open btrfs
> [hendry@nuc btrfs-progs]$ sudo ./btrfs rescue fix-device-size /dev/sdb1
> leaf parent key incorrect 1320477425664
> ERROR: could not open btrfs

Maybe superblocks of both devices have something wrong.

> [hendry@nuc btrfs-progs]$ sudo mount -o degraded /dev/sdb1 /mnt/raid1/
> mount: /mnt/raid1: wrong fs type, bad option, bad superblock on
> /dev/sdb1, missing codepage or helper program, or other error.
> 
> 
> Still unable to mount. Damn. Maybe I'm chasing a red herring? Here are
> the relevant kernel logs:
> 
> Oct 29 10:56:45 nuc kernel: sd 2:0:0:0: [sdb] Attached SCSI disk
> Oct 29 10:57:32 nuc kernel: BTRFS info (device sdc1): allowing degraded
> mounts
> Oct 29 10:57:32 nuc kernel: BTRFS info (device sdc1): disk space caching
> is enabled
> Oct 29 10:57:32 nuc kernel: BTRFS info (device sdc1): has skinny extents
> Oct 29 10:57:33 nuc kernel: BTRFS error (device sdc1): super_total_bytes
> 4000795746304 mismatch with fs_devices total_rw_bytes 4000795749888
> Oct 29 10:57:33 nuc kernel: BTRFS error (device sdc1): failed to read
> chunk tree: -22
> Oct 29 10:57:33 nuc kernel: BTRFS error (device sdc1): open_ctree failed
> 
> 
> Nonetheless if I reboot to 4.4, I can still mount. However my root is
> bizarrely out of space or inodes so journalctl et al is unusable.

Can 4.4 mount it rw?
If so, mount it, do minimal write like creating an empty file, to update
both superblock copies, and then try fix-device-size.

Thanks,
Qu

> 
> 
> Kind regards,
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to