billw2 / rpi-clone

A shell script to clone a booted disk.
BSD 3-Clause "New" or "Revised" License
2.56k stars 335 forks source link

Syntax error, Pi4 XBian #118

Open smdatt opened 3 years ago

smdatt commented 3 years ago

I've tried variants of the commands and they are always consisting of similar syntax errors. The script seems to complete, though with the syntax errors I don't know how reliably the script is processing. Am I missing a pre-requisite? Both running as sudo or under sudo -i

root@xbian ~ # rpi-clone -s -v -l sda -e sda
sed: -e expression #1, char 19: unknown option to `s'
findmnt: mutually exclusive arguments: --pairs --list --raw --verify
/usr/local/sbin/rpi-clone: line 688: ((: ]: syntax error: operand expected (error token is "]")
/usr/local/sbin/rpi-clone: line 728: ((: ]: syntax error: operand expected (error token is "]")
/usr/local/sbin/rpi-clone: line 688: ((: ]: syntax error: operand expected (error token is "]")
/usr/local/sbin/rpi-clone: line 728: ((: ]: syntax error: operand expected (error token is "]")
/usr/local/sbin/rpi-clone: line 688: ((: ]: syntax error: operand expected (error token is "]")
/usr/local/sbin/rpi-clone: line 728: ((: ]: syntax error: operand expected (error token is "]")
findmnt: mutually exclusive arguments: --pairs --list --raw --verify

Booted disk: mmcblk0 62.9GB                Destination disk: sda 120.0GB
---------------------------------------------------------------------------
Part   Size    FS     Label           Part   Size    FS     Label
1      100.0M  fat16  --              1      100.0M  fat16  --
2       58.2G  btrfs  --              2      111.7G  btrfs  --
3      245.0M  swap   --
---------------------------------------------------------------------------
== SYNC mmcblk0 file systems to sda ==
/usr/local/sbin/rpi-clone: line 383: ((: ]: syntax error: operand expected (error token is "]")
/usr/local/sbin/rpi-clone: line 383: ((: ]: syntax error: operand expected (error token is "]")
/usr/local/sbin/rpi-clone: line 383: ((: ]: syntax error: operand expected (error token is "]")
---------------------------------------------------------------------------
-e clone fstab edit    : edit mmcblk0p device entries to sda.
-l SD to USB boot mode : install boot to USB cmdline.txt on SD card.
Run setup script       : rpi-clone-setup -v
Verbose mode           : no.
-----------------------:

another -

root@xbian ~ # rpi-clone sda -v -f -e sda
sed: -e expression #1, char 19: unknown option to `s'
findmnt: mutually exclusive arguments: --pairs --list --raw --verify
/usr/local/sbin/rpi-clone: line 688: ((: ]: syntax error: operand expected (error token is "]")
/usr/local/sbin/rpi-clone: line 728: ((: ]: syntax error: operand expected (error token is "]")
/usr/local/sbin/rpi-clone: line 688: ((: ]: syntax error: operand expected (error token is "]")
/usr/local/sbin/rpi-clone: line 728: ((: ]: syntax error: operand expected (error token is "]")
/usr/local/sbin/rpi-clone: line 688: ((: ]: syntax error: operand expected (error token is "]")
/usr/local/sbin/rpi-clone: line 728: ((: ]: syntax error: operand expected (error token is "]")
findmnt: mutually exclusive arguments: --pairs --list --raw --verify

Booted disk: mmcblk0 62.9GB                Destination disk: sda 120.0GB
---------------------------------------------------------------------------
Part   Size    FS     Label           Part   Size  FS  Label
1      100.0M  fat16  --
2       58.2G  btrfs  --
3      245.0M  swap   --
---------------------------------------------------------------------------
== Initialize: IMAGE partition table - forced by option ==
/usr/local/sbin/rpi-clone: line 420: ((: ]: syntax error: operand expected (error token is "]")
1                                    : MKFS  SYNC to sda1
/usr/local/sbin/rpi-clone: line 420: ((: ]: syntax error: operand expected (error token is "]")
2                                    : IMAGE to sda2
/usr/local/sbin/rpi-clone: line 420: ((: ]: syntax error: operand expected (error token is "]")
3                     (0.0M used)    : RESIZE  MKSWAP
---------------------------------------------------------------------------
-e clone fstab edit    : edit mmcblk0p device entries to sda.
Run setup script       : no.
Verbose mode           : yes.
-----------------------:
** WARNING **          : All destination disk sda data will be overwritten!
-----------------------:

Initialize and clone to the destination disk sda?  (yes/no): yes
Optional destination ext type file system label (16 chars max):

Initializing
  Imaging past partition 1 start.
  => dd if=/dev/mmcblk0 of=/dev/sda bs=1M count=5 ...
  Resizing destination disk last partition ...
    Resize success.
  Changing destination Disk ID ...
  => dd if=/dev/mmcblk0p1 of=/dev/sda1 bs=1M ...
  => dd if=/dev/mmcblk0p2 of=/dev/sda2 bs=1M ...
  => mkswap /dev/sda3

Syncing file systems (can take a long time)
Syncing mounted partitions:
/usr/local/sbin/rpi-clone: line 1687: ]: syntax error: operand expected (error token is "]")
  Mounting /dev/sda] on /mnt/clone
mount: /mnt/clone: special device /dev/sda] does not exist.
    Mount failure of /dev/sda] on /mnt/clone.
Aborting!