LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Broken drive partitions after resize and move with kde partition manager (https://www.linuxquestions.org/questions/linux-software-2/broken-drive-partitions-after-resize-and-move-with-kde-partition-manager-4175719969/)

fkwilczek 12-19-2022 01:58 PM

Broken drive partitions after resize and move with kde partition manager
 
I broke my btrfs partition after moving and resizing it with kde partition manager. I tried to move my partition and shrink it. This process was uninterrupted. I tried fixing partitions using testdisk but it failed.

Code:

Disk /dev/nvme0n1 - 2000 GB / 1863 GiB - CHS 1907729 64 32

The harddisk (2000 GB / 1863 GiB) seems too small! (< 2167 GB / 2019 GiB)
Check the harddisk size: HD jumper settings, BIOS detection...

The following partition can't be recovered:
    Partition              Start        End    Size in sectors
>  Linux filesys. data    330485632 4234186623 3903700992 [fedora_localhost-live]

[ Continue ]
btrfs blocksize=4096 Backup superblock, 1998 GB / 1861 GiB

Repairing by using btrfs also failed.
However when i tried using photorec i was able to recover uncorrupted files.
Is it possible to recover my btrfs partition?

lsblk command:
Code:

[root@localhost-live liveuser]# lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
loop0        7:0    0  2.1G  1 loop
loop1        7:1    0  7.3G  1 loop
├─live-rw  253:0    0  7.3G  0 dm  /
└─live-base 253:1    0  7.3G  1 dm 
loop2        7:2    0    32G  0 loop
└─live-rw  253:0    0  7.3G  0 dm  /
sda          8:0    1  7.6G  0 disk
├─sda1        8:1    1  2.2G  0 part /run/initramfs/live
├─sda2        8:2    1  9.9M  0 part
└─sda3        8:3    1  300K  0 part
zram0      252:0    0    8G  0 disk [SWAP]
nvme0n1    259:0    0  1.8T  0 disk
└─nvme0n1p3 259:4    0  1.8T  0 part
nvme1n1    259:2    0 476.9G  0 disk
└─nvme1n1p1 259:1    0 476.9G  0 part /run/media/liveuser/7b9cdf1f-7d32-477e-bb6a-0aaffbde72b3


mrmazda 12-19-2022 06:47 PM

Quote:

Originally Posted by fkwilczek (Post 6398988)
Is it possible to recover my btrfs partition?

I seriously doubt it. Managing BTRFS's multiple devices requires unique care. Did you read any instructions before opening the KDE partitioner? Try reading these and see what you think.

syg00 12-19-2022 08:13 PM

I too would vote no (without having tried). I'm surprised something as mature as KDE would let you even try.

I have long been a proponent of btrfs, but I never use it for my root filesystem - I manage backup/restore for that myself. For data, I find snapshot irreplacable.

computersavvy 12-19-2022 08:38 PM

BTRFS is not nearly as mature as most other file systems used on linux. Most users are not familiar with management and tools that work well on other file systems often work poorly or not at all with btrfs.

As stated above, I still use LVM and EXT4 for my file systems since that technology is mature and stable. Maybe when btrfs has matured more I will consider it but so far I avoid it like the plague for my critical machines.

fkwilczek 12-19-2022 10:07 PM

My problem is that I need help with data recovery.

syg00 12-20-2022 01:19 AM

I would think you should consider yourself fortunate to have managed to recover what you have since btrfs isn't specifically listed as supported by photorec.
If testdisk can't help with the partition recovery, I'd reckon your chances using FOSS tools are diminishingly small.

colorpurple21859 12-21-2022 05:30 AM

Maybe recreating the original btrfs partitions with fdisk and run btrfs-scan and btrfs-check on the partitions will allow recovering of data.

computersavvy 12-21-2022 10:03 AM

Quote:

Originally Posted by colorpurple21859 (Post 6399338)
Maybe recreating the original btrfs partitions with fdisk and run btrfs-scan and btrfs-check on the partitions will allow recovering of data.

This may or may not work since btrfs normally is used with a volume in the partition and subvolumes within the file system (root volume) on that partition.


The fact that the OP was able to recover files is good and I would rather suggest that he reinstall; then in the future never use tools that are not designed for btrfs on a btrfs file system.

colorpurple21859 12-21-2022 12:23 PM

Quote:

This may or may not work
I agree it is a shot in the dark.

fkwilczek 12-22-2022 02:24 PM

I gave up on trying to recover partition and I reinstalled system. But I still have img of drive so I'm open for ideas.

computersavvy 12-22-2022 02:39 PM

Quote:

Originally Posted by fkwilczek (Post 6399682)
I gave up on trying to recover partition and I reinstalled system. But I still have img of drive so I'm open for ideas.

Try different things and if something works then let us know what happened. :thumbsup:


All times are GMT -5. The time now is 05:56 AM.