Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect command (suspicion) #22

Open
mxshooter opened this issue Jan 17, 2019 · 4 comments
Open

Incorrect command (suspicion) #22

mxshooter opened this issue Jan 17, 2019 · 4 comments

Comments

@mxshooter
Copy link

CLEANUP_1="'$CMD_rm' -f '$LOOP_FILE'"

On openSUSE Tumbleweed convertation hangs at this part of code:

srv:/ # lsof /home
srv:/ # fstransform /dev/sda4 ext4
fstransform: starting version 0.9.3, checking environment
fstransform: checking for which... '/usr/bin/which'
fstransform: checking for expr... '/usr/bin/expr'
fstransform: checking for id... '/usr/bin/id'
fstransform: parsing command line arguments
fstransform: checking for stat... '/usr/bin/stat'
fstransform: checking for mkfifo... '/usr/bin/mkfifo'
fstransform: checking for blockdev... '/sbin/blockdev'
fstransform: checking for losetup... '/sbin/losetup'
fstransform: checking for fsck... '/sbin/fsck'
fstransform: checking for mkfs... '/sbin/mkfs'
fstransform: checking for mount... '/usr/bin/mount'
fstransform: checking for umount... '/usr/bin/umount'
fstransform: checking for mkdir... '/usr/bin/mkdir'
fstransform: checking for rmdir... '/usr/bin/rmdir'
fstransform: checking for rm... '/usr/bin/rm'
fstransform: checking for dd... '/usr/bin/dd'
fstransform: checking for sync... '/usr/bin/sync'
fstransform: checking for fsmove... '/usr/sbin/fsmove'
fstransform: checking for fsremap... '/usr/sbin/fsremap'
fstransform: checking for fsck(source file-system)... '/sbin/fsck'
fstransform: checking for fsck(target file-system)... '/sbin/fsck'
fstransform: looking for optional commands
fstransform: checking for sleep... '/usr/bin/sleep'
fstransform: checking for date... '/usr/bin/date'
14:48:03 fstransform: environment check passed.
14:48:03 fstransform: saving output of this execution into /var/tmp/fstransform/fstransform.log.6868
14:48:03 fstransform: preparing to transform device '/dev/sda4' to file-system type 'ext4'
14:48:03 fstransform: device is mounted at '/home' with file-system type 'xfs'
14:48:03 fstransform: device raw size = 194209906688 bytes
14:48:03 fstransform: creating sparse loop file '/home/.fstransform.loop.6868' inside device '/dev/sda4'...
14:48:03 dd: 1+0 records in
14:48:03 dd: 1+0 records out
14:48:03 dd: 1 byte copied, 0.000159346 s, 6.3 kB/s
^Csrv:/ # stat -c %o /home/.fstransform.loop.6868
4096
srv:/ #

@cosmos72
Copy link
Owner

cosmos72 commented Jan 17, 2019

depending on the partition size (180 GB in your case, not huge by current standards) and the disk speed, fstransform can be quite slow.

When it seems stuck, can you open another terminal (with the same user) and run the command

ps -fuwww

to find out which program started by fstransform is stuck or taking a long time?

If I remember correctly, in your case the next step after the logs you reported is to format the 180GB sparse file /home/.fstransform.loop.6868 as ext4.

@mxshooter
Copy link
Author

Thank you for answer. Output of command:

...
23:34:35 fstransform: environment check passed.
23:34:35 fstransform: saving output of this execution into /var/tmp/fstransform/fstransform.log.10859
23:34:35 fstransform: preparing to transform device '/dev/sda4' to file-system type 'ext4'
23:34:35 fstransform: device is mounted at '/home' with file-system type 'xfs'
23:34:35 fstransform: device raw size = 194209906688 bytes
         
23:34:35 fstransform: WARNING: possibly stale fstransform loop files found inside device '/dev/sda4',
                      maybe they can be removed? list of files found:
                      
                      /home/.fstransform.loop.6868
                      
23:34:35 fstransform: creating sparse loop file '/home/.fstransform.loop.10859' inside device '/dev/sda4'...
23:34:35 dd: 1+0 records in
23:34:35 dd: 1+0 records out
23:34:35 dd: 1 byte copied, 0.000428479 s, 2.3 kB/s

