How to add a new / extra disk to server

Standard

DISCLAIMER:
You are following these suggestions at your own risk. We do not claim them to be correct, complete or working for you. We will not support the instructions. We will not be bound by any liabilities neither direct nor implied. YOU ARE ACTING AT YOUR OWN RISK. If you are not sure of what you are doing we suggest you contact an expert. Otherwise we are happy to be of service and your comments are appreciated: support@blue.net.au

  • Shutdown server when convenient
  • Install disk drive
  • Setup BIOS on bootup
  • Start server normally.
  • Go to command prompt
  • Type: fdisk /dev/hdc to configure the new partition and / or to get rid of the old (WIN) partition
  • /sbin/mkfs -c /dev/hdc1 (checks the drive before making the file system)
  • /sbin/mkfs /dev/hdc1 formats the new partiton(s)
  • e2fsck -c /dev/hdc1 will do a read test checking for bad blocks on the drive, again. This is important to do with pre-loved drives.
  • Edit /etc/fstab to include the new file system, so it is available when you restart the computer. This can also be done with linuxconf (in Config / File System / Access local drive)
  • You should also mount (also possible through linuxconf) the new file system. The command would be: mount /dev/hdc1 /aux
  • Then you can start using the new disk. REBOOTING (like in Windows) IS NOT NECESSARY.

Extract from the SLUG.org.au mailing list: REPLACING A DISK WITH ANOTHER

On Wed, 29 Mar 2000,

Matthias Oertli generated:
>Hi all,
>I need to copy the contents of a linux partition onto a bigger
>partition on a replacement harddisk. I’d like an exact copy with all
>the permissions intact, etc.
>Would a simple cp -a /oldhd/* /newhd/* do the trick is there a
>better way?

* get tomsrtbt distro, install onto a floppy.
* turn off putr, install new disk, leave in old disk
* boot tomsrtbt & login
* mount /dev/hdold /mnt (or whatever)
* mkdir /mntnew
* mke2fs /dev/hdnew (assuming that there is no filesystem on this disk already)
* mount /dev/hdnew /mntnew
* cd /mnt
* tar cf – * | (cd /mntnew ; tar xf -)
* wait for a while
* once done, check to make sure the /mntnew filesystem seems intact
* umount /mntnew and /mnt
* mount the root partition, edit /etc/fstab on *it* (not the tomsrtbt) to make sure you mount the new drive in the right place
* reboot
* take out tomsrtbt disk 😉 the important line here is the tar line, this will preserve symlinks (a few caveats apply) and permissions and everything while copying a directory tree to another directory/filesystem/etc hope this helps —

jamesw

I think that you’ll need the second tar to be “tar xfp” (I usually use “tar xvfp” for amusement’s sake).

Man tar says:
-p –same-permissions
–preserve-permissions

Extract all protection information. from which I have always concluded that without -p you get the operator (root’s) current permissions on everything.

You probably want an “l” or “–one-file-system” option on the first tar too, so that it doesn’t follow a symlink onto some partition other than /mntold.

— Andrew


Disclaimer:
By reading and/or using the information within this web page you agree to hold the author, publisher and all related entities harmless from any claim directly or indirectly related to the information given or the use of any part of the information on this web site. Use at own risk. No responsibility taken.