Re: Restore backup to KVM

2017-09-30 Thread Reco
Hi. On Sat, Sep 30, 2017 at 03:42:03PM +0200, solitone wrote: > This is serious hacking :^) That's what they paying me for at office ☺. > On 30/09/17 13:04, Reco wrote: > > the next thing I have to suspect is that your backup misses > > /dev directory (possibly /proc and /sys). The cont

Re: Restore backup to KVM

2017-09-30 Thread solitone
This is serious hacking :^) On 30/09/17 13:04, Reco wrote: the next thing I have to suspect is that your backup misses /dev directory (possibly /proc and /sys). The contents for those are irrelevant. You simply do not have /dev, /proc, /sys in your root filesystem. No, I don't, you're perfectl

Re: Restore backup to KVM

2017-09-30 Thread Reco
Hi. On Fri, Sep 29, 2017 at 06:30:21AM +0200, solitone wrote: > On 28/09/17 08:58, Reco wrote: > > It's initrd that first tries to mount tmpfs filesystems on /root (and > > fails), and only *then* mounts your root filesystem to /root (with the > > intention to switch to it as /). > Also,

Re: Restore backup to KVM

2017-09-28 Thread Reco
Hi. On Fri, Sep 29, 2017 at 06:30:21AM +0200, solitone wrote: > On 28/09/17 08:58, Reco wrote: > > It's initrd that first tries to mount tmpfs filesystems on /root (and > > fails), and only *then* mounts your root filesystem to /root (with the > > intention to switch to it as /). > > Is t

Re: Restore backup to KVM

2017-09-28 Thread solitone
On 28/09/17 08:58, Reco wrote: It's initrd that first tries to mount tmpfs filesystems on /root (and fails), and only *then* mounts your root filesystem to /root (with the intention to switch to it as /). Is the stock initrd supposed to work like this? When I boot my production system, I end u

Re: Restore backup to KVM

2017-09-27 Thread Reco
Hi. On Wed, Sep 27, 2017 at 06:56:27PM +0200, solitone wrote: > On 27/09/17 14:01, solitone wrote: > > Although mkfs had warned me, I mistakenly formatted the entire file, > > like this: > > > > $ sudo mkfs.ext4 restore.img > > > > Now I've redone it the right way, using a loop device, a

Re: Restore backup to KVM

2017-09-27 Thread solitone
On 27/09/17 14:01, solitone wrote: Although mkfs had warned me, I mistakenly formatted the entire file, like this: $ sudo mkfs.ext4 restore.img Now I've redone it the right way, using a loop device, and I'll see how it goes. It's a struggle! Now that I partitioned the image file, it sees /

Re: Restore backup to KVM

2017-09-27 Thread solitone
On 27/09/17 08:56, Reco wrote: I'm curious to know how you'd achieve this. Although mkfs had warned me, I mistakenly formatted the entire file, like this: $ sudo mkfs.ext4 restore.img Now I've redone it the right way, using a loop device, and I'll see how it goes. Thank you!

Re: Restore backup to KVM

2017-09-27 Thread Reco
Hi. On Wed, Sep 27, 2017 at 09:39:50AM +0200, Thomas Schmitt wrote: > Hi, > > solitone wrote: > > > Partition Table: loop > > > 1 0.00B 96.6GB 96.6GB ext4 > > Reco wrote: > > I'm curious to know how you'd achieve this. > > The storage device (image file in this case) is unparti

Re: Restore backup to KVM

2017-09-27 Thread Thomas Schmitt
Hi, solitone wrote: > > Partition Table: loop > > 1 0.00B 96.6GB 96.6GB ext4 Reco wrote: > I'm curious to know how you'd achieve this. The storage device (image file in this case) is unpartitioned. If you have a MBR partition table ("msdos"), then you may achieve this by deleting all p

Re: Restore backup to KVM

2017-09-26 Thread Reco
Hi. On Tue, Sep 26, 2017 at 09:44:57PM +0200, solitone wrote: > On 26/09/17 17:31, Reco wrote: > > > On 26/09/17 13:01, solitone wrote: > > > > It's strange, since it finds /dev/sda, i.e. the entire disk: > > > > > > > > = > > > > [ 

Re: Restore backup to KVM

2017-09-26 Thread solitone
On 26/09/17 17:31, Reco wrote: On 26/09/17 13:01, solitone wrote: It's strange, since it finds /dev/sda, i.e. the entire disk: = [    6.438693] sd 0:0:0:0: [sda] 188743680 512-byte logical blocks: (96.6 GB/90.0 GiB) [    6.469182] sd 0:0:0

Re: Restore backup to KVM

2017-09-26 Thread solitone
On 26/09/17 17:31, Reco wrote: On Tue, Sep 26, 2017 at 01:12:52PM +0200, solitone wrote: However now it fails because it tries to mount /dev and /run on /root/dev and /root/run, rather than simply /dev and /run: = [...] Gave up waiting for

Re: Restore backup to KVM

