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

Command not found error #14

Closed
sosukeinu opened this issue Apr 10, 2018 · 10 comments
Closed

Command not found error #14

sosukeinu opened this issue Apr 10, 2018 · 10 comments

Comments

@sosukeinu
Copy link

Hello,
I followed the below process to install weresync on Ubuntu 16.04:

python3 -m venv weresync-env

source weresync-env/bin/activate

pip install weresync

Then, when I run sudo weresync-gui I get sudo: weresync-gui: command not found

Strangely, when I try weresync -h the help text is properly displayed, but when I try
sudo weresync /dev/sdb /dev/sdc I get sudo: weresync: command not found

Any help to troubleshoot would be very much appreciated, as I would love to use this package.

Thank you for your time.

@DonyorM
Copy link
Owner

DonyorM commented Apr 10, 2018

This is because when you run sudo it enters a new shell where your python environment is no longer active. Try the following set of commands instead:

sudo su
source weresync-env/bin/activate
weresync-gui

The first command puts you into a root shell, where you can then activate the python profile. This isn't really the best in general, but it will still work. Do as little as possible in a root shell, don't use it for general usage (basically same warnings as sudo, just easier to forget).

@sosukeinu
Copy link
Author

this worked a treat! thank you for your time, and for the excellent package.

@DonyorM
Copy link
Owner

DonyorM commented Apr 10, 2018

Glad I could help. I'd love to hear any feedback you have on what worked/didn't work. Some setups still produce odd results that I need to gather more information on.

Feel free to ask if you have any other questions.

@sosukeinu
Copy link
Author

sosukeinu commented Apr 10, 2018

I will report back here with results of the first copy. In the interest of cataloging the steps I needed to use to get it working in my circumstance, I will include the specific commands below. One thing I found, in order to get it to work as su, the venv needed to be created by this user, or I ran into odd issues.

sudo apt-get install python3 \
      python3-dev \
      python3-pip \
      python3-venv \
      python3-gi
  • mkdir -p ~/.virtualenvs && cd ~/.virtualenvs
  • sudo su
  • python3 -m venv su-weresync-env --system-site-packages
  • source $PWD/su-weresync-env/bin/activate
  • pip3 install --upgrade pip && pip3 install weresync
  • pip3 freeze just to verify installation worked
  • weresync-gui

My partition setup for source disk is:

disk_partitions

My Weresync settings are:

weresync_options

@sosukeinu
Copy link
Author

The first attempt failed. the dialog said "NoneType is not subscriptable." The terminal output was:

Checking partition validity.
WARNING - 2018-04-10 11:18:04,763 - weresync.interface - Partition count on two drives different. Invalid.
Partitions invalid!
Copying drive partition table.
WARNING - 2018-04-10 11:18:04,763 - weresync.interface - Drives are incompatible.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
WARNING - 2018-04-10 11:18:13,550 - weresync.device - Invalid filesystem type found. Partition 3 not formatted.
Checking partition validity.
WARNING - 2018-04-10 11:18:15,125 - weresync.interface - Partition count on two drives different. Invalid.
Partitions invalid!
Copying drive partition table.
WARNING - 2018-04-10 11:18:15,126 - weresync.interface - Drives are incompatible.
Beginning to copy files.
Copying partition 1
Copying partition 2
WARNING - 2018-04-10 11:18:39,313 - weresync.device - Error copying data for partition 3 from device /dev/sdb to /dev/sdc.
Finished copying files.
Copying partition root
WARNING - 2018-04-10 14:05:06,551 - weresync.device - Error copying data for partition swap_1 from device ubuntu--vg to /dev/ubuntu-vg-copy.
Finished copying files.
Finished copying files.
Making bootable
WARNING - 2018-04-10 14:05:07,434 - weresync.device - Error copying fstab on LVM. Continuing anyway.

Any thoughts? Thank you.

@DonyorM
Copy link
Owner

DonyorM commented Apr 10, 2018

