D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Server adventure

 

On 14/01/16 11:40, Martin Gautier wrote:
> Hi all
> 
> First the good news. My office LAMP/IMAP/SAMBA server died over-night.
> Turns out it was the mobo. I took the drive out of the old machine,
> plopped it into a donor machine (both 64 bit Intel), booted and up it
> came - lovely. No LAN though. Turns out the NIC hardware was different
> so I loaded the correct module, adjusted the /etc/network/interfaces
> file to swap eth0 to eth1 (Linux thought I'd added a new NIC so assigned
> it eth1), rebooted and voila, 100% running server - no probs. The donor
> pc has a larger RAM capacity so after stuffing it to the gills, I'm
> actually up on the deal.
> 
> The bad news is that both machines are mini-atx form factor. I can't
> swap the cases (different PSU layouts) and the drive slot on the donor
> is 2.5" whereas the server drive 3.5".
> 
> I do have a spare 2.5" 500Gb drive (the 3.5" is 320Gb).
> 
> Does anyone know the best way to do a straight data/partition transfer
> from the old drive to the new one whilst allowing the full 500Gb
> capacity to be available at the end?
> 
> With the new RAM (4Gb up from 1Gb), do I need to adjust the swap
> partition whilst I'm at it?
> 
> Any suggestions would be appreciated.

dd the disk contents over, use gparted (live bootable ISO freely
available and highly recommended) to finesse any partition weirdness
(boundaries don't match, etc) afterwards. Also convert the ext3
partitions to ext4 whilst you're at it.

Ignore the rsync advice - won't copy boot blocks or MBR stuff, otherwise
it would be perfect.

Turn off the stupid UDEV rule for uniquely naming devices and get eth0
back as the rightful name for your preferred bit shunter.

The swap rule died years ago - swap is used to dump crashed kernels
nowadays, nothing else. Turn off swap.

"1Gb RAM" in a "server". Haha, no. That's not a server, that's a relic.
Let me guess, this is/was one of those hateful HP Microservers right?

Good luck with the recovery though - sounds like plain sailing but you
never know until you're half way through the disk transfer... :|

* whoops, nearly didn't answer the direct question which was:

> Does anyone know the best way to do a straight data/partition transfer
> from the old drive to the new one whilst allowing the full 500Gb
> capacity to be available at the end?

Yes, dd it. To skirt size issues, use gparted (or anything live and
bootable that understands linux partitions and has fdisk/parted - again,
I highly recommend the gparted live iso) to resize the larger
partition/disk FIRST. Make it slightly smaller than the target
disk/partition, then dd it. Don't use rsync, it's not the right tool for
this job unless you like manually chainloading grub. Reboot and let
gparted take care of the rest (resizing disk to maximum capacity,
rewriting GPT headers, etc). Upgrade to a decent filesystem, convert MBR
to GPT whilst you're at it and then sit back and congratulate yourself
on another fine job.

Cheers
-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq