All of lore.kernel.org
 help / color / mirror / Atom feed
* btrfs restore
@ 2014-08-21  5:52 Mihail Zaporozhets
  2014-08-22  1:52 ` Marc MERLIN
  0 siblings, 1 reply; 4+ messages in thread
From: Mihail Zaporozhets @ 2014-08-21  5:52 UTC (permalink / raw)
  To: linux-btrfs

Hello,
I'm create btrfs multi-device volume: (2TB * 5disks)
1. one device was converted from ext3, 
then delete sub-volume 'ext2'; 
2. 'btrfs device add /dev/sd* /mnt/sdc1'; 
and some times again,  Every disk adds by one, then move data from other
disks. 2 times was running 'btrfs fi defrag -r -v -t 700K /mnt/sdc1; btrfs
balance start /mnt/sdc1; btrfs scrub start /mnt/sdc1'. Finally I have FS at
5 devices.

After, go to reboot pc, and I seen that 1 drive have no any partition. I'm
full of sadness. I think that device was not correctly unmounted and one
disk fail.
mount -t btrfs -o degreded,ro,recovery,nospace_cache ...
mount -t btrfs -o recovery,nospace_cache ...
btrfs-find-root, btrfs-zero-log .. 

Finaly:
btrfs restore -t 10404875644928 -v -i /dev/sda1 /mnt/uh1/eric/ - 
Success! but some directory is absent; 3.4 TB restored, but 4 (available
disks)*1.82 Tb = 7.28 TB; and 7.28-3.4 = about 3.8 TB which is missing .
Where is it ? How can i get it back? 

How can i try to restore more data? 

Please advice.

_____
mount -t btrfs -o degraded,ro,recovery,nospace_cache /dev/sda1 /mnt/tmp3;
dmesg | tail

[11774.958996] BTRFS info (device sde1): allowing degraded mounts
[11774.959001] BTRFS info (device sde1): enabling auto recovery
[11774.959003] BTRFS info (device sde1): disabling disk space caching
[11774.959955] BTRFS warning (device sde1): devid 5 missing
[11774.986391] BTRFS: failed to read tree root on sde1
[11774.986408] BTRFS: failed to read tree root on sde1
[11774.986456] BTRFS: failed to read tree root on sde1
[11774.986473] BTRFS: failed to read tree root on sde1
[11774.986481] BTRFS: failed to read tree root on sde1
[11775.014471] BTRFS: open_ctree failed
    
# btrfs-zero-log /dev/sda1                         
warning devid 5 not found already
Check tree block failed, want=16845270495232, have=0
read block failed check_tree_block
Couldn't read tree root
______
# uname -a
Linux oit-875u 3.16.0-031600rc7-generic #201407271635 SMP Sun Jul 27
20:36:48 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
    # btrfs fi show                                         
Label: none  uuid: 841f1b5c-adb2-485f-a4cf-83bbf880dced
        Total devices 5 FS bytes used 9.09TiB
        devid    1 size 1.82TiB used 1.82TiB path /dev/sda1
        devid    2 size 1.82TiB used 1.82TiB path /dev/sdc1
        devid    3 size 1.82TiB used 1.82TiB path /dev/sdd1
        devid    4 size 1.82TiB used 1.82TiB path /dev/sde1
        *** Some devices missing

Btrfs v3.14.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: btrfs restore
  2014-08-21  5:52 btrfs restore Mihail Zaporozhets
@ 2014-08-22  1:52 ` Marc MERLIN
  2014-08-22  2:36   ` Marc MERLIN
  2014-08-22  8:39   ` Mihail Zaporozhets
  0 siblings, 2 replies; 4+ messages in thread
From: Marc MERLIN @ 2014-08-22  1:52 UTC (permalink / raw)
  To: Mihail Zaporozhets; +Cc: linux-btrfs

On Thu, Aug 21, 2014 at 05:52:01AM +0000, Mihail Zaporozhets wrote:
> # btrfs-zero-log /dev/sda1                         
> warning devid 5 not found already
> Check tree block failed, want=16845270495232, have=0
> read block failed check_tree_block
> Couldn't read tree root

You may be hitting the same problem I was a week back. See the thread
that says "btrfs-zero-log fails, can't mount FS"

Download the source for btrfs-progs, and apply this patch from Chris:

diff --git a/disk-io.c b/disk-io.c
index 8db0335..d9a8e19 100644
--- a/disk-io.c
+++ b/disk-io.c
@@ -911,13 +911,13 @@ int btrfs_setup_all_roots(struct btrfs_fs_info *fs_info, u64 root_tree_bytenr,
                        return -EIO;
        }
        fs_info->csum_root->track_dirty = 1;