Can you send me the output of /var/log/weresync/weresync.log? Also what is the exact command you used?

@sosukeinu
Copy link
Author

I used weresync-gui and entered the settings in the image above
Log is below:

INFO - 2018-04-10 11:12:47,059 - weresync.gui - Starting gui.
DEBUG - 2018-04-10 11:18:03,923 - weresync.device - [['LV', 'VG', 'Attr', 'LSize', 'Pool', 'Origin', 'Data%', 'Meta%', 'Move', 'Log', 'Cpy%Sync', 'Convert'], ['root', 'ubuntu-vg', '-wi-ao----', '915.43g', '', '', '', '', '', '', '', ''], ['swap_1', 'ubuntu-vg', '-wi-ao----', '15.89g', '', '', '', '', '', '', '', '']]
WARNING - 2018-04-10 11:18:04,763 - weresync.interface - Partition count on two drives different. Invalid.
WARNING - 2018-04-10 11:18:04,763 - weresync.interface - Drives are incompatible.
DEBUG - 2018-04-10 11:18:05,496 - weresync.device - ['sgdisk', '/dev/sdc', '-o', '-n', '1:0:+2048', '-n', '2:0:+487424', '-n', '3:0:0', '-t', '3:8E00', '-t', '2:8300', '-t', '1:EF00']
DEBUG - 2018-04-10 11:18:08,858 - weresync.gui - part callback. Value: 0.3
DEBUG - 2018-04-10 11:18:12,231 - weresync.device - Callback:
Drive Size: 1953525164
Part Size: 2047
Complete: 1.0478493124749942e-06
DEBUG - 2018-04-10 11:18:12,233 - weresync.gui - part callback. Value: 0.3000007334945187
DEBUG - 2018-04-10 11:18:13,523 - weresync.device - Callback:
Drive Size: 1953525164
Part Size: 487423
Complete: 0.00024950945551270104
DEBUG - 2018-04-10 11:18:13,524 - weresync.gui - part callback. Value: 0.3001746566188589
WARNING - 2018-04-10 11:18:13,550 - weresync.device - Invalid filesystem type found. Partition 3 not formatted.
DEBUG - 2018-04-10 11:18:13,551 - weresync.gui - part callback. Value: 1.0
DEBUG - 2018-04-10 11:18:15,114 - weresync.device - [['LV', 'VG', 'Attr', 'LSize', 'Pool', 'Origin', 'Data%', 'Meta%', 'Move', 'Log', 'Cpy%Sync', 'Convert'], ['root', 'ubuntu-vg', '-wi-ao----', '915.43g', '', '', '', '', '', '', '', ''], ['swap_1', 'ubuntu-vg', '-wi-ao----', '15.89g', '', '', '', '', '', '', '', '']]
DEBUG - 2018-04-10 11:18:15,125 - weresync.device - [['LV', 'VG', 'Attr', 'LSize', 'Pool', 'Origin', 'Data%', 'Meta%', 'Move', 'Log', 'Cpy%Sync', 'Convert'], ['root', 'ubuntu-vg', '-wi-ao----', '915.43g', '', '', '', '', '', '', '', ''], ['swap_1', 'ubuntu-vg', '-wi-ao----', '15.89g', '', '', '', '', '', '', '', '']]
WARNING - 2018-04-10 11:18:15,125 - weresync.interface - Partition count on two drives different. Invalid.
WARNING - 2018-04-10 11:18:15,126 - weresync.interface - Drives are incompatible.
DEBUG - 2018-04-10 11:18:15,160 - weresync.device - [['LV', 'VG', 'Attr', 'LSize', 'Pool', 'Origin', 'Data%', 'Meta%', 'Move', 'Log', 'Cpy%Sync', 'Convert'], ['root', 'ubuntu-vg', '-wi-ao----', '915.43g', '', '', '', '', '', '', '', ''], ['swap_1', 'ubuntu-vg', '-wi-ao----', '15.89g', '', '', '', '', '', '', '', '']]
DEBUG - 2018-04-10 11:18:15,171 - weresync.device - [['LV', 'VG', 'Attr', 'LSize', 'Pool', 'Origin', 'Data%', 'Meta%', 'Move', 'Log', 'Cpy%Sync', 'Convert'], ['root', 'ubuntu-vg', '-wi-ao----', '915.43g', '', '', '', '', '', '', '', ''], ['swap_1', 'ubuntu-vg', '-wi-ao----', '15.89g', '', '', '', '', '', '', '', '']]
DEBUG - 2018-04-10 11:18:15,204 - weresync.device - lvcreate command: ['lvcreate', '--size', '1919705088S', '-n', 'root', '/dev/ubuntu-vg-copy']
DEBUG - 2018-04-10 11:18:15,906 - weresync.device - Output for root:   Logical volume "root" created.

