0

I had a working system that was running out of space. So I added space to the end of the disk.

Boot from gparted ISO

  1. launched gparted moved partition 3 of 3 to the right. Went to resize partition 2 of 3 to claim unused space.

  2. Error: About 100 files have csum errors.

  3. btrfs check --repair /dev/sda2

  4. Errors persist

  5. Ok so clean out the crc --init-csum-tree

  6. Errors persist, and can't extend partition

Question how should I have resolved this?

So I added a hard drive, made a new partition, and used cp -r -p /source/* /destination/ (the actually name of the mounted folder doesn't matter)

Since repairing the original partition failed, and I thought I had backed everything up I formatted the source partition.

Now after the partition repaired, put data back.

cp -r -p /destination/* /source

Had to resolve some grub errors and the UUID in fstab.

So it boot, but with errors complaining about /usr/local and several other locations.

Research shows that these locations are subvolumes.

Most of them were relatively harmless, as in I can just re-install them. However, var had some mysql databases in it.

Is my data gone? Why didn't cp copy it? Most importantly how do I copy all files to another partition so I can format(file system damaged beyond --repair) the original, and copy the files back without losing data due to subvolumes or etc?

0

My heart stopped the moment you moved a partition.

Such disk operations are DANGEROUS. Particularly if you don't have a validated backup.

The checksum errors is BTRFS's way of telling you that your files are corrupted. Attempting to convince BTRFS that the files are OK is probably not what you want.

cp does not copy subvolumes. Instead it copies them as directories. I don't know how you backed everything up, but it sounds like it did not backup your subvolumes. I recommend using btrfs-send and btrfs-receive to make backups.

As for your databases, given you formatted the source partition, I'd consider them gone, unfortunately.

TIP. If you're going to use BTRFS, reading the BTRFS wiki is a must. It's no ordinary filesystem. You must become intimate with it's functionality in order to use it effectively: https://btrfs.wiki.kernel.org/

  • I have moved dozens of partitions of times in the past without issue. This time was no scarier. Luckily, my most important data, is on other non btrfs file system that were untouched by this problem. It would be nice to have it back, but most of it can rebuilt, it will just take time I prefer not to spend on it if I don't have to. – cybernard Feb 25 at 22:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.