... stuck, another session:
srv:~ # ps -fuwww
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root     16184  0.0  0.0  38212  3600 pts/0    S    Jan16   0:00 su -l root
root     16185  0.0  0.1  15128  3964 pts/0    S    Jan16   0:00  \_ -bash
root     16279  0.0  0.0  27392  3376 pts/0    S+   Jan16   0:00      \_ screen -r
root      9067  0.0  0.1  13688  5732 pts/2    Ss+  Jan16   0:00 /bin/bash
root      9577  0.0  0.1  38212  4748 pts/4    S    23:24   0:00 su -l root
root      9578  0.0  0.2  15128  8996 pts/4    S    23:24   0:00  \_ -bash
root     10859  0.1  0.0   4980  2044 pts/4    S+   23:34   0:00      \_ /bin/dash /usr/sbin/fstransform /dev/sda4 ext4
root     10930  0.0  0.0   4980  1508 pts/4    S+   23:34   0:00          \_ /bin/dash /usr/sbin/fstransform /dev/sda4 ext4
root     10938  0.1  0.1  38212  4804 pts/1    S    23:34   0:00 su -l root
root     10939  1.0  0.2  15128  9124 pts/1    S    23:34   0:00  \_ -bash
root     11111  100  0.1  19932  3836 pts/1    R+   23:35   0:00      \_ ps -fuwww
root      1764  0.0  0.0   4932   632 tty1     Ss+  Jan09   0:00 /sbin/agetty -o -p -- \u --noclear tty1 linux
srv:~ #

At this page there is strings in output after "dd: 1 byte copied":
14:17:07 fstransform: device file-system block size = 4096 bytes
14:17:07 fstransform: device usable size = 219042914304 bytes

Part of code with this text follows line 1114. Thinked about wrong stat output, but in another terminal it works:
srv:~ # stat -c %o /home/.fstransform.loop.10859
4096

@cosmos72
Copy link
Owner

cosmos72 commented Jan 20, 2019

This is strange.
fstransform looks stuck in a subshell, but there is no command currently running.

Can you try to add the line

set -x

near the top of the fstransform script - for example immediately after the line

PROG=fstransform

and run it again?
It will print every command before executing it, and it should help pinpointing the exact problem.

@mxshooter
Copy link
Author

Ok, output:

...
+ test /usr/bin/date !=
+ /usr/bin/date +%Y-%m-%d %H:%M:%S
+ echo -n 2019-01-21 12:44:40
+ echo fstransform: creating sparse loop file '/home/.fstransform.loop.17091' inside device '/dev/sda4'...
+ test -e /home/.fstransform.loop.17091
+ exec_cmd_noquit /usr/bin/dd if=/dev/zero of=/home/.fstransform.loop.17091 bs=1 count=1
+ read_cmd_out /usr/bin/dd
+ read_cmd_out_err /usr/bin/dd /tmp/fstransform.out.17091
+ local my_cmd_full=/usr/bin/dd
+ /usr/bin/expr match /usr/bin/dd .*/\([^/]*\)
+ local my_cmd=dd
+ test dd =
+ local my_fifo=/tmp/fstransform.out.17091
+ local my_prefix=
+ local my_out_1= my_out=
+ + read/usr/bin/dd if=/dev/zero of=/home/.fstransform.loop.17091 bs=1 my_out_1 my_out
 count=1
+ test 1+0 = dd:
+ test 1+0 = /usr/bin/dd:
+ log_info_4_cmd dd: 1+0 records in
+ log_tty_timestamp
+ test yes = yes -a /usr/bin/date !=
+ /usr/bin/date +%H:%M:%S
+ echo -n 12:44:40
12:44:40 + echo dd: 1+0 records in
dd: 1+0 records in
+ log_file_info_4_cmd dd: 1+0 records in
+ log_file_timestamp
+ test /usr/bin/date !=
+ /usr/bin/date +%Y-%m-%d %H:%M:%S
+ echo -n 2019-01-21 12:44:40
+ echo dd: 1+0 records in
+ read my_out_1 my_out
+ test 1+0 = dd:
+ test 1+0 = /usr/bin/dd:
+ log_info_4_cmd dd: 1+0 records out
+ log_tty_timestamp
+ test yes = yes -a /usr/bin/date !=
+ /usr/bin/date +%H:%M:%S
+ echo -n 12:44:40
12:44:40 + echo dd: 1+0 records out
dd: 1+0 records out
+ log_file_info_4_cmd dd: 1+0 records out
+ log_file_timestamp
+ test /usr/bin/date !=
+ /usr/bin/date +%Y-%m-%d %H:%M:%S
+ echo -n 2019-01-21 12:44:40
+ echo dd: 1+0 records out
+ read my_out_1 my_out
+ test 1 = dd:
+ test 1 = /usr/bin/dd:
+ log_info_4_cmd dd: 1 byte copied, 0.000350599 s, 2.9 kB/s
+ log_tty_timestamp
+ test yes = yes -a /usr/bin/date !=
+ /usr/bin/date +%H:%M:%S
+ echo -n 12:44:40
12:44:40 + echo dd: 1 byte copied, 0.000350599 s, 2.9 kB/s
dd: 1 byte copied, 0.000350599 s, 2.9 kB/s
+ log_file_info_4_cmd dd: 1 byte copied, 0.000350599 s, 2.9 kB/s
+ log_file_timestamp
+ test /usr/bin/date !=
+ /usr/bin/date +%Y-%m-%d %H:%M:%S
+ echo -n 2019-01-21 12:44:40
+ echo dd: 1 byte copied, 0.000350599 s, 2.9 kB/s
+ read my_out_1 my_out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants