How to restore partition table from DD Openmediavault-Backup

    • OMV 4.x
    • Resolved
    • How to restore partition table from DD Openmediavault-Backup

      Hello,

      I made a DD backup of my system running on a usb stick using the Openmediavault-Backup plugin.
      Unfortunately I fail to restore the created backup to a second usb stick.

      Similar to this this thread I successfully created and restored backups of the entire block device using the following method.
      To backup:
      dd if=/dev/sdb of=/mnt/backupcopy.iso bs=4MB

      To restore:

      dd if=/mnt/backupcopy.iso of=/dev/sdc bs=4MB


      From what I understand the mbr and partition table are stored in the .grubparts backup file and can be restored with

      dd if=backup-omv-09-Aug-2019_15-46-32.grubparts of=/dev/sdg bs=512 count=1
      creating the mbr and partition table.

      After running the above command, sudo fdisk -l /dev/sdg displays the following output:

      Source Code

      1. GPT PMBR size mismatch (30031871 != 62517247) will be corrected by write.
      2. Disk /dev/sdg: 29,83 GiB, 32008830976 bytes, 62517248 sectors
      3. Disk model: USB Flash Drive
      4. Units: sectors of 1 * 512 = 512 bytes
      5. Sector size (logical/physical): 512 bytes / 512 bytes
      6. I/O size (minimum/optimal): 512 bytes / 512 bytes
      7. Disklabel type: dos
      8. Disk identifier: 0x00000000
      9. Device Boot Start End Sectors Size Id Type
      10. /dev/sdg1 1 62517247 62517247 29,8G ee GPT
      Display All


      Which is different from my original system drive:

      Source Code

      1. Disk /dev/sdb: 14.3 GiB, 15376318464 bytes, 30031872 sectors
      2. Units: sectors of 1 * 512 = 512 bytes
      3. Sector size (logical/physical): 512 bytes / 512 bytes
      4. I/O size (minimum/optimal): 512 bytes / 512 bytes
      5. Disklabel type: gpt
      6. Disk identifier: 18B9940C-C079-429C-A4D0-DD4718044D06
      7. Device Start End Sectors Size Type
      8. /dev/sdb1 34 1050815 1050782 513.1M EFI System
      9. /dev/sdb2 1050816 13982456 12931641 6.2G Linux filesystem
      10. /dev/sdb3 13982457 30031838 16049382 7.7G Linux swap
      Display All

      I tried to restore the system backup using
      gunzip -c backup-omv-09-Aug-2019_15-46-32.dd.gz | sudo dd of=dev/sdg1 bs=1M
      which crashes with the error
      dd: failed to open 'dev/sdg1': No such file or directory


      I would be grateful for any advice on how to restore the backup properly :)

      Edit:
      I am using OMV4.
      Editing the thread label and tags results in the following error:

      The server encountered an unresolvable problem, please try again later.

      Exception ID: 93d04f09014b98263e88391a166c94ddd535d4c7
    • Your procedures were correct. The only way it could've restored the partition table it did is if it backed up the wrong drive.

      johndoe123 wrote:

      Editing the thread label and tags results in the following error:

      The server encountered an unresolvable problem, please try again later.

      Exception ID: 93d04f09014b98263e88391a166c94ddd535d4c7
      Read problem #4 here - forum.openmediavault.org/index…tions-to-common-problems/
      omv 4.1.23 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.15
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • This is strange. I tried again and checked the log of omv-backup.

      Source Code

      1. Method: dd
      2. Device file: /dev/sdd2
      3. Root drive: /dev/sdb
      4. 1+0 records in
      5. 1+0 records out
      6. 446 bytes copied, 0.000103443 s, 4.3 MB/s
      7. 1+0 records in
      8. 1+0 records out
      9. 512 bytes copied, 9.2811e-05 s, 5.5 MB/s
      10. Boot drive: /dev/sdd1
      11. Using dd...
      Display All

      The detected root drive seems correct:

      Source Code

      1. jonas@jonas-nas ~> lsblk
      2. NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
      3. sda 8:0 0 5.5T 0 disk
      4. sdb 8:16 0 223.6G 0 disk
      5. └─sdb1 8:17 0 223.6G 0 part /srv/dev-disk-by-id-ata-CT240BX500SSD1_1925E189A740-part1
      6. sdc 8:32 0 2.7T 0 disk
      7. ├─sdc1 8:33 0 128M 0 part
      8. └─sdc2 8:34 0 2.7T 0 part
      9. sdd 8:48 1 14.3G 0 disk
      10. ├─sdd1 8:49 1 513.1M 0 part /boot/efi
      11. ├─sdd2 8:50 1 6.2G 0 part /
      12. └─sdd3 8:51 1 7.7G 0 part [SWAP]
      Display All

      Do you have an idea what I could be doing wrong? Thank you for your help
    • johndoe123 wrote:

      Device file: /dev/sdd2
      Root drive: /dev/sdb
      Here is the problem. It is detecting your root drive as /dev/sdb when it should be /dev/sdd.

      What is the output of:

      cat /proc/self/mountinfo
      findmnt -n /
      omv 4.1.23 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.15
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • You're right! I completely overlooked that. Thank you :)

      findmnt -n /

      Source Code

      1. / /dev/sdd2 ext4 rw,relatime,errors=remount-ro
      cat /proc/self/mountinfo

      Source Code

      1. 20 25 0:19 / /sys rw,nosuid,nodev,noexec,relatime shared:7 - sysfs sysfs rw
      2. 21 25 0:4 / /proc rw,nosuid,nodev,noexec,relatime shared:13 - proc proc rw
      3. 22 25 0:6 / /dev rw,nosuid,relatime shared:2 - devtmpfs udev rw,size=3885756k,nr_inodes=971439,mode=755
      4. 23 22 0:20 / /dev/pts rw,nosuid,noexec,relatime shared:3 - devpts devpts rw,gid=5,mode=620,ptmxmode=000
      5. 24 25 0:21 / /run rw,nosuid,noexec,relatime shared:5 - tmpfs tmpfs rw,size=781104k,mode=755
      6. 25 0 8:50 / / rw,relatime shared:1 - ext4 /dev/sdd2 rw,errors=remount-ro
      7. 26 20 0:7 / /sys/kernel/security rw,nosuid,nodev,noexec,relatime shared:8 - securityfs securityfs rw
      8. 27 22 0:22 / /dev/shm rw,nosuid,nodev shared:4 - tmpfs tmpfs rw
      9. 28 24 0:23 / /run/lock rw,nosuid,nodev,noexec,relatime shared:6 - tmpfs tmpfs rw,size=5120k
      10. 29 20 0:24 / /sys/fs/cgroup ro,nosuid,nodev,noexec shared:9 - tmpfs tmpfs ro,mode=755
      11. 30 29 0:25 / /sys/fs/cgroup/systemd rw,nosuid,nodev,noexec,relatime shared:10 - cgroup cgroup rw,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd
      12. 31 20 0:26 / /sys/fs/pstore rw,nosuid,nodev,noexec,relatime shared:11 - pstore pstore rw
      13. 32 20 0:27 / /sys/firmware/efi/efivars rw,nosuid,nodev,noexec,relatime shared:12 - efivarfs efivarfs rw
      14. 33 29 0:28 / /sys/fs/cgroup/cpu,cpuacct rw,nosuid,nodev,noexec,relatime shared:14 - cgroup cgroup rw,cpu,cpuacct
      15. 34 29 0:29 / /sys/fs/cgroup/perf_event rw,nosuid,nodev,noexec,relatime shared:15 - cgroup cgroup rw,perf_event
      16. 35 29 0:30 / /sys/fs/cgroup/pids rw,nosuid,nodev,noexec,relatime shared:16 - cgroup cgroup rw,pids
      17. 36 29 0:31 / /sys/fs/cgroup/net_cls,net_prio rw,nosuid,nodev,noexec,relatime shared:17 - cgroup cgroup rw,net_cls,net_prio
      18. 37 29 0:32 / /sys/fs/cgroup/blkio rw,nosuid,nodev,noexec,relatime shared:18 - cgroup cgroup rw,blkio
      19. 38 29 0:33 / /sys/fs/cgroup/rdma rw,nosuid,nodev,noexec,relatime shared:19 - cgroup cgroup rw,rdma
      20. 39 29 0:34 / /sys/fs/cgroup/cpuset rw,nosuid,nodev,noexec,relatime shared:20 - cgroup cgroup rw,cpuset
      21. 40 29 0:35 / /sys/fs/cgroup/freezer rw,nosuid,nodev,noexec,relatime shared:21 - cgroup cgroup rw,freezer
      22. 41 29 0:36 / /sys/fs/cgroup/memory rw,nosuid,nodev,noexec,relatime shared:22 - cgroup cgroup rw,memory
      23. 42 29 0:37 / /sys/fs/cgroup/devices rw,nosuid,nodev,noexec,relatime shared:23 - cgroup cgroup rw,devices
      24. 43 21 0:38 / /proc/sys/fs/binfmt_misc rw,relatime shared:24 - autofs systemd-1 rw,fd=28,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=10172
      25. 44 20 0:8 / /sys/kernel/debug rw,relatime shared:25 - debugfs debugfs rw
      26. 45 22 0:18 / /dev/mqueue rw,relatime shared:26 - mqueue mqueue rw
      27. 46 22 0:39 / /dev/hugepages rw,relatime shared:27 - hugetlbfs hugetlbfs rw,pagesize=2M
      28. 75 24 0:40 / /run/rpc_pipefs rw,relatime shared:28 - rpc_pipefs sunrpc rw
      29. 77 25 0:41 / /tmp rw,relatime shared:29 - tmpfs tmpfs rw
      30. 79 25 8:17 / /srv/dev-disk-by-id-ata-CT240BX500SSD1_1925E189A740-part1 rw,noexec,relatime shared:30 - ext4 /dev/sdb1 rw,discard,jqfmt=vfsv0,usrjquota=aquota.user,grpjquota=aquota.group
      31. 81 25 8:17 /backup /sharedfolders/backup rw,noexec,relatime shared:30 - ext4 /dev/sdb1 rw,discard,jqfmt=vfsv0,usrjquota=aquota.user,grpjquota=aquota.group
      32. 83 25 8:17 /appdata /sharedfolders/appdata rw,noexec,relatime shared:30 - ext4 /dev/sdb1 rw,discard,jqfmt=vfsv0,usrjquota=aquota.user,grpjquota=aquota.group
      33. 85 25 8:17 /nextcloud /sharedfolders/nextcloud rw,noexec,relatime shared:30 - ext4 /dev/sdb1 rw,discard,jqfmt=vfsv0,usrjquota=aquota.user,grpjquota=aquota.group
      34. 87 25 8:17 /downloads /sharedfolders/downloads rw,noexec,relatime shared:30 - ext4 /dev/sdb1 rw,discard,jqfmt=vfsv0,usrjquota=aquota.user,grpjquota=aquota.group
      35. 89 25 8:17 /syncthing /sharedfolders/syncthing rw,noexec,relatime shared:30 - ext4 /dev/sdb1 rw,discard,jqfmt=vfsv0,usrjquota=aquota.user,grpjquota=aquota.group
      36. 91 25 8:49 / /boot/efi rw,relatime shared:31 - vfat /dev/sdd1 rw,fmask=0077,dmask=0077,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro
      37. 95 25 8:50 /var/log /var/folder2ram/var/log rw,relatime - ext4 /dev/sdd2 rw,errors=remount-ro
      38. 97 25 0:44 / /var/log rw,nosuid,nodev,noexec,relatime shared:32 - tmpfs folder2ram rw
      39. 100 25 8:50 /var/tmp /var/folder2ram/var/tmp rw,relatime - ext4 /dev/sdd2 rw,errors=remount-ro
      40. 102 25 0:45 / /var/tmp rw,nosuid,nodev,noexec,relatime shared:33 - tmpfs folder2ram rw
      41. 105 25 8:50 /var/lib/openmediavault/rrd /var/folder2ram/var/lib/openmediavault/rrd rw,relatime - ext4 /dev/sdd2 rw,errors=remount-ro
      42. 107 25 0:46 / /var/lib/openmediavault/rrd rw,nosuid,nodev,noexec,relatime shared:34 - tmpfs folder2ram rw
      43. 110 25 8:50 /var/spool /var/folder2ram/var/spool rw,relatime - ext4 /dev/sdd2 rw,errors=remount-ro
      44. 112 25 0:47 / /var/spool rw,nosuid,nodev,noexec,relatime shared:35 - tmpfs folder2ram rw
      45. 115 25 8:50 /var/lib/rrdcached /var/folder2ram/var/lib/rrdcached rw,relatime - ext4 /dev/sdd2 rw,errors=remount-ro
      46. 117 25 0:48 / /var/lib/rrdcached rw,nosuid,nodev,noexec,relatime shared:36 - tmpfs folder2ram rw
      47. 120 25 8:50 /var/lib/monit /var/folder2ram/var/lib/monit rw,relatime - ext4 /dev/sdd2 rw,errors=remount-ro
      48. 122 25 0:49 / /var/lib/monit rw,nosuid,nodev,noexec,relatime shared:37 - tmpfs folder2ram rw
      49. 125 25 8:50 /var/lib/php /var/folder2ram/var/lib/php rw,relatime - ext4 /dev/sdd2 rw,errors=remount-ro
      50. 127 25 0:50 / /var/lib/php rw,nosuid,nodev,noexec,relatime shared:38 - tmpfs folder2ram rw
      51. 130 25 8:50 /var/lib/netatalk/CNID /var/folder2ram/var/lib/netatalk/CNID rw,relatime - ext4 /dev/sdd2 rw,errors=remount-ro
      52. 132 25 0:51 / /var/lib/netatalk/CNID rw,nosuid,nodev,noexec,relatime shared:39 - tmpfs folder2ram rw
      53. 135 25 8:50 /var/cache/samba /var/folder2ram/var/cache/samba rw,relatime - ext4 /dev/sdd2 rw,errors=remount-ro
      54. 137 25 0:52 / /var/cache/samba rw,nosuid,nodev,noexec,relatime shared:40 - tmpfs folder2ram rw
      55. 146 25 0:56 / /var/lib/docker/overlay2/059c3018ae10ca9760e46a14176d3d7f681e6f173e80c762ae9f434de3923861/merged rw,relatime shared:41 - overlay overlay rw,lowerdir=/var/lib/docker/overlay2/l/VINFA5PXLU4OWWISVCVVMPOENS:/var/lib/docker/overlay2/l/QS2B72R5VP5JG4A5EYP6BIGFYE:/var/lib/docker/overlay2/l/TU2GS44AL25W234G6AE3HZHR2J:/var/lib/docker/overlay2/l/WRBQYMY2P47J73ANTSVLVN47CM:/var/lib/docker/overlay2/l/3HR6Z22AKFRZOBHDJ6GEASWA5K:/var/lib/docker/overlay2/l/SGQOJ4K3GMUIPNQDQ7ZYZVB4Z4:/var/lib/docker/overlay2/l/IU2SGP3Z3C4NOVAT3Y2ZG4ZSMS,upperdir=/var/lib/docker/overlay2/059c3018ae10ca9760e46a14176d3d7f681e6f173e80c762ae9f434de3923861/diff,workdir=/var/lib/docker/overlay2/059c3018ae10ca9760e46a14176d3d7f681e6f173e80c762ae9f434de3923861/work
      56. 142 25 0:54 / /var/lib/docker/overlay2/84ba6d434ce79014bae847e9493a8d5cacb703cacb4b1871e21b3e5810188f37/merged rw,relatime shared:42 - overlay overlay rw,lowerdir=/var/lib/docker/overlay2/l/GFXOEZRLRZPMB7EGAEGOC2LZX6:/var/lib/docker/overlay2/l/UIOGQ63BJBEYAOQ5V3CRIGWPUU:/var/lib/docker/overlay2/l/BK5VN6M7EAS4KK5QCM7RDJADV2:/var/lib/docker/overlay2/l/KFHN7KLHE45NPAI6GJRNTVDMAF:/var/lib/docker/overlay2/l/LX4RWS3XA2PXMHSHN44S7K7I7A:/var/lib/docker/overlay2/l/CISGZ46BSVTDHRZ5XLEV7P2Z7Y,upperdir=/var/lib/docker/overlay2/84ba6d434ce79014bae847e9493a8d5cacb703cacb4b1871e21b3e5810188f37/diff,workdir=/var/lib/docker/overlay2/84ba6d434ce79014bae847e9493a8d5cacb703cacb4b1871e21b3e5810188f37/work
      57. 144 25 0:55 / /var/lib/docker/overlay2/54294797a28e365756e18a95b969e8be1b5bdced2425c9ce7300af81f34ef343/merged rw,relatime shared:43 - overlay overlay rw,lowerdir=/var/lib/docker/overlay2/l/YXPBREXM4KOSTDUZCPAMZTW2X4:/var/lib/docker/overlay2/l/IP4RV62WOPERS2J65XECPUFAM2:/var/lib/docker/overlay2/l/WPJGBYQEMYSLNE4ZXWGNALA4MF:/var/lib/docker/overlay2/l/OJ67CVZ3XWH6C4LHJ6AMLZ2FM3:/var/lib/docker/overlay2/l/KFHN7KLHE45NPAI6GJRNTVDMAF:/var/lib/docker/overlay2/l/LX4RWS3XA2PXMHSHN44S7K7I7A:/var/lib/docker/overlay2/l/CISGZ46BSVTDHRZ5XLEV7P2Z7Y,upperdir=/var/lib/docker/overlay2/54294797a28e365756e18a95b969e8be1b5bdced2425c9ce7300af81f34ef343/diff,workdir=/var/lib/docker/overlay2/54294797a28e365756e18a95b969e8be1b5bdced2425c9ce7300af81f34ef343/work
      58. 140 25 0:53 / /var/lib/docker/overlay2/5eaeec444cda6cc3ffb453a729176fdce7eab293c9c2094c3b2eb73b4bd34cdd/merged rw,relatime shared:44 - overlay overlay rw,lowerdir=/var/lib/docker/overlay2/l/D5REEGXXV335RYY5QZQGPXMUXN:/var/lib/docker/overlay2/l/EAED6PSO3HX7P5GM4FWI7HI4K3:/var/lib/docker/overlay2/l/MQWLEAAOV2E73GOTTVKY7DGUJP:/var/lib/docker/overlay2/l/YZDPDJTRXDTL45U6EMNMBBVJOV:/var/lib/docker/overlay2/l/NFVQLFADB5B4ORFKA7IVVXFOCT:/var/lib/docker/overlay2/l/TGPZSACOEHDOLX57NCG4VJG7TT:/var/lib/docker/overlay2/l/VP6N25E6KME736IX3HGHAUTCRQ:/var/lib/docker/overlay2/l/G42GEJO5LUPY654CQFMZKQ2DBO,upperdir=/var/lib/docker/overlay2/5eaeec444cda6cc3ffb453a729176fdce7eab293c9c2094c3b2eb73b4bd34cdd/diff,workdir=/var/lib/docker/overlay2/5eaeec444cda6cc3ffb453a729176fdce7eab293c9c2094c3b2eb73b4bd34cdd/work
      59. 148 25 0:57 / /var/lib/docker/overlay2/306909bc4579ebc19995e7a6a4cc1e121c51ca4b97bb8e229a1a7002be5cb6a4/merged rw,relatime shared:45 - overlay overlay rw,lowerdir=/var/lib/docker/overlay2/l/7Y4DGJK6ZXXXUD7GV3XRN4VZMH:/var/lib/docker/overlay2/l/LM4Z57ERSP6QEFDCXNVAWKMUEP:/var/lib/docker/overlay2/l/TLZV37H6T2XEQBJGOGN3BL7CJH:/var/lib/docker/overlay2/l/YZDPDJTRXDTL45U6EMNMBBVJOV:/var/lib/docker/overlay2/l/NFVQLFADB5B4ORFKA7IVVXFOCT:/var/lib/docker/overlay2/l/TGPZSACOEHDOLX57NCG4VJG7TT:/var/lib/docker/overlay2/l/VP6N25E6KME736IX3HGHAUTCRQ:/var/lib/docker/overlay2/l/G42GEJO5LUPY654CQFMZKQ2DBO,upperdir=/var/lib/docker/overlay2/306909bc4579ebc19995e7a6a4cc1e121c51ca4b97bb8e229a1a7002be5cb6a4/diff,workdir=/var/lib/docker/overlay2/306909bc4579ebc19995e7a6a4cc1e121c51ca4b97bb8e229a1a7002be5cb6a4/work
      Display All
    • cat /proc/self/mountinfo cont

      Source Code

      1. 191 25 0:58 / /var/lib/docker/containers/4929dbc6f4ec13fcd09124992c82af2dc2787bab3240dd15926e82b323f1dd9a/mounts/shm rw,nosuid,nodev,noexec,relatime shared:46 - tmpfs shm rw,size=65536k
      2. 193 25 0:59 / /var/lib/docker/containers/30163f8a94ec20254d41c7c3c670d1dd4b49a1d7dd1931d0f74d18472d4a1aaf/mounts/shm rw,nosuid,nodev,noexec,relatime shared:47 - tmpfs shm rw,size=65536k
      3. 195 25 0:60 / /var/lib/docker/containers/c6fc57190d6027b7212079c9f755a82c6b2f1a5b6d4a50bf51708b05ac2bab08/mounts/shm rw,nosuid,nodev,noexec,relatime shared:48 - tmpfs shm rw,size=65536k
      4. 197 25 0:61 / /var/lib/docker/containers/898606b63f21c78cf13f1608422b87769544590a511c79b28c35a3bed55baebd/mounts/shm rw,nosuid,nodev,noexec,relatime shared:49 - tmpfs shm rw,size=65536k
      5. 199 25 0:62 / /var/lib/docker/containers/9ffe64d396cc90ab93bb157ccbd1c414d43b5b5c48fa86936e8377827ccf0f12/mounts/shm rw,nosuid,nodev,noexec,relatime shared:50 - tmpfs shm rw,size=65536k
      6. 659 24 0:3 net:[4026532596] /run/docker/netns/8ba5b2d3e0ac rw shared:51 - nsfs nsfs rw
      7. 666 24 0:3 net:[4026532522] /run/docker/netns/7f7f159cebf6 rw shared:52 - nsfs nsfs rw
      8. 673 24 0:3 net:[4026532666] /run/docker/netns/5ff3085183dd rw shared:53 - nsfs nsfs rw
      9. 680 24 0:3 net:[4026532331] /run/docker/netns/4950eebfae11 rw shared:54 - nsfs nsfs rw
      10. 687 24 0:3 net:[4026532345] /run/docker/netns/42039efe3218 rw shared:55 - nsfs nsfs rw
    • johndoe123 wrote:

      ou're right! I completely overlooked that. Thank you
      Did you change the Root device field to /dev/sdb in the plugin? I can't think of any other way this happening.
      omv 4.1.23 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.15
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • cat /proc/self/mountinfo cont

      ryecoaaron wrote:

      Did you change the Root device field to /dev/sdb in the plugin? I can't think of any other way this happening.
      Thank you! That was indeed the mistake I made.

      Strangely though
      sudo dd if=backup-omv-12-Aug-2019_23-34-12.grubparts of=/dev/sdf bs=512 count=1
      still does not create the partitions properly

      Source Code

      1. jonas@jonas-pc ~/D/backup> sudo fdisk -l /dev/sdf
      2. GPT PMBR size mismatch (30031871 != 62517247) will be corrected by write.
      3. Disk /dev/sdf: 29,83 GiB, 32008830976 bytes, 62517248 sectors
      4. Disk model: USB Flash Drive
      5. Units: sectors of 1 * 512 = 512 bytes
      6. Sector size (logical/physical): 512 bytes / 512 bytes
      7. I/O size (minimum/optimal): 512 bytes / 512 bytes
      8. Disklabel type: dos
      9. Disk identifier: 0x00000000
      10. Device Boot Start End Sectors Size Id Type
      11. /dev/sdf1 1 62517247 62517247 29,8G ee GPT
      Display All
    • johndoe123 wrote:

      still does not create the partitions properly
      So, you removed any text from the root device field, took another backup, and tried writing the file to another drive? The plugin is just doing simple dd commands. Unless it is reading from the wrong drive, there is nothing that can wrong with this process.
      omv 4.1.23 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.15
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • ryecoaaron wrote:

      So, you removed any text from the root device field, took another backup, and tried writing the file to another drive?
      Correct.

      And you're also correct about the plugin not being at fault.
      If I understand correctly
      sudo dd if=/dev/sdd of=/dev/sde bs=512 count=1
      should copy the partition layout from my root device to sde.
      That doesn't happen as you can see below.

      Source Code

      1. jonas@jonas-nas ~> sudo fdisk -l /dev/sdd
      2. Disk /dev/sdd: 14.3 GiB, 15376318464 bytes, 30031872 sectors
      3. Units: sectors of 1 * 512 = 512 bytes
      4. Sector size (logical/physical): 512 bytes / 512 bytes
      5. I/O size (minimum/optimal): 512 bytes / 512 bytes
      6. Disklabel type: gpt
      7. Disk identifier: 18B9940C-C079-429C-A4D0-DD4718044D06
      8. Device Start End Sectors Size Type
      9. /dev/sdd1 34 1050815 1050782 513.1M EFI System
      10. /dev/sdd2 1050816 13982456 12931641 6.2G Linux filesystem
      11. /dev/sdd3 13982457 30031838 16049382 7.7G Linux swap
      12. jonas@jonas-nas ~> sudo fdisk -l /dev/sde
      13. GPT PMBR size mismatch (30031871 != 62517247) will be corrected by w(rite).
      14. Disk /dev/sde: 29.8 GiB, 32008830976 bytes, 62517248 sectors
      15. Units: sectors of 1 * 512 = 512 bytes
      16. Sector size (logical/physical): 512 bytes / 512 bytes
      17. I/O size (minimum/optimal): 512 bytes / 512 bytes
      18. Disklabel type: dos
      19. Disk identifier: 0x00000000
      20. Device Boot Start End Sectors Size Id Type
      21. /dev/sde1 1 30031871 30031871 14.3G ee GPT
      22. jonas@jonas-nas ~> sudo dd if=/dev/sdd of=/dev/sde bs=512 count=1
      23. 1+0 records in
      24. 1+0 records out
      25. 512 bytes copied, 0.00859875 s, 59.5 kB/s
      26. jonas@jonas-nas ~> sudo fdisk -l /dev/sde
      27. GPT PMBR size mismatch (30031871 != 62517247) will be corrected by w(rite).
      28. Disk /dev/sde: 29.8 GiB, 32008830976 bytes, 62517248 sectors
      29. Units: sectors of 1 * 512 = 512 bytes
      30. Sector size (logical/physical): 512 bytes / 512 bytes
      31. I/O size (minimum/optimal): 512 bytes / 512 bytes
      32. Disklabel type: dos
      33. Disk identifier: 0x00000000
      34. Device Boot Start End Sectors Size Id Type
      35. /dev/sde1 1 30031871 30031871 14.3G ee GPT
      Display All
      Unfortunately I don't have another ≥16 GB drive at hand to test the command. I tried to copy the partition layout to another 4 GB but that didn't work either.

      As long as the command should do what I believe it should, I don't know what external condition could prevent it from working.

      Copying the devicefile afterwards with
      sudo dd if=/dev/sdd2 bs=1M conv=sync,noerror status=progress of=/dev/sde2
      does not work either.
    • johndoe123 wrote:

      That doesn't happen as you can see below.
      Is /dev/sde mounted? What do you get after running partprobe?
      omv 4.1.23 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.15
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • /dev/sde is not mounted.
      sudo partprobe -s /dev/sde returns
      /dev/sde: loop partitions 1

      lsblk still shows

      Source Code

      1. NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
      2. sda 8:0 0 5.5T 0 disk
      3. sdb 8:16 0 223.6G 0 disk
      4. └─sdb1 8:17 0 223.6G 0 part /srv/dev-disk-by-id-ata-CT240BX500SSD1_1925E189A740-part1
      5. sdc 8:32 0 2.7T 0 disk
      6. ├─sdc1 8:33 0 128M 0 part
      7. └─sdc2 8:34 0 2.7T 0 part
      8. sdd 8:48 1 14.3G 0 disk
      9. ├─sdd1 8:49 1 513.1M 0 part /boot/efi
      10. ├─sdd2 8:50 1 6.2G 0 part /
      11. └─sdd3 8:51 1 7.7G 0 part [SWAP]
      12. sde 8:64 1 29.8G 0 disk
      Display All
    • johndoe123 wrote:

      sudo partprobe -s /dev/sde
      Why did you change the command? I didn't want a summary. I wanted to rescan the partition tables. If that doesn't fix it, I don't know what is wrong. I've never seen dd say it wrote blocks and not really write them. Bad usb stick?
      omv 4.1.23 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.15
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • I'm sorry. I also ran sudo partprobe but lsblk didn't show any changes in the partition layout.

      I will try to get my hands on another usb stick than. I checked the usb stick running omv and the stick used to restore the backup with f3write though, which didn't show any problems.

      Can the previous filesystem or partition table of the usb stick influence dd?
    • johndoe123 wrote:

      Can the previous filesystem or partition table of the usb stick influence dd?
      Nope.
      omv 4.1.23 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.15
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • I found the problem!

      It was in hindsight ofc logical and simple. My boot device is using a GPT instead of a MBR partition table, which occupies a bigger block of data at the start of my devices.

      Following this advice, I calculated the size of my partition table as follows
      size=(128*N)+1024,
      where N is the number of partitions on the device.

      In my case I have three partitions and thus can backup my partition table using

      sudo dd if=/dev/sdd of=partition-table.grubparts bs=1 count=1408
      and restore it using
      sudo dd if=partition-table.grubparts of=/dev/sdb bs=1 count=1408

      Do you think it would be a good idea to expand the backup script to detect GPT and backup accordingly?
      As I'm still on vacation I haven't tested the complete backup yet and will report as soon as I've recovered a complete backup successfully.
    • johndoe123 wrote:

      Do you think it would be a good idea to expand the backup script to detect GPT and backup accordingly?
      Maybe. I never worried about it because the OMV installer doesn't use GPT for the system disk.
      omv 4.1.23 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.15
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!