Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp21757689ybl; Mon, 6 Jan 2020 10:36:12 -0800 (PST) X-Google-Smtp-Source: APXvYqwVeKrIkjQvkTF2ZKPRck0ovNVYi9FePaXJ6LVYRSdARNA/0MZCKJnhhbn3AAcqzTWse32e X-Received: by 2002:a9d:65cb:: with SMTP id z11mr93731722oth.348.1578335772149; Mon, 06 Jan 2020 10:36:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578335772; cv=none; d=google.com; s=arc-20160816; b=iMfPWPWXXuhSK4/6sshdAOo+7GfCNxf1WOoi62o6h+J50YthYiJz6eSNDFCYmUvagF meUA6mOSanuPczalzU+O4gUquOM60QXZjkpMdUyIzgopE5G6u3EkaDm5CSy+Kadl/wMs G/h2dy7uNgbpcoMgbG5vpY4tMfo+T8dWanqLsLwu4wZRDwj2/On1tfhJktfuTjPvGkGZ GVuZwo4tu+Qi5mNu2aoV/gzqg+9ujBaORVKnzOSpfulb5O+SPrfbqSpEJu9g/i1zXSsz NR5me0xnDYqbwRfmZI/8pe9CoktwkP3tv/MDNwBIfZIA1cMI3xNrliBUAwCdxxlZ61VZ jcgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=KD4EwqBbNbxyAEAKkvgxo7bgQxbUFdfvBsdqcM353Uo=; b=TwiTodKou6OhTVe2y7soQC4H9Svb8KRyzqStmk8HWuQcLjJtmQk/GArNGeHFtNkisw Uj4knb1jRbOeNuJFfxCOgGHIDjncSC+4eera4x4UqQctzPN+YmqHlrJUadw0ErL2crAf 45keWUiBvbfZ8Ejum7Y3CmhpVEVRUpSoQKKvz1K/GHO3Kz0IckhLiZWSBNf3sBc1j86g cgo7BMcoYX0wDAlcdtNhat7rJBbrnBnCEHu7N2LTahlglLxykCq77p6v10ICEYul8XOO CF8nIinI2VoazvUO34g04UschrdkgLkvefUlGTwSjDz/jhAw1DEHjo1fhhAU//OpaYh0 oB/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=M76DJxGL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t23si36278276otk.304.2020.01.06.10.35.59; Mon, 06 Jan 2020 10:36:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=M76DJxGL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726700AbgAFSex (ORCPT + 99 others); Mon, 6 Jan 2020 13:34:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:51918 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726569AbgAFSew (ORCPT ); Mon, 6 Jan 2020 13:34:52 -0500 Received: from localhost (unknown [104.132.0.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BA7112072E; Mon, 6 Jan 2020 18:34:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578335691; bh=JntLi/yJ4cS9Fj9APMSIeBKJes+q3Xm+EQZItJCaOHk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=M76DJxGL5Awgyq2fvLv9+VPDjy3kmhrnKoXgIa9knVhOjKWnr4iqsgJwK48shJvJ0 KMavplXlMD0T899wAH2nlhEYqqtwalODpjq7Q5Y9ypTEFaGQyp8cW87Z0/WqxHxzMd Wo/XR6RGKdOI1Pfw44H/1p5Qpgt8l1cBasPJ+B/4= Date: Mon, 6 Jan 2020 10:34:50 -0800 From: Jaegeuk Kim To: Oleksandr Natalenko Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Chao Yu Subject: Re: Multidevice f2fs mount after disk rearrangement Message-ID: <20200106183450.GC50058@jaegeuk-macbookpro.roam.corp.google.com> References: <4c6cf8418236145f7124ac61eb2908ad@natalenko.name> <2c4cafd35d1595a62134203669d7c244@natalenko.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2c4cafd35d1595a62134203669d7c244@natalenko.name> User-Agent: Mutt/1.8.2 (2017-04-18) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/04, Oleksandr Natalenko wrote: > Hi. > > On 04.01.2020 17:29, Oleksandr Natalenko wrote: > > I was brave enough to create f2fs filesystem spanning through 2 > > physical device using this command: > > > > # mkfs.f2fs -t 0 /dev/sdc -c /dev/sdd > > > > It worked fine until I removed /dev/sdb from my system, so f2fs devices > > became: > > > > /dev/sdc -> /dev/sdb > > /dev/sdd -> /dev/sdc > > > > Now, when I try to mount it, I get the following: > > > > # mount -t f2fs /dev/sdb /mnt/fs > > mount: /mnt/fs: mount(2) system call failed: No such file or directory. > > > > In dmesg: > > > > [Jan 4 17:25] F2FS-fs (sdb): Mount Device [ 0]: /dev/sdc, > > 59063, 0 - 1cd6fff > > [ +0,000024] F2FS-fs (sdb): Failed to find devices > > > > fsck also fails with the following assertion: > > > > [ASSERT] (init_sb_info: 908) !strcmp((char *)sb->devs[i].path, (char > > *)c.devices[i].path) > > > > Am I doing something obviously stupid, and the device path can be > > (somehow) changed so that the mount succeeds, or this is unfixable, > > and f2fs relies on persistent device naming? > > > > Please suggest. > > > > Thank you. > > Erm, fine. I studied f2fs-tools code a little bit and discovered that > superblock indeed had /dev/sdX paths saved as strings. So I fired up hexedit > and just changed the superblock directly on the first device, substituting > sdc with sdb and sdd with sdc (I did it twice; I guess there are 2 copies of > superblock), and after this the mount worked. > > Am I really supposed to do this manually ;)? Thank you for investigating this ahead of me. :) Yes, the device list is stored in superblock, so hacking it manually should work. Let me think about a tool to tune that. Thanks, > > -- > Oleksandr Natalenko (post-factum)