2017-09-26 Thread Reco
Hi. On Tue, Sep 26, 2017 at 01:12:52PM +0200, solitone wrote: > On 26/09/17 13:01, solitone wrote: > > It's strange, since it finds /dev/sda, i.e. the entire disk: > > > > = > > [    6.438693] sd 0:0:0:0: [sda] 188743680 512-byte log

Re: Restore backup to KVM

2017-09-26 Thread solitone
On 26/09/17 13:01, solitone wrote: It's strange, since it finds /dev/sda, i.e. the entire disk: = [    6.438693] sd 0:0:0:0: [sda] 188743680 512-byte logical blocks: (96.6 GB/90.0 GiB) [    6.469182] sd 0:0:0:0: [sda] Write Protect is off

Re: Restore backup to KVM

2017-09-26 Thread solitone
On 26/09/17 08:46, Reco wrote: /dev/sda2 refers to the partition in QEMU disk that contains your restored root filesystem. I've got only one partition in my image file: = $ /sbin/parted alan_restore.img WARNING: You are not superuser. W

Re: Restore backup to KVM

2017-09-25 Thread Reco
Hi. On Mon, Sep 25, 2017 at 09:16:35PM +0200, solitone wrote: > On 24/09/17 11:51, Reco wrote: > > Cheat it then and run QEMU like this (I don't know what's your root > > filesystem is called, you may need to replace sda2 with something else): > > > > qemu-system-x86_64 -hda \ > > -k

Re: Restore backup to KVM

2017-09-25 Thread Reco
Hi. On Mon, Sep 25, 2017 at 09:05:25PM +0200, solitone wrote: > On 24/09/17 11:51, Reco wrote: > > ACLs are easy. Even tar(1) knows them. > > It's things like these that give you headache: > > > > $ /sbin/getcap /bin/ping > > /bin/ping = cap_net_raw+ep > > > > # lsattr /etc/resolv.conf >

Re: Restore backup to KVM

2017-09-25 Thread solitone
On 24/09/17 11:51, Reco wrote: Cheat it then and run QEMU like this (I don't know what's your root filesystem is called, you may need to replace sda2 with something else): qemu-system-x86_64 -hda \ -kernel \ -initrd \ -append "root=/dev/sda2 ro init=/bin/bash" Hi Rec

Re: Restore backup to KVM

2017-09-25 Thread solitone
On 24/09/17 11:51, Reco wrote: ACLs are easy. Even tar(1) knows them. It's things like these that give you headache: $ /sbin/getcap /bin/ping /bin/ping = cap_net_raw+ep # lsattr /etc/resolv.conf i-e /etc/resolv.conf # getfattr -d /var/log/messages # file: var/log/messages user.

Re: Restore backup to KVM

2017-09-24 Thread Reco
On Sun, Sep 24, 2017 at 10:58:42AM +0200, solitone wrote: > On 22/09/17 21:38, Reco wrote: > > 2) Your backup is made by rsync(1) or tar(1). > > > > Make yourself a file representing virtual machine disk. > > Apply parted/fdisk/whatever to make appropriate number of partitions > > inside it. Creat

Re: Restore backup to KVM

2017-09-24 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Sun, Sep 24, 2017 at 10:58:42AM +0200, solitone wrote: > On 22/09/17 21:38, Reco wrote: > >2) Your backup is made by rsync(1) or tar(1). > > > >Make yourself a file representing virtual machine disk. > >Apply parted/fdisk/whatever to make appropriat

Re: Restore backup to KVM

2017-09-24 Thread solitone
On 22/09/17 21:38, Reco wrote: 2) Your backup is made by rsync(1) or tar(1). Make yourself a file representing virtual machine disk. Apply parted/fdisk/whatever to make appropriate number of partitions inside it. Create filesystems. Mount these somewhere, invoke rsync(1)/tar(1) as needed. Ok,

Re: Restore backup to KVM

2017-09-22 Thread Reco
Hi. On Fri, Sep 22, 2017 at 09:10:28PM +0200, solitone wrote: > On 22/09/17 08:08, Reco wrote: > > Execute this on your source system. > > > > grep MODULES /etc/initramfs-tools/initramfs.conf > > > > If it says MODULES=most then you're in luck as it means your initrd > > contains all ker

Re: Restore backup to KVM

2017-09-22 Thread solitone
On 22/09/17 08:08, Reco wrote: Execute this on your source system. grep MODULES /etc/initramfs-tools/initramfs.conf If it says MODULES=most then you're in luck as it means your initrd contains all kernel modules for all kinds of hardware. And restoring from backup into QEMU-KVM means you only n

Re: Restore backup to KVM

2017-09-21 Thread Reco
Hi. On Fri, Sep 22, 2017 at 06:42:17AM +0200, solitone wrote: > It's time to test my backups. Apart from user files, I also back up system > files, except for the following directories that are excluded: /dev, > /lost+found, /media, /mnt, /proc, /run, /sys, /tmp. > > I would try and resto

Restore backup to KVM

2017-09-21 Thread solitone
It's time to test my backups. Apart from user files, I also back up system files, except for the following directories that are excluded: /dev, /lost+found, /media, /mnt, /proc, /run, /sys, /tmp. I would try and restore them to a virtual machine (KVM). Would it be possible? Is there a way to c