DEBUG - 2018-04-10 11:18:15,925 - weresync.device - lvcreate command: ['lvcreate', '--size', '33325056S', '-n', 'swap_1', '/dev/ubuntu-vg-copy']
DEBUG - 2018-04-10 11:18:16,492 - weresync.device - Output for swap_1:   Logical volume "swap_1" created.

DEBUG - 2018-04-10 11:18:16,506 - weresync.device - [['LV', 'VG', 'Attr', 'LSize', 'Pool', 'Origin', 'Data%', 'Meta%', 'Move', 'Log', 'Cpy%Sync', 'Convert'], ['root', 'ubuntu-vg', '-wi-ao----', '915.43g', '', '', '', '', '', '', '', ''], ['swap_1', 'ubuntu-vg', '-wi-ao----', '15.89g', '', '', '', '', '', '', '', ''], ['root', 'ubuntu-vg-copy', '-wi-ao----', '915.39g', '', '', '', '', '', '', '', ''], ['swap_1', 'ubuntu-vg-copy', '-wi-ao----', '15.89g', '', '', '', '', '', '', '', '']]
DEBUG - 2018-04-10 11:18:25,515 - weresync.device - Callback:
Drive Size: 1953030144
Part Size: 1919705088
Complete: 0.9829367426292013
DEBUG - 2018-04-10 11:18:25,517 - weresync.gui - part callback. Value: 0.9829367426292013
DEBUG - 2018-04-10 11:18:25,963 - weresync.device - Callback:
Drive Size: 1953030144
Part Size: 33325056
Complete: 0.017063257370798675
DEBUG - 2018-04-10 11:18:25,964 - weresync.gui - part callback. Value: 0.017063257370798675
INFO - 2018-04-10 11:18:26,132 - weresync.device - Starting rsync process for partition /dev/sdb.
DEBUG - 2018-04-10 11:18:26,133 - weresync.device - Arguments = rsync -aAXxH --delete --exclude=/dev/* --exclude=/proc/* --exclude=/sys/* --exclude=/tmp/* --exclude=/run/* --exclude=/mnt/* --exclude=/media/* --exclude=/lost+found --exclude=/home/*/.gvfs /tmp/91266/ /tmp/-87609 --info=progress2
DEBUG - 2018-04-10 11:18:26,182 - weresync.device - Errors for partition 1:

DEBUG - 2018-04-10 11:18:26,182 - weresync.device - Setting to finished
INFO - 2018-04-10 11:18:26,773 - weresync.device - Starting rsync process for partition /dev/sdb.
DEBUG - 2018-04-10 11:18:26,774 - weresync.device - Arguments = rsync -aAXxH --delete --exclude=/dev/* --exclude=/proc/* --exclude=/sys/* --exclude=/tmp/* --exclude=/run/* --exclude=/mnt/* --exclude=/media/* --exclude=/lost+found --exclude=/home/*/.gvfs /boot/ /tmp/-87609 --info=progress2
DEBUG - 2018-04-10 11:18:28,400 - weresync.device - Errors for partition 2:

