Package: ddrutility
Version: 2.8-1.1
Severity: normal
X-Debbugs-Cc: bernha...@mailbox.org


Dear Maintainer,
I found on some attempts to use ddru_findbad are
failing for me like this:

    ...
    /usr/bin/ddru_findbad: 1027: arithmetic expression: expecting primary: " 
(300-/dev/loop0:) "

I used as a workaround a "export LANG=C" before using it.
Now I found some more time to report it.

The issue shows when package util-linux-locales is installed and
fdisk outputs something different than "Disk" in the column header.


A minimal improvement might be this:
/usr/bin/ddru_findbad:1027
-        $GFDISK -lu "$TARGET" | grep -a "$TARGET" | grep -a -v Disk > 
tempddrfdisk
+        LANG=C $GFDISK -lu "$TARGET" | grep -a "$TARGET" | grep -a -v Disk > 
tempddrfdisk


Kind regards,
Bernhard



-- System Information:
Debian Release: bullseye/sid
  APT prefers testing-security
  APT policy: (500, 'testing-security'), (500, 'testing-debug'), (500, 
'proposed-updates-debug'), (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.0-5-amd64 (SMP w/16 CPU threads)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages ddrutility depends on:
ii  fdisk      2.36.1-7
ii  libc6      2.31-11
ii  ntfs-3g    1:2017.3.23AR.3-4
ii  sleuthkit  4.10.1+dfsg-1

ddrutility recommends no packages.

ddrutility suggests no packages.

-- no debconf information
Thank you for using reportbug
# single-use Bullseye/testing amd64 qemu VM 2021-04-07

echo "set enable-bracketed-paste off" >> /etc/inputrc; bash

apt update
apt dist-upgrade

apt install mc gdb gddrescue ddrutility util-linux-locales fdisk-dbgsym
apt build-dep fdisk





mkdir /home/benutzer/source/fdisk/orig -p
cd    /home/benutzer/source/fdisk/orig
apt source fdisk
cd

mkdir /home/benutzer/source/glibc/orig -p
cd    /home/benutzer/source/glibc/orig
apt source glibc
cd





truncate --size=300M test.img

fdisk test.img
# create primary Linux partition

losetup -P /dev/loop0 test.img
mkfs.ext4 /dev/loop0p1
mount /dev/loop0p1 /mnt
dd if=/dev/zero of=/mnt/testfile bs=1M
umount /mnt
ddrescue /dev/loop0 ddrescue.img ddrescue.log
losetup -d /dev/loop0


cat <<EOF > ddrescue-fake.log
# Mapfile. Created by GNU ddrescue version 1.23
# Command line: ddrescue /dev/loop0 ddrescue.img ddrescue.log
# Start time:   2021-04-07 15:33:00
# Current time: 2021-04-07 15:33:01
# Finished
# current_pos  current_status  current_pass
0x12BF0000     +               1
#      pos        size  status
0x00000000  0x04860000  +
0x04860000  0x00004000  -
0x04864000  0x12C00000  +
EOF





bash
mkdir try1; cd try1
echo $LANG
ddru_findbad ../ddrescue.img ../ddrescue-fake.log
fdisk -lu ../ddrescue.img | grep ../ddrescue.img
exit


root@debian:~# bash
root@debian:~# mkdir try1
root@debian:~# cd    try1
root@debian:~/try1# echo $LANG
de_DE.UTF-8
root@debian:~/try1# ddru_findbad ../ddrescue.img ../ddrescue-fake.log
Command line input was processed succesfully
ddru_findbad 1.11 20141015
Waring! GNU fdisk is not detected!
Therefore GPT partitioned disks will not be able to be processed
and this script may produce errors if trying to do so.
See help file for more info.
Target = ../ddrescue.img
Logfile = ../ddrescue-fake.log
Output base name = results
Sector size = 512
Loop wait time = 2
More info = false
Extra output = false
Quick = false
Quick ntfs = false
Target ../ddrescue.img is detected to be a file
Target ../ddrescue.img is found to be a whole dos partitioned disk
Processing ddrescue log file
0x04860000 0x00004000 -
148224 148255
Checking Festplatte
/usr/bin/ddru_findbad: 1027: arithmetic expression: expecting primary: " 
(300-/dev/loop0:) "
root@debian:~/try1# fdisk -lu ../ddrescue.img | grep ../ddrescue.img
Festplatte ../ddrescue.img: 300 MiB, 314572800 Bytes, 614400 Sektoren
../ddrescue.img1        2048 614399   612352  299M 83 Linux
root@debian:~/try1# exit








bash
mkdir try2; cd try2
export LANG=C
echo $LANG
ddru_findbad ../ddrescue.img ../ddrescue-fake.log
fdisk -lu ../ddrescue.img | grep ../ddrescue.img
exit


root@debian:~# bash
root@debian:~# mkdir try2; cd try2
root@debian:~/try2# export LANG=C
root@debian:~/try2# echo $LANG
C
root@debian:~/try2# ddru_findbad ../ddrescue.img ../ddrescue-fake.log
Command line input was processed succesfully
ddru_findbad 1.11 20141015
Waring! GNU fdisk is not detected!
Therefore GPT partitioned disks will not be able to be processed
and this script may produce errors if trying to do so.
See help file for more info.
Target = ../ddrescue.img
Logfile = ../ddrescue-fake.log
Output base name = results
Sector size = 512
Loop wait time = 2
More info = false
Extra output = false
Quick = false
Quick ntfs = false
Target ../ddrescue.img is detected to be a file
Existing loop linked to target found, deleting /dev/loop0
Target ../ddrescue.img is found to be a whole dos partitioned disk
Processing ddrescue log file
0x04860000 0x00004000 -
148224 148255
Checking /dev/loop0p1
Partition /dev/loop0p1 type Ext4 is found to be linux
Checking block 73088 Inode 12 File //testfile
Checking block 73089 Inode 12 File //testfile
Checking block 73090 Inode 12 File //testfile
Checking block 73091 Inode 12 File //testfile
Checking block 73092 Inode 12 File //testfile
Checking block 73093 Inode 12 File //testfile
Checking block 73094 Inode 12 File //testfile
Checking block 73095 Inode 12 File //testfile
Checking block 73096 Inode 12 File //testfile
Checking block 73097 Inode 12 File //testfile
Checking block 73098 Inode 12 File //testfile
Checking block 73099 Inode 12 File //testfile
Checking block 73100 Inode 12 File //testfile
Checking block 73101 Inode 12 File //testfile
Checking block 73102 Inode 12 File //testfile
Checking block 73103 Inode 12 File //testfile
Processing output files
Producing stats
Creating list of files with counts
Cleaning up
Total elapsed time: 00:00:00:12
root@debian:~/try2# fdisk -lu ../ddrescue.img | grep ../ddrescue.img
Disk ../ddrescue.img: 300 MiB, 314572800 bytes, 614400 sectors
../ddrescue.img1       2048 614399  612352  299M 83 Linux
root@debian:~/try2# exit

Reply via email to