I am running a linux server off a bootable usb thumb drive. I have backed up the contents of the usb thumb drive with rysnc.
I have tried to test this backup by using a different usb thumb drive and creating the same partition layout as the current usb thumb drive. Such as the following:
drive: 60 GB USB thumb drive sdb1: 55.9G ext4 sdb2: 1k sdb3: 3.7G swap
I have copied over the contents to sdb1 using rysnc.
My question is, how do I now make this bootable so I can plug this into the same computer as the original USB drive and boot up as if nothing has happened to the original USB drive?
I imagine I would have to edit fstab to make sure the UUID is correct to the new USB thumb drive correct? I also assume I have to edit any grub.cfg file to also update the UUID, is that correct as well? Is there anything else that I might need to consider changing?
Thank you for any help.
Here is some of the info requested by Kamil:
Disk /dev/sdb: 59.6 GiB, 64019759104 bytes, 125038592 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x8af780e1
Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 2048 117260287 117258240 55.9G 83 Linux
/dev/sdb2 117262334 125036543 7774210 3.7G 5 Extended
/dev/sdb5 117262336 125036543 7774208 3.7G 82 Linux swap / Solaris
GPT fdisk (gdisk) version 1.0.1
Partition table scan:
MBR: MBR only
BSD: not present
APM: not present
GPT: not present
***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory.
***************************************************************
Disk /dev/sdb: 125038592 sectors, 59.6 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 6BF9EF56-C618-4F70-BC7E-920C50FB7A75
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 125038558
Partitions will be aligned on 2048-sector boundaries
Total free space is 6077 sectors (3.0 MiB)
Number Start (sector) End (sector) Size Code Name
1 2048 117260287 55.9 GiB 8300 Linux filesystem
5 117262336 125036543 3.7 GiB 8200 Linux swap
/dev/sdb1 on /var/folder2ram/var/log type ext4 (rw,noatime,nodiratime,errors=remount-ro)
folder2ram on /var/log type tmpfs (rw,nosuid,nodev,noexec,relatime)
/dev/sdb1 on /var/folder2ram/var/tmp type ext4 (rw,noatime,nodiratime,errors=remount-ro)
folder2ram on /var/tmp type tmpfs (rw,nosuid,nodev,noexec,relatime)
/dev/sdb1 on /var/folder2ram/var/lib/openmediavault/rrd type ext4 (rw,noatime,nodiratime,errors=remount-ro)
folder2ram on /var/lib/openmediavault/rrd type tmpfs (rw,nosuid,nodev,noexec,relatime)
/dev/sdb1 on /var/folder2ram/var/spool type ext4 (rw,noatime,nodiratime,errors=remount-ro)
folder2ram on /var/spool type tmpfs (rw,nosuid,nodev,noexec,relatime)
/dev/sdb1 on /var/folder2ram/var/lib/rrdcached type ext4 (rw,noatime,nodiratime,errors=remount-ro)
folder2ram on /var/lib/rrdcached type tmpfs (rw,nosuid,nodev,noexec,relatime)
/dev/sdb1 on /var/folder2ram/var/lib/monit type ext4 (rw,noatime,nodiratime,errors=remount-ro)
folder2ram on /var/lib/monit type tmpfs (rw,nosuid,nodev,noexec,relatime)
/dev/sdb1 on /var/folder2ram/var/lib/php type ext4 (rw,noatime,nodiratime,errors=remount-ro)
folder2ram on /var/lib/php type tmpfs (rw,nosuid,nodev,noexec,relatime)
/dev/sdb1 on /var/folder2ram/var/lib/netatalk/CNID type ext4 (rw,noatime,nodiratime,errors=remount-ro)
folder2ram on /var/lib/netatalk/CNID type tmpfs (rw,nosuid,nodev,noexec,relatime)
/dev/sdb1 on /var/folder2ram/var/cache/samba type ext4 (rw,noatime,nodiratime,errors=remount-ro)
folder2ram on /var/cache/samba type tmpfs (rw,nosuid,nodev,noexec,relatime)
sdb 8:48 1 59.6G 0 disk
├─sdb1 8:49 1 55.9G 0 part /
├─sdb2 8:50 1 1K 0 part
└─sdb5 8:53 1 3.7G 0 part
rsync
is not a right tool to deal with this. How did you create the bootable USB? Please show us the exact partitioning of the original drive: the output offdisk -l /dev/sdb
,gdisk -l /dev/sdb
,file -s /dev/sdb
. In addition the output oflsblk
andmount
from within the booted OS will be useful. Do not respond in comments, edit the question instead. There are tools to clone (or semi-clone) the entire device, including bootloader. You may not be able to do this right from within the OS started from the device.