LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Server dead and restore image in other computer (https://www.linuxquestions.org/questions/linux-server-73/server-dead-and-restore-image-in-other-computer-4175593731/)

-Snake- 11-17-2016 12:03 PM

Server dead and restore image in other computer
 
Hello everyone, my server computer is dead, its a +10 years old (was my first pc) and hdd is broken. I dont want pay for other hdd for a 10 years old computer and i have for house a computer with dual core processor, the same memory RAM (1 GB).

The problem is that i did generate monthly image from full hdd server with dd command, but the question is... how can i restore the image in other different computer?

My old/broken computer is:

CPU: amd 64 bits monocore
RAM: 1GB

The "new" computer is:

CPU: 64 bits dual core "intel"
RAM: 1GB

The operative system is Debian 8.

Any ideas?

Thanks.

syg00 11-17-2016 03:29 PM

The "simple" answer is to dd the image to a new disk and boot it. This is unlikely to be satisfactory as the backup was of a system built for the hardware it had, not the new system it is to be restored to. Might work though.
Another option is to mount the partition(s) contained in the image and extract your data onto the new system - might (probably will) require re-installing some packages and reconfiguring the same. Might be worth fsck'ing the filesystems in the image before using them - hmmm, take another copy of the image before doing this. How did you dd the backup; with the system running, or from a livecd ?.

I have ranted in the past about dd being the worst backup option - certainly better than no backup at all.

jefro 11-17-2016 07:26 PM

I might be tempted to do a clean install on a new system. I say this only because there might be lingering remnants of who knows what on dd image.



Then I'd boot up a virtual machine with that dd image as raw or as above mount it to a file location. (agreed that a copy of dd image is better) Then copy off data as needed. If the image had any sort of malware then it could be copied over to the new install so you'd want to be aware of best practices.



Debian works pretty good on a dd to different hardware. Video and nic tend to be the issues if at all.

-Snake- 11-19-2016 11:12 AM

Hello, thanks for response to all.

Finally I restore iso image in the other computer, After fighting with the new network card the server is working 100%, and more fast that before because is a dual core CPU.

Only one question more, The new hdd is more big that old, the old is 160 GB and new is 230 GB, how can i use 230 GB and not 160?

Thanks.

syg00 11-19-2016 03:07 PM

This is another reason dd is a bad option - devise a better backup strategy.

May be as simple as adding new partitions, may be you need to resize and/or move partitions to accommodate - depends on current layout and your plans. If you want assistance post the output of these (use [code] tags so we can read it) - change /dev/sda as appropriate in need.
Code:

sudo lsblk -f
sudo parted /dev/sda "print free"


-Snake- 11-19-2016 04:38 PM

Quote:

Originally Posted by syg00 (Post 5632445)
This is another reason dd is a bad option - devise a better backup strategy.

May be as simple as adding new partitions, may be you need to resize and/or move partitions to accommodate - depends on current layout and your plans. If you want assistance post the output of these (use [code] tags so we can read it) - change /dev/sda as appropriate in need.
Code:

sudo lsblk -f
sudo parted /dev/sda "print free"


Yes, now i think that dd is not the better option, but is very simple.

lsblk -f

Code:

NAME  FSTYPE LABEL UUID                                MOUNTPOINT
sda                                                     
├─sda1 ext4        102002c2-79f5-4dd0-baf5-7996126ea7ce /
├─sda2                                                 
└─sda5 swap        927e70ff-1bf3-4279-acb4-772d4b2874cf [SWAP]

parted /dev/sda "print free"

Code:

Model: ATA WDC WD2500AAJS-0 (scsi)
Disk /dev/sda: 250GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start  End    Size    Type      File system    Flags
        32,3kB  1049kB  1016kB            Free Space
 1      1049kB  158GB  158GB  primary  ext4            boot
        158GB  158GB  1048kB            Free Space
 2      158GB  160GB  2145MB  extended
 5      158GB  160GB  2145MB  logical  linux-swap(v1)
        160GB  250GB  90,0GB            Free Space

Thanks.

syg00 11-19-2016 05:16 PM

If you simply want to extend the root, swapoff then delete the swap and extended partition - reallocate the swap at end of disk; fix fstab if it uses UUID.
Reboot to check, then use gparted liveCD to extend the root partition - it will also adjust the ext4 filesystem at the same time. Simple and effective.
You can also do the swap from gparted if you wish.

-Snake- 11-20-2016 04:16 AM

Quote:

Originally Posted by syg00 (Post 5632484)
If you simply want to extend the root, swapoff then delete the swap and extended partition - reallocate the swap at end of disk; fix fstab if it uses UUID.
Reboot to check, then use gparted liveCD to extend the root partition - it will also adjust the ext4 filesystem at the same time. Simple and effective.
You can also do the swap from gparted if you wish.

Thanks very much!!! I did not think it was that easy, now i use full new hdd :)


All times are GMT -5. The time now is 02:22 AM.