rsync: write failed on "/tmp/-87609/grub/unicode.pf2": No space left on device (28)
rsync error: error in file IO (code 11) at receiver.c(393) [receiver=3.1.1]

DEBUG - 2018-04-10 11:18:28,401 - weresync.device - Setting to finished
WARNING - 2018-04-10 11:18:39,313 - weresync.device - Error copying data for partition 3 from device /dev/sdb to /dev/sdc.
DEBUG - 2018-04-10 11:18:39,313 - weresync.device - Error info.
Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/weresync/device.py", line 1510, in _copy_files
    source_manager.mount_partition(i, mnt_source)
  File "/usr/lib/python3.5/site-packages/weresync/device.py", line 176, in mount_partition
    partition_num), str(output, "utf-8"))
weresync.exception.DeviceError: ('/dev/sdb', 'Non-zero exit code. Partition Number: 3', "mount: unknown filesystem type 'LVM2_member'\n")
DEBUG - 2018-04-10 11:18:39,315 - weresync.gui - Error occurred copying partition 3. Marking complete.
DEBUG - 2018-04-10 11:18:39,323 - weresync.device - [['LV', 'VG', 'Attr', 'LSize', 'Pool', 'Origin', 'Data%', 'Meta%', 'Move', 'Log', 'Cpy%Sync', 'Convert'], ['root', 'ubuntu-vg', '-wi-ao----', '915.43g', '', '', '', '', '', '', '', ''], ['swap_1', 'ubuntu-vg', '-wi-ao----', '15.89g', '', '', '', '', '', '', '', ''], ['root', 'ubuntu-vg-copy', '-wi-a-----', '915.39g', '', '', '', '', '', '', '', ''], ['swap_1', 'ubuntu-vg-copy', '-wi-a-----', '15.89g', '', '', '', '', '', '', '', '']]
INFO - 2018-04-10 11:18:39,661 - weresync.device - Starting rsync process for partition ubuntu--vg.
DEBUG - 2018-04-10 11:18:39,661 - weresync.device - Arguments = rsync -aAXxH --delete --exclude=/dev/* --exclude=/proc/* --exclude=/sys/* --exclude=/tmp/* --exclude=/run/* --exclude=/mnt/* --exclude=/media/* --exclude=/lost+found --exclude=/home/*/.gvfs / /tmp/-87609 --info=progress2
DEBUG - 2018-04-10 14:04:34,523 - weresync.device - Errors for partition root:

DEBUG - 2018-04-10 14:04:34,524 - weresync.device - Setting to finished
WARNING - 2018-04-10 14:05:06,551 - weresync.device - Error copying data for partition swap_1 from device ubuntu--vg to /dev/ubuntu-vg-copy.
DEBUG - 2018-04-10 14:05:06,551 - weresync.device - Error info.
Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/weresync/device.py", line 1510, in _copy_files
    source_manager.mount_partition(i, mnt_source)
  File "/usr/lib/python3.5/site-packages/weresync/device.py", line 176, in mount_partition
    partition_num), str(output, "utf-8"))
weresync.exception.DeviceError: ('ubuntu--vg', 'Non-zero exit code. Partition Number: swap_1', "mount: unknown filesystem type 'swap'\n")
INFO - 2018-04-10 14:05:06,555 - weresync.device - Using plugin: uuid_copy
DEBUG - 2018-04-10 14:05:06,555 - weresync.gui - Error occurred copying partition swap_1. Marking complete.
DEBUG - 2018-04-10 14:05:06,700 - weresync.device - Failed to mount partition. Info:
Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/weresync/device.py", line 1344, in _copy_fstab
    source_manager.mount_partition(i, mnt_source)
  File "/usr/lib/python3.5/site-packages/weresync/device.py", line 176, in mount_partition
    partition_num), str(output, "utf-8"))
