Skip to contentSkip to conversation

"tune2fs -I 256" runtime---can it be interrupted safely?

DISCUSSION Michael B. Trausch 2 participants 5 messages Nov 1, 2008 – Nov 14, 2008

lore
Share & tools
lore
#0 lore raw

Hello,

I have a drive (a 250 GB external USB hard drive) which I wanted to convert to 256 byte inodes and start using as an ext4 drive (currently I use it as ext3). However, I started the tune2fs operation on 01 Nov 2008 02:27:34 -0400, and it is currently nearly 13 hours later, and the operation is _still_ going at 100% of one core and operating on the drive.

Three questions:

* Is this normal?
* How long can I expect this process to continue?
* Can it be (safely) interrupted if it will continue for a long time?

I converted my home directory to ext4 without issue and so I (stupidly, I admit) did not take a backup of this 250 GB drive's contents before I started the conversion process. Oops. Lesson learned. My thinking at this point is that it would take _far_ less time to interrupt, backup, and just use mkfs.ext4 on the drive and then restore (about 2 hours instead of an unknown quantity which is already nearing 13 hours).

Thanks,
Mike Trausch

Signature · 2 lines
My sigfile ran away and is on hiatus.
http://www.trausch.us/
#1 lore raw
Quoted 9 lines · On Sat, 1 Nov 2008 15:10:02 -0400 "Michael B. Trausch" <[email protected]> wrote:

I converted my home directory to ext4 without issue and so I (stupidly, I admit) did not take a backup of this 250 GB drive's contents before I started the conversion process. Oops. Lesson learned. My thinking at this point is that it would take _far_ less time to interrupt, backup, and just use mkfs.ext4 on the drive and then restore (about 2 hours instead of an unknown quantity which is already nearing 13 hours).

At 18:01:34 (after 15 hours and change) I decided to give it up and sent tune2fs a SIGINT. It happily aborted, and fsck appears to have fixed whatever inconsistencies were introduced during the tune2fs run and the files on the volume appear to be perfectly intact.

Am going to go the route of simply pulling the data off and using mkfs.ext4 to create a new filesystem on the device. But, I am still curious as to why this would run for so long. Some volume statistics, in case they may be of help in trying to determine why this process was running for so long; I don't even know how much longer it would have run for.

Stats from fsck:
651384 inodes used (4.27%)

     788 non-contiguous inodes (0.1%)
         # of inodes with ind/dind/tind blocks: 27974/1745/8

28464107 blocks used (46.62%)
0 bad blocks
14 large files

553474 regular files
90764 directories
0 character device files
0 block device files
0 fifos
3 links
7136 symbolic links (7093 fast symbolic links)
1 socket
--------
651378 files

Stats from dumpe2fs:

Filesystem volume name:   <none>
Last mounted on:          <not available>
Filesystem UUID:          95904edb-b501-4c3c-9bec-b9f046b04e3b
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal ext_attr resize_inode dir_index
filetype needs_recovery sparse_super large_file Filesystem
flags:         signed_directory_hash
Default mount options:    (none)
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              15269888
Block count:              61049596
Reserved block count:     3052479
Free blocks:              32585489
Free inodes:              14618504
First block:              0
Block size:               4096
Fragment size:            4096
Reserved GDT blocks:      1009
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         8192
Inode blocks per group:   256
Filesystem created:       Mon Jul  7 23:09:06 2008
Last mount time:          Sat Nov  1 18:20:45 2008
Last write time:          Sat Nov  1 18:20:45 2008
Mount count:              1
Maximum mount count:      27
Last checked:             Sat Nov  1 18:18:24 2008
Check interval:           15552000 (6 months)
Next check after:         Thu Apr 30 18:18:24 2009
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:               128
Journal inode:            8
Default directory hash:   tea
Directory Hash Seed:      52aba0f3-6da7-4e1a-b4b3-e8c51e8168fc
Journal backup:           inode blocks
Journal size:             128M
	--- Mike
Signature · 2 lines
My sigfile ran away and is on hiatus.
http://www.trausch.us/
#2 lore raw
Quoted 10 lines · Michael B. Trausch
Quoted 7 lines · On Sat, 1 Nov 2008 15:10:02 -0400 "Michael B. Trausch" <[email protected]> wrote:

I converted my home directory to ext4 without issue and so I (stupidly, I admit) did not take a backup of this 250 GB drive's contents before I started the conversion process. Oops. Lesson learned. My thinking at this point is that it would take _far_ less time to interrupt, backup, and just use mkfs.ext4 on the drive and then restore (about 2 hours instead of an unknown quantity which is already nearing 13 hours).

Quoted 4 lines

