D&C GLug - Home Page

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

Re: [LUG] Server adventure

 

One option is to clone the source drive onto the destination using dd or similar:

https://wiki.archlinux.org/index.php/disk_cloning

You can then resize the partitions to make use of the additional space:

https://geekpeek.net/resize-filesystem-fdisk-resize2fs/

https://www.howtoforge.com/linux_resizing_ext3_partitions

You may well want to increase the swap disk size (general recommendation is double your RAM) as with more memory you'll probably end up throwing more at the server than before. As a rule of thumb I try and steer clear of ever having to shrink partitions (have been burned in the past (desperate time sensitive times with no facility for taking a backup)) so it would probably be worth increasing your swap disk sooner rather than later.

You could clone the drive and then use fdisk to modify the partition table with larger data partition and swap using the steps above.

Alternatively you can just create a new partition table on the new drive and format it accordingly and then use rsync or similar tools to copy the files over as Gordon mentioned, for example (you won't want to exclude anything however):

https://wiki.archlinux.org/index.php/full_system_backup_with_rsync

Either way I would recommend running a live operating system and then copy the data. At least having both drives at the ready you have complete luxury to give whatever option a go with the freedom to try again.

It may also be worth doing extended S.M.A.R.T. tests on the new (and maybe old) drive before putting it into production. There are destructive read and write tests you can do if you really don't trust it but S.M.A.R.T. should give you a good indication.

Thanks,
Ben

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.

My old drive is:
fdisk -l

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 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
Disk identifier: 0x0004c017

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63   619145099   309572518+  83  Linux
/dev/sda2       619145100   625137344     2996122+   5  Extended
/dev/sda5 619145163 625137344 2996091 82 Linux swap / Solaris

sda1 and sda2 are using ext3.

Cheers

Martin




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