-
+#if 0
        ret = find_and_setup_log_root(root, fs_info, sb);
        if (ret) {
                printk("Couldn't setup log root tree\n");
                return -EIO;
        }
-
+#endif
        fs_info->generation = generation;
        fs_info->last_trans_committed = generation;
        if (extent_buffer_uptodate(fs_info->extent_root->node) &&


Or if you're desparate and want a binary, I'll Email you one directly
(not that you should run a binary you got from someone via Email as
root, so it's only if you're desperate)

Marc
-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/                         | PGP 1024R/763BE901

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: btrfs restore
  2014-08-22  1:52 ` Marc MERLIN
@ 2014-08-22  2:36   ` Marc MERLIN
  2014-08-22  8:39   ` Mihail Zaporozhets
  1 sibling, 0 replies; 4+ messages in thread
From: Marc MERLIN @ 2014-08-22  2:36 UTC (permalink / raw)
  To: Mihail Zaporozhets; +Cc: linux-btrfs

I just created 
https://btrfs.wiki.kernel.org/index.php/Btrfs-zero-log

and added the info about this failure of btrfs-zero-log as well as the
patch from Chris.
Whenever it's in a new version of btrfs-zero-log, I or someone else can
update that wiki page to tell people to just update to a newer version
to get around this "Couldn't setup log root tree" problem.

However, re-reading your error message you got a different error, so the
patch isn't likely to work for you

read block failed check_tree_block 
is a warhing

Your actual error is
	if (!extent_buffer_uptodate(root->node)) {
		fprintf(stderr, "Couldn't read tree root\n");
		return -EIO;
	}

This looks more serious, and I'm not sure if btrfs-zero-log can help
with that.

I'll let someone else answer.

Marc


On Thu, Aug 21, 2014 at 06:52:16PM -0700, Marc MERLIN wrote:
> On Thu, Aug 21, 2014 at 05:52:01AM +0000, Mihail Zaporozhets wrote:
> > # btrfs-zero-log /dev/sda1                         
> > warning devid 5 not found already
> > Check tree block failed, want=16845270495232, have=0
> > read block failed check_tree_block
> > Couldn't read tree root
> 
> You may be hitting the same problem I was a week back. See the thread
> that says "btrfs-zero-log fails, can't mount FS"
> 
> Download the source for btrfs-progs, and apply this patch from Chris:
> 
> diff --git a/disk-io.c b/disk-io.c
> index 8db0335..d9a8e19 100644
> --- a/disk-io.c
> +++ b/disk-io.c
> @@ -911,13 +911,13 @@ int btrfs_setup_all_roots(struct btrfs_fs_info *fs_info, u64 root_tree_bytenr,
>                         return -EIO;
>         }
>         fs_info->csum_root->track_dirty = 1;
> -
> +#if 0
>         ret = find_and_setup_log_root(root, fs_info, sb);
>         if (ret) {
>                 printk("Couldn't setup log root tree\n");
>                 return -EIO;
>         }
> -
> +#endif
>         fs_info->generation = generation;
>         fs_info->last_trans_committed = generation;
>         if (extent_buffer_uptodate(fs_info->extent_root->node) &&
> 
> 
> Or if you're desparate and want a binary, I'll Email you one directly
> (not that you should run a binary you got from someone via Email as
> root, so it's only if you're desperate)
> 
> Marc
> -- 
> "A mouse is a device used to point at the xterm you want to type in" - A.S.R.
> Microsoft is to operating systems ....
>                                       .... what McDonalds is to gourmet cooking
> Home page: http://marc.merlins.org/                         | PGP 1024R/763BE901

-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/                         | PGP 1024R/763BE901

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: btrfs restore
  2014-08-22  1:52 ` Marc MERLIN
  2014-08-22  2:36   ` Marc MERLIN
@ 2014-08-22  8:39   ` Mihail Zaporozhets
  1 sibling, 0 replies; 4+ messages in thread
From: Mihail Zaporozhets @ 2014-08-22  8:39 UTC (permalink / raw)
  To: linux-btrfs

Marc MERLIN <marc <at> merlins.org> writes:

> 
> On Thu, Aug 21, 2014 at 05:52:01AM +0000, Mihail Zaporozhets wrote:
> > # btrfs-zero-log /dev/sda1                         
> > warning devid 5 not found already
> > Check tree block failed, want=16845270495232, have=0
> > read block failed check_tree_block
> > Couldn't read tree root
> 
> You may be hitting the same problem I was a week back. See the thread
> that says "btrfs-zero-log fails, can't mount FS"
> 
> Download the source for btrfs-progs, and apply this patch from Chris:
> 
> diff --git a/disk-io.c b/disk-io.c
> index 8db0335..d9a8e19 100644
> --- a/disk-io.c
> +++ b/disk-io.c
>  <at>  <at>  -911,13 +911,13  <at>  <at>  int btrfs_setup_all_roots(struct
btrfs_fs_info *fs_info, u64 root_tree_bytenr,
>                         return -EIO;
>         }
>         fs_info->csum_root->track_dirty = 1;
> -
> +#if 0
>         ret = find_and_setup_log_root(root, fs_info, sb);
>         if (ret) {
>                 printk("Couldn't setup log root tree\n");
>                 return -EIO;
>         }
> -
> +#endif
>         fs_info->generation = generation;
>         fs_info->last_trans_committed = generation;
>         if (extent_buffer_uptodate(fs_info->extent_root->node) &&
> 
> Or if you're desparate and want a binary, I'll Email you one directly
> (not that you should run a binary you got from someone via Email as
> root, so it's only if you're desperate)
> 
> Marc

Thanks for answers. 
ok,
git clone git://repo.or.cz/btrfs-progs-unstable/devel.git;
make;
Do I need to patch devel's version, or it contains this changes? if no:

sudo ./btrfs-zero-log /dev/sda1
warning devid 5 not found already
Check tree block failed, want=16845270495232, have=0
read block failed check_tree_block
Couldn't read tree root

sudo btrfs-debug-tree -R /dev/sda1              
warning devid 5 not found already
Check tree block failed, want=16845270495232, have=0
read block failed check_tree_block
Couldn't read tree root

sudo ./btrfs-show-super /dev/sda1
superblock: bytenr=65536, device=/dev/sda1
---------------------------------------------------------
csum			0x9867082d [match]
bytenr			65536
flags			0x1
magic			_BHRfS_M [match]
fsid			841f1b5c-adb2-485f-a4cf-83bbf880dced
label			
generation		59176
root			16845270495232
sys_array_size		97
chunk_root_generation	59166
root_level		2
chunk_root		11409648779264
chunk_root_level	2
log_root		0
log_root_transid	0
log_root_level		0
total_bytes		10001983041536
bytes_used		9997613580288
sectorsize		4096
nodesize		4096
leafsize		4096
stripesize		4096
root_dir		6
num_devices		5
compat_flags		0x0
compat_ro_flags		0x0
incompat_flags		0x1
csum_type		0
csum_size		4
cache_generation	59176
uuid_tree_generation	59176
dev_item.uuid		1ef01e06-b355-4a17-a2c8-5623188813f9
dev_item.fsid		841f1b5c-adb2-485f-a4cf-83bbf880dced [match]
dev_item.type		0
dev_item.total_bytes	2000397885440
dev_item.bytes_used	1999324119040
dev_item.io_align	4096
dev_item.io_width	4096
dev_item.sector_size	4096
dev_item.devid		1
dev_item.dev_group	0
dev_item.seek_speed	0
dev_item.bandwidth	0
dev_item.generation	0


./btrfs --version
Btrfs v3.14.2

last dmesg :
[110290.284290] show_signal_msg: 174 callbacks suppressed                  
                          
[110290.284294] btrfs-debug-tre[6014]: segfault at e0 ip 00000000004022b0 sp
00007fffcb77d1d0 error 4 in btrfs-debug-tree[400000+27000]            
[111278.465863] btrfs-debug-tre[10907]: segfault at e0 ip 00000000004022b0
sp 00007fff856c6bd0 error 4 in btrfs-debug-tree[400000+27000]


sudo ./btrfs rescue chunk-recover -v /dev/sda1    
All Devices:
	Device: id = 4, name = /dev/sde1
	Device: id = 3, name = /dev/sdd1
	Device: id = 2, name = /dev/sdc1
	Device: id = 1, name = /dev/sda1

still waiting....
 I started this before write to mail list, but, as i remember, my pc after
one night stay fully freeze,  and had no reaction for anyone keys, and I
just reboot it at that time.


Nothing changes until this moment...


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-08-22  8:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-21  5:52 btrfs restore Mihail Zaporozhets
2014-08-22  1:52 ` Marc MERLIN
2014-08-22  2:36   ` Marc MERLIN
2014-08-22  8:39   ` Mihail Zaporozhets

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.