At 18:01:34 (after 15 hours and change) I decided to give it up and sent tune2fs a SIGINT. It happily aborted, and fsck appears to have fixed whatever inconsistencies were introduced during the tune2fs run and the files on the volume appear to be perfectly intact.

That is good news. I would have worried that interrupting this operation isn't very safe, because it is moving some core filesystem data around.

Quoted 8 lines

Am going to go the route of simply pulling the data off and using mkfs.ext4 to create a new filesystem on the device. But, I am still curious as to why this would run for so long. Some volume statistics, in case they may be of help in trying to determine why this process was running for so long; I don't even know how much longer it would have run for.

Inode size: 128

It looks like it did not finish the inode resize operation, for whatever reason.

If you have time, after the backup is done could you please re-try the "tune2fs -I 256" operation and let it go for a while, then "ltrace -p {pid}" on the process from another window to see what it is doing (if anything). You may need to have the "e2fsprogs-debuginfo" RPM installed to get useful data there.

After grabbing some of the data with ltrace, also run "strace -p {pid}" to get disk IO information, and finally "gdb -p {pid}" and grab a stack trace with "bt", let it continue for a few seconds with "c", and then CTRL-C again and grab another stack trace with "bt".

I'm assuming the code shouldn't actually have taken 13h to complete, but is instead confused about something in the filesystem and is looping.

Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.

#3 lore raw
Quoted 10 lines · On Fri, 07 Nov 2008 14:16:43 -0700 Andreas Dilger <[email protected]> wrote:

If you have time, after the backup is done could you please re-try the "tune2fs -I 256" operation and let it go for a while, then "ltrace -p {pid}" on the process from another window to see what it is doing (if anything). You may need to have the "e2fsprogs-debuginfo" RPM installed to get useful data there.

After grabbing some of the data with ltrace, also run "strace -p {pid}" to get disk IO information, and finally "gdb -p {pid}" and grab a stack trace with "bt", let it continue for a few seconds with "c", and then CTRL-C again and grab another stack trace with "bt".

Ugh, I forgot to do the gdb backtraces. *headdesk* I will do another run with them later.

I do have an ltrace up and online at:

http://fd0man.theunixplace.com/tune2fs.ltrace.bz2

The bzip2 file is 44 MB, and the uncompressed text is _huge_ (about 3 GB). This is a two hour run of "tune2fs -I 256 /dev/sdb" on an external 250 GB (235 GiB) drive formatted with the ext3 filesystem. I aborted the tune2fs run after 2 hours, though I am sure it would have run for far longer. Hopefully, this will give some insight as to what the problem might be.

I _was_ hoping that it would make a difference in runtime that the filesystem was empty (I did this right after "mkfs.ext3 -I 128 /dev/sdb"), but it was still going very slowly...

	--- Mike
Signature · 2 lines
My sigfile ran away and is on hiatus.
http://www.trausch.us/
#4 lore raw
Quoted 10 lines · Michael B. Trausch

I do have an ltrace up and online at:

http://fd0man.theunixplace.com/tune2fs.ltrace.bz2

The bzip2 file is 44 MB, and the uncompressed text is _huge_ (about 3 GB). This is a two hour run of "tune2fs -I 256 /dev/sdb" on an external 250 GB (235 GiB) drive formatted with the ext3 filesystem. I aborted the tune2fs run after 2 hours, though I am sure it would have run for far longer. Hopefully, this will give some insight as to what the problem might be.

It looks like the code is just spending hours looking at the bitmaps, but I have no idea why:

ext2fs_test_generic_bitmap(0x1f3d020, 0xfa31e1, 1, 0, 0x1f418b0) = 0 ext2fs_test_generic_bitmap(0x1f3d020, 0xfa31e2, 2, 1, 0x1f418b0) = 0 ext2fs_test_generic_bitmap(0x1f3d020, 0xfa31e3, 4, 2, 0x1f418b0) = 0 ext2fs_test_generic_bitmap(0x1f3d020, 0xfa31e4, 8, 3, 0x1f418b0) = 0 ext2fs_test_generic_bitmap(0x1f3d020, 0xfa31e5, 16, 4, 0x1f418b0) = 0 ext2fs_test_generic_bitmap(0x1f3d020, 0xfa31e6, 32, 5, 0x1f418b0) = 0 ext2fs_test_generic_bitmap(0x1f3d020, 0xfa31e7, 64, 6, 0x1f418b0) = 0 ext2fs_test_generic_bitmap(0x1f3d020, 0xfa31e8, 128, 7, 0x1f418b0) = 0

Possibly the code is very inefficient and is scanning every bit in the bitmap individually to see if an inode is in use, instead of doing something fast like just checking an entire bitmap word == 0 and skipping it.

Unfortunately, ltrace doesn't show what is calling this code, so a stack trace is needed from GDB.

Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.