Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp502010ybl; Wed, 8 Jan 2020 00:40:43 -0800 (PST) X-Google-Smtp-Source: APXvYqzIkFP8wd4mbdvDqIZ0SjL9+jpbNBav2rh+PDBq+xcJ5uN9NR+xtUp4ZZsdi+fB0fg6y1iy X-Received: by 2002:a9d:6183:: with SMTP id g3mr3320832otk.304.1578472843712; Wed, 08 Jan 2020 00:40:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578472843; cv=none; d=google.com; s=arc-20160816; b=1H1OgN2LFhBpAfixaBrBO1bphF1ffTRVTccbh52IYyJRpzA1B62xKAp/s4wuS/1E9I 519hvPtnP1QHIvvKY7JLlOofkYb2oL9yWF0gsBwt+gNwbrTGbyhW0mf0ne+r+xP3mTGo h97SLsYYbBW3whR7rYvQivDwnuoo5huZjDLtyOdA+ysVPMBYWjUi2PlYTKnNjutNnlUr FCDZJvQK8ozYDXOao6+rP9Dv6oxdy0wjhowPaqX9608pRHPUtEioMXxBm9bYj7kPxnHC QVG9XfgFha4nIBxDDVbkH3bcO1qR/Zp7Dcx6WakEXoW4tRWb8C8bZYp3FfjSatHlfXS2 8w4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=EQt1wxLyAU1s/L889vEzKzjJ+77ZF7YpKi/7oT1Eih0=; b=NliKDGayG6hhfbXg2l/f4OcvINjcQ6rThQ+xqTX0gffmVb11xdeIK3sjmNI3O+XQDW u8rmi6MGXXy7gNQMuh94qr9wgG8eSWp7Q2nj/bmTW3pOvLsMtGk33cdp8kzRIFL/IwtT HhniBoNISBLemhZ1J8xRCj7Pl3MTgEaieN6Fe+md0oAZHwf0mPKmPNuMlpfl3kS5kbaw eDM+6uwMovR1Tp/Flqs7H/9FeVC06Kz0FQuJ1sw4P3D794rB7PUoXcufj3qy0Ggk2ndH Ylu52Sv/jf4R9Ts/ZrRl8obQ3+ODX1XQauf8pGI0QdaKbQvtRnG3QZxueiTqMFplZtgE g8qg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u8si1431350otq.262.2020.01.08.00.40.31; Wed, 08 Jan 2020 00:40:43 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727415AbgAHIh6 (ORCPT + 99 others); Wed, 8 Jan 2020 03:37:58 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:8240 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726313AbgAHIh5 (ORCPT ); Wed, 8 Jan 2020 03:37:57 -0500 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 8F768DF273F778ADA5C4; Wed, 8 Jan 2020 16:37:54 +0800 (CST) Received: from [10.134.22.195] (10.134.22.195) by smtp.huawei.com (10.3.19.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 8 Jan 2020 16:37:53 +0800 Subject: Re: [f2fs-dev] Multidevice f2fs mount after disk rearrangement To: Jaegeuk Kim CC: Oleksandr Natalenko , , References: <4c6cf8418236145f7124ac61eb2908ad@natalenko.name> <2c4cafd35d1595a62134203669d7c244@natalenko.name> <20200106184017.GD50058@jaegeuk-macbookpro.roam.corp.google.com> From: Chao Yu Message-ID: <7cf85056-ef3f-b78c-e7cf-8cce5d5ef1ee@huawei.com> Date: Wed, 8 Jan 2020 16:37:52 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200106184017.GD50058@jaegeuk-macbookpro.roam.corp.google.com> Content-Type: text/plain; charset="windows-1252" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.134.22.195] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/1/7 2:40, Jaegeuk Kim wrote: > On 01/06, Chao Yu wrote: >> Hello, >> >> Thanks for the report. :) >> >> On 2020/1/5 5:52, Oleksandr Natalenko via Linux-f2fs-devel 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. >> >> Alright, it works if superblock checksum feature is off... >> >>> >>> Am I really supposed to do this manually ;)? >> >> We'd better add that ability in tune.f2fs. And I guess we need to let >> kernel/fsck to notice that case, and give hint to run tune.f2fs to >> reconfigure primary/secondary/... device paths. > > I'm thinking to add tunesb.f2fs to edit superblock explicitly, since it has > to edit it without getting superblock/checkpoint and other f2fs metadata. > > For example, > # tunesb.f2fs -c /dev/sdb -c /dev/sdc /dev/sda > .. superblock info .. > .. device list .. > .. hot/cold extensions .. > > Will modify the device list, if it's different from parameter. Looks good to me. Thanks, > >> >> Thanks, >> >>> > . >