weresync.exception.DeviceError: ('/dev/sdb', 'Non-zero exit code. Partition Number: 3', "mount: unknown filesystem type 'LVM2_member'\n")
DEBUG - 2018-04-10 14:05:06,732 - weresync.device - [['LV', 'VG', 'Attr', 'LSize', 'Pool', 'Origin', 'Data%', 'Meta%', 'Move', 'Log', 'Cpy%Sync', 'Convert'], ['root', 'ubuntu-vg', '-wi-ao----', '915.43g', '', '', '', '', '', '', '', ''], ['swap_1', 'ubuntu-vg', '-wi-ao----', '15.89g', '', '', '', '', '', '', '', ''], ['root', 'ubuntu-vg-copy', '-wi-a-----', '915.39g', '', '', '', '', '', '', '', ''], ['swap_1', 'ubuntu-vg-copy', '-wi-a-----', '15.89g', '', '', '', '', '', '', '', '']]
DEBUG - 2018-04-10 14:05:07,405 - parse - format '/dev/{0}' -> '/dev/(.+?)'
WARNING - 2018-04-10 14:05:07,434 - weresync.device - Error copying fstab on LVM. Continuing anyway.
DEBUG - 2018-04-10 14:05:07,434 - weresync.device - Info: 
Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/weresync/device.py", line 1476, in _copy_fstab
    words[0], self.get_uuid_dict())
  File "/usr/lib/python3.5/site-packages/weresync/device.py", line 870, in get_uuid_dict
    source_vg = parse.parse("/dev/{0}", self.lvm_source.device)[0]
TypeError: 'NoneType' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/weresync/device.py", line 1678, in make_bootable
    excluded_partitions, lvm=True)
  File "/usr/lib/python3.5/site-packages/weresync/device.py", line 1482, in _copy_fstab
    source_manager.unmount_partition(i)
  File "/usr/lib/python3.5/site-packages/weresync/device.py", line 195, in unmount_partition
    str(output, "utf-8"))
weresync.exception.DeviceError: ('ubuntu--vg', 'umount: /var/lib/docker/containers/4d9f12afd40af891edf2510d03b791b585f5019cbf2c81fbf5fe6defbbe08d57/mounts: target is busy\n        (In some cases useful info about processes that\n         use the device is found by lsof(8) or fuser(1).)\n')
DEBUG - 2018-04-10 14:05:08,216 - parse - format '/dev/{0}' -> '/dev/(.+?)'
DEBUG - 2018-04-10 14:05:08,216 - weresync.gui - Full exception info:
Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/weresync/gui.py", line 547, in copy
    lambda done: GLib.idle_add(self.boot_callback, done))
  File "/usr/lib/python3.5/site-packages/weresync/interface.py", line 334, in copy_drive
    boot_partition, efi_partition, boot_callback)
  File "/usr/lib/python3.5/site-packages/weresync/device.py", line 1687, in make_bootable
    root_partition, efi_partition)
  File "/usr/lib/python3.5/site-packages/weresync/plugins/weresync_uuid_copy.py", line 52, in install_bootloader
    plugins.translate_uuid(copier, boot_partition, "/", target_mnt)
  File "/usr/lib/python3.5/site-packages/weresync/plugins/__init__.py", line 75, in translate_uuid
    uuid_dict = copier.get_uuid_dict()
  File "/usr/lib/python3.5/site-packages/weresync/device.py", line 870, in get_uuid_dict
    source_vg = parse.parse("/dev/{0}", self.lvm_source.device)[0]
TypeError: 'NoneType' object is not subscriptable

Thank you for your time

@DonyorM
Copy link
Owner

DonyorM commented Apr 14, 2018

I'm going to have to run some test setups. I'll get back to you as soon as I can.

@DonyorM DonyorM reopened this Apr 14, 2018
@DonyorM
Copy link
Owner

DonyorM commented Jun 28, 2018

I believe this is fixed with version 1.0.9. Let me know if you have any more issues.

@sosukeinu
Copy link
Author

works great. It completed successfully. Thank you so very much for your work on this.

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