Over the last 5 or 6 years, I've acquired several old, therefore cheap(er), DLINK 2-disk NAS and flashed them with Alt-F firmware, which is reported as offering increased functionality. I've never used any other NAS/firmware but my usage has been well-served by it.
The latest box is a DNS-327L and my adventure started with installing two 8TB ST8000DM004-2CX188 in Raid 1:
The intent is to use this device for my various personal files backup and btrfs caught my attention. My current backup is on a 3.7TB drive in a USB/eSATA enclosure. If I run my backup script on my main desktop PC over the LAN to the DNS-327L, progress is slow, understandably, but also gets interrupted by an rsync error or errors periodically and has to be restarted.
I thought to connect the 4TB drive to the USB connector on the 327L but the stumbling block with that idea is that the partition is formatted reiserfs, which is not digested by Alt-F.
My next trick was to build fstransform to convert the partition to the compatible ext4 filesystem without data loss but, when I executed the command, I discovered an overlooked fatal limitation:
REISERFS file systems using format "3.5" (the default) and equal or larger than 2TB cannot be converted due to their maximum file size = 2TB - 4k: fstransform needs to create a sparse file as large as the device itself.
REISERFS file systems using format "3.6" are immune to this problem.
My next trick was to run `btrfs convert' from btrfs-progs-5.6-1.mga7, got an error that reiserfs was not supported, tried building from source, got the same error, and found the [default] configure option for source filesystems did not include reiserfs. After re-configuring with reiserfs indicated and making, the `convert' command completed on the target partition. That process was performed via ssh to another MGA7 machine on the LAN with the bare HDD connected over an eSATAp connection. However, while the filesystem is recognized as btrfs in, for example, gnome-disks, it won't mount and that machine won't boot with the disk connected. I can boot then connect the drive and it is recognized for what it is but still won't mount.
- Code: Select all
Disk /dev/sdd: 3.7 TiB, 4000787030016 bytes, 7814037168 sectors
Disk model: WDC WD4000F9YZ-0
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 70351DDC-EC05-BD44-9127-C957CEBF8528
Device Start End Sectors Size Type
/dev/sdd1 2048 7814037134 7814035087 3.7T Linux filesystem
[root@z170i rolf]# mount /dev/sdd1 /mnt/disk
mount: /mnt/disk: wrong fs type, bad option, bad superblock on /dev/sdd1, missing codepage or helper program, or other error.
[root@z170i rolf]#
Running a grep for BTRFS on `dmesg' or `journalctl' showed problems with chunks and extents, sizes outside physical boundaries, to the best of my recollection.
There are a number of btrfs filesystem maintenance/repair commands and I cautiously worked through them, clearing the errors reported in the logs except when I try to mount. This one, iianm, got the kernel to be happy about the partition (except when mounting):
- Code: Select all
btrfs rescue chunk-recover -v /dev/sdc1
About 8.5 hours later:
- Code: Select all
...
Unrecoverable Chunks:
Total Chunks: 10787
Recoverable: 10787
Unrecoverable: 0
Orphan Block Groups:
Orphan Device Extents:
Check chunks successfully with no orphans
Chunk tree recovered successfully
[root@z170i rolf]# mount /dev/sdc1 /mnt/disk
mount: /mnt/disk: wrong fs type, bad option, bad superblock on /dev/sdc1, missing codepage or helper program, or other error.
[root@z170i rolf]# mount -t btrfs /dev/sdc1 /mnt/disk
mount: /mnt/disk: wrong fs type, bad option, bad superblock on /dev/sdc1, missing codepage or helper program, or other error.
[root@z170i rolf]#reboot
won't boot; unplug esatap 4TB drive
reboot and replug:
- Code: Select all
# journalctl -f
...
Jun 27 15:53:45 z170i kernel: ata2: COMRESET failed (errno=-16)
Jun 27 15:53:49 z170i kernel: ata2: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
Jun 27 15:53:49 z170i kernel: ata2.00: ATA-8: WDC WD4000F9YZ-09N20L1, 01.01A02, max UDMA/133
Jun 27 15:53:49 z170i kernel: ata2.00: 7814037168 sectors, multi 0: LBA48 NCQ (depth 32), AA
Jun 27 15:53:49 z170i kernel: ata2.00: configured for UDMA/133
Jun 27 15:53:49 z170i kernel: scsi 1:0:0:0: Direct-Access ATA WDC WD4000F9YZ-0 1A02 PQ: 0 ANSI: 5
Jun 27 15:53:49 z170i kernel: sd 1:0:0:0: [sdd] 7814037168 512-byte logical blocks: (4.00 TB/3.64 TiB)
Jun 27 15:53:49 z170i kernel: sd 1:0:0:0: [sdd] 4096-byte physical blocks
Jun 27 15:53:49 z170i kernel: sd 1:0:0:0: [sdd] Write Protect is off
Jun 27 15:53:49 z170i kernel: sd 1:0:0:0: [sdd] Mode Sense: 00 3a 00 00
Jun 27 15:53:49 z170i kernel: sd 1:0:0:0: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
Jun 27 15:53:49 z170i kernel: sdd: sdd1
Jun 27 15:53:49 z170i kernel: sd 1:0:0:0: [sdd] Attached SCSI disk
Jun 27 15:53:50 z170i kernel: BTRFS: device label backup devid 1 transid 1035511 /dev/sdd1 scanned by systemd-udevd (18729)
Jun 27 15:53:58 z170i mandi[2753]: skipping known address: ...
[rolf@z170i ~]$ dmesg | grep BTRFS
[ 180.321856] BTRFS: device label backup devid 1 transid 1035511 /dev/sdd1 scanned by systemd-udevd (18729)
[rolf@z170i ~]$
Disk /dev/sdd: 3.7 TiB, 4000787030016 bytes, 7814037168 sectors
Disk model: WDC WD4000F9YZ-0
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 70351DDC-EC05-BD44-9127-C957CEBF8528
Device Start End Sectors Size Type
/dev/sdd1 2048 7814037134 7814035087 3.7T Linux filesystem
[root@z170i rolf]# mount /dev/sdd1 /mnt/disk
mount: /mnt/disk: wrong fs type, bad option, bad superblock on /dev/sdd1, missing codepage or helper program, or other error.
[root@z170i rolf]# mount -t btrfs /dev/sdd1 /mnt/disk
mount: /mnt/disk: wrong fs type, bad option, bad superblock on /dev/sdd1, missing codepage or helper program, or other error.
[root@z170i rolf]# lsmod | grep btrfs
[root@z170i rolf]# modprobe btrfs
[root@z170i rolf]# lsmod | grep btrfs
[root@z170i rolf]#
Although, from `man btrfs-check':
- Code: Select all
Warning
Do not use --repair unless you are advised to do so by a developer or an experienced user, and then only
after having accepted that no fsck successfully repair all types of filesystem corruption. Eg. some other
software or hardware bugs can fatally damage a volume.
I had spent enough time avoiding this in my free time over this past week, and I was ready to jump:
- Code: Select all
[root@sysresccd /tmp]# ps -p 1015 -o args
COMMAND
btrfs check --repair -p /dev/sda1
BTW, this is being run over ssh on the secondary machine booted to systemrescuecd, which boots with the drive connected. It's been running for about 16 hours, seemingly looking at and correcting every inode. From quite a little while ago:
- Code: Select all
[root@sysresccd /tmp]# ps -p 1015 -o etime
ELAPSED
14:49:00
This is also the first time I've paid any attention to "inodes". Searching google for how many inodes are in a 3.7TB partition, not that I'm thinking they can be counted that way for this purpose, I'm still afraid this "repair" might not end in my lifetime.
Before too long, I'll stop the --repair and try another experiment. According to `man btrfs-convert':
- Code: Select all
-r|--rollback
rollback to the original ext2/3/4 filesystem if possible
That doesn't mention reiserfs and there might need to be an image created, so long shot. I need to get my backup online and might just format ext4 and run the script on the enclosure connected to my PC, as the next steps.
Thanks for reading!