All of lore.kernel.org
 help / color / mirror / Atom feed
From: beroal <me@beroal.in.ua>
To: linux-f2fs-devel@lists.sourceforge.net
Subject: [f2fs-dev] f2fs.resize makes errors in FS
Date: Fri, 19 Mar 2021 23:24:05 +0200	[thread overview]
Message-ID: <55a201bb-5314-d3c9-cb0c-6420c3aa9f57@beroal.in.ua> (raw)

Hi. I am trying to use a new function to reduce the size of an F2FS file 
system. After resizing, `fsck.f2fs` gives a lot of errors. Here is a 
shell script that creates and resizes a dummy file system:

```
#!/bin/sh
set -e
F=/tmp/img
D=/dev/loop0
M=/root/mnt/temp
dd bs=1M count=256 if=/dev/zero "of=$F"
losetup "$D" "$F"
mkfs.f2fs "$D"
fsck.f2fs "$D"
mount "$D" "$M"
dd bs=1M count=64 
if=/mnt/data/external/misc/movie/Idiocracy.2006.WEB-DL.1080p-ylnian.mkv 
of="${M}/a.mkv"
umount "$M"
resize.f2fs -s -t 262144 "$D"
fsck.f2fs "$D"
losetup -d "$D"
```

```
+ set -e
+ F=/tmp/img
+ D=/dev/loop0
+ M=/root/mnt/temp
+ dd bs=1M count=256 if=/dev/zero of=/tmp/img
256+0 records in
256+0 records out
268435456 bytes (268 MB, 256 MiB) copied, 0.0867954 s, 3.1 GB/s
+ losetup /dev/loop0 /tmp/img
+ mkfs.f2fs /dev/loop0

     F2FS-tools: mkfs.f2fs Ver: 1.14.0 (2020-08-24)

Info: Disable heap-based policy
Info: Debug level = 0
Info: Trim is enabled
Info: Segments per section = 1
Info: Sections per zone = 1
Info: sector size = 512
Info: total sectors = 524288 (256 MB)
Info: zone aligned segment0 blkaddr: 512
Info: format version with
   "Linux version 5.11.7-arch1-1 (linux@archlinux) (gcc (GCC) 10.2.0, 
GNU ld (GNU Binutils) 2.36.1) #1 SMP PREEMPT Wed, 17 Mar 2021 16:59:58 
+0000"
Info: [/dev/loop0] Discarding device
Info: This device doesn't support BLKSECDISCARD
Info: Discarded 256 MB
Info: Overprovision ratio = 15.000%
Info: Overprovision segments = 35 (GC reserved = 21)
Info: format successful
+ fsck.f2fs /dev/loop0
Info: Segments per section = 1
Info: Sections per zone = 1
Info: sector size = 512
Info: total sectors = 524288 (256 MB)
Info: MKFS version
   "Linux version 5.11.7-arch1-1 (linux@archlinux) (gcc (GCC) 10.2.0, 
GNU ld (GNU Binutils) 2.36.1) #1 SMP PREEMPT Wed, 17 Mar 2021 16:59:58 
+0000"
Info: FSCK version
   from "Linux version 5.11.7-arch1-1 (linux@archlinux) (gcc (GCC) 
10.2.0, GNU ld (GNU Binutils) 2.36.1) #1 SMP PREEMPT Wed, 17 Mar 2021 
16:59:58 +0000"
     to "Linux version 5.11.7-arch1-1 (linux@archlinux) (gcc (GCC) 
10.2.0, GNU ld (GNU Binutils) 2.36.1) #1 SMP PREEMPT Wed, 17 Mar 2021 
16:59:58 +0000"
Info: superblock features = 0 :
Info: superblock encrypt level = 0, salt = 00000000000000000000000000000000
Info: total FS sectors = 524288 (256 MB)
Info: CKPT version = 8aa0d85
Info: Checked valid nat_bits in checkpoint
Info: checkpoint state = 185 :  trimmed nat_bits compacted_summary unmount

[FSCK] Unreachable nat entries                        [Ok..] [0x0]
[FSCK] SIT valid block bitmap checking                [Ok..]
[FSCK] Hard link checking for regular file            [Ok..] [0x0]
[FSCK] valid_block_count matching with CP             [Ok..] [0x2]
[FSCK] valid_node_count matching with CP (de lookup)  [Ok..] [0x1]
[FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [0x1]
[FSCK] valid_inode_count matched with CP              [Ok..] [0x1]
[FSCK] free segment_count matched with CP             [Ok..] [0x72]
[FSCK] next block offset is free                      [Ok..]
[FSCK] fixing SIT types
[FSCK] other corrupted bugs                           [Ok..]

Done: 0.068899 secs
+ mount /dev/loop0 /root/mnt/temp
+ dd bs=1M count=64 
if=/mnt/data/external/misc/movie/Idiocracy.2006.WEB-DL.1080p-ylnian.mkv 
of=/root/mnt/temp/a.mkv
64+0 records in
64+0 records out
67108864 bytes (67 MB, 64 MiB) copied, 0.0286261 s, 2.3 GB/s
+ umount /root/mnt/temp
+ resize.f2fs -s -t 262144 /dev/loop0
Info: Segments per section = 1
Info: Sections per zone = 1
Info: sector size = 512
Info: total sectors = 524288 (256 MB)
Info: MKFS version
   "Linux version 5.11.7-arch1-1 (linux@archlinux) (gcc (GCC) 10.2.0, 
GNU ld (GNU Binutils) 2.36.1) #1 SMP PREEMPT Wed, 17 Mar 2021 16:59:58 
+0000"
Info: FSCK version
   from "Linux version 5.11.7-arch1-1 (linux@archlinux) (gcc (GCC) 
10.2.0, GNU ld (GNU Binutils) 2.36.1) #1 SMP PREEMPT Wed, 17 Mar 2021 
16:59:58 +0000"
     to "Linux version 5.11.7-arch1-1 (linux@archlinux) (gcc (GCC) 
10.2.0, GNU ld (GNU Binutils) 2.36.1) #1 SMP PREEMPT Wed, 17 Mar 2021 
16:59:58 +0000"
Info: superblock features = 0 :
Info: superblock encrypt level = 0, salt = 00000000000000000000000000000000
Info: total FS sectors = 524288 (256 MB)
Info: CKPT version = 8aa0d89
Info: Duplicate valid checkpoint to mirror position 512 -> 1024
Info: Write valid nat_bits in checkpoint
[FIX] (move_one_curseg_info:2798)  --> Move curseg[0] 3 -> 37 after 8000

[FIX] (move_one_curseg_info:2798)  --> Move curseg[1] 3b -> 36 after 8000

[FIX] (move_one_curseg_info:2798)  --> Move curseg[2] 24 -> 35 after 8000

[FIX] (move_one_curseg_info:2798)  --> Move curseg[3] 0 -> 34 after 8000

[FIX] (move_one_curseg_info:2798)  --> Move curseg[4] 1 -> 33 after 8000

[FIX] (move_one_curseg_info:2798)  --> Move curseg[5] 2 -> 32 after 8000

Info: Write valid nat_bits in checkpoint
Try to do defragement: Done
[update_superblock: 695] Info: Done to update superblock
Info: Write valid nat_bits in checkpoint
[rebuild_checkpoint: 585] Info: Done to rebuild checkpoint blocks

Done: 0.065604 secs
+ fsck.f2fs /dev/loop0
Info: Segments per section = 1
Info: Sections per zone = 1
Info: sector size = 512
Info: total sectors = 524288 (256 MB)
Info: MKFS version
   "Linux version 5.11.7-arch1-1 (linux@archlinux) (gcc (GCC) 10.2.0, 
GNU ld (GNU Binutils) 2.36.1) #1 SMP PREEMPT Wed, 17 Mar 2021 16:59:58 
+0000"
Info: FSCK version
   from "Linux version 5.11.7-arch1-1 (linux@archlinux) (gcc (GCC) 
10.2.0, GNU ld (GNU Binutils) 2.36.1) #1 SMP PREEMPT Wed, 17 Mar 2021 
16:59:58 +0000"
     to "Linux version 5.11.7-arch1-1 (linux@archlinux) (gcc (GCC) 
10.2.0, GNU ld (GNU Binutils) 2.36.1) #1 SMP PREEMPT Wed, 17 Mar 2021 
16:59:58 +0000"
Info: superblock features = 0 :
Info: superblock encrypt level = 0, salt = 00000000000000000000000000000000
Info: total FS sectors = 262144 (128 MB)
     Invalid CP CRC offset: 0
Info: CKPT version = 8aa0d8a
Info: Checked valid nat_bits in checkpoint
Info: checkpoint state = 181 :  trimmed nat_bits unmount
[ASSERT] (fsck_chk_curseg_info:2958)  --> Incorrect curseg [1]: segno 
[0x36] type(SIT) [0]
[ASSERT] (fsck_chk_curseg_info:2958)  --> Incorrect curseg [2]: segno 
[0x35] type(SIT) [0]
[ASSERT] (fsck_chk_curseg_info:2958)  --> Incorrect curseg [3]: segno 
[0x34] type(SIT) [0]
[ASSERT] (fsck_chk_curseg_info:2958)  --> Incorrect curseg [4]: segno 
[0x33] type(SIT) [0]
[ASSERT] (fsck_chk_curseg_info:2958)  --> Incorrect curseg [5]: segno 
[0x32] type(SIT) [0]
[ASSERT] (sanity_check_nid: 480)  --> SIT bitmap is 0x0. blk_addr[0x1002]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x1601]
[ASSERT] (sanity_check_nid: 480)  --> SIT bitmap is 0x0. blk_addr[0x1211]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a00]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a01]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a02]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a03]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a04]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a05]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a06]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a07]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a08]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a09]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a0a]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a0b]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a0c]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a0d]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a0e]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a0f]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a10]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a11]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a12]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a13]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a14]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a15]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a16]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a17]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a18]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a19]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a1a]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a1b]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a1c]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a1d]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a1e]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a1f]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a20]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a21]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a22]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a23]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a24]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a25]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a26]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a27]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a28]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a29]
[ASSERT] (fsck_chk_data_blk:1716)  --> SIT bitmap is 0x0. blk_addr[0x4a2a]
{{{skipped}}}
```

The whole output is huge.



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

             reply	other threads:[~2021-03-19 21:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-19 21:24 beroal [this message]
2021-03-27 13:26 ` [f2fs-dev] f2fs.resize makes errors in FS beroal
2021-03-29  1:51   ` Chao Yu
2021-04-02  7:23     ` Chao Yu
2021-04-02  9:28       ` beroal
2021-04-02 10:30         ` Chao Yu
2021-04-06  1:44         ` Chao Yu
2021-04-12 15:40           ` beroal
2021-04-13  1:25             ` Chao Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55a201bb-5314-d3c9-cb0c-6420c3aa9f57@beroal.in.ua \
    --to=me@beroal.in.ua \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.