Results 1 to 6 of 6
  1. #1
    Join Date
    May 2004
    Location
    Malaysia
    Posts
    197

    Upgrading backup HDD

    Hello,

    I would like to replace my existing backup drive to a new one.

    Current: /backup
    /dev/sda3 20641788 4583524 15009624 24% /
    /dev/sdb1 241263968 121746992 107261392 54% /backup
    /dev/sda1 256666 21224 222190 9% /boot
    none 777300 0 777300 0% /dev/shm
    /dev/sda6 196618052 52100984 134529460 28% /home
    /dev/sda2 20641788 12885584 6707564 66% /var
    /var/tmpMnt 1007896 7304 949392 1% /tmp

    to a new 320GB new HDD.

    What is the step by step?

  2. #2
    1. Mount the new HDD under for instance /mnt/new_backup:
    mkdir /mnt/new_backup
    mount /dev/sd? /mnt/new_backup (/dev/sb? is the new HDD, you can list all the present HDDs using fdisk -l)
    2. Copy everything over:
    cp -a -R /backup/* /mnt/new_backup/
    3. unmount the old HDD:
    umount /backup
    Server Surgeon George
    http://www.serversurgeon.com
    Linux, BSD and Windows Administration Services
    Toll Free US 877-378-7436 International +1-213-291-9191

  3. #3
    Join Date
    Jul 2001
    Location
    Singapore
    Posts
    1,889
    Before mounting, you need to partition the new hdd and also create file system in the newly created partition.
    Giam Teck Choon
    :: Join choon.net Community today to share your tips and tricks on server issues please ::
    :: Singapore Dedicated Servers :: Singapore Virtual Private Servers :: Linux/FreeBSD Server Management ::

  4. #4
    Join Date
    Dec 2006
    Posts
    68
    You just need to format the new backup and mount

    mkfs.ext3 /dev/sd?

    mount /dev/sd? /new_backup

    Then copy the contents from old drive

    cp -rpf /backup/* /new_backup

    also don't forget to put the drive info in /etc/fstab

    /dev/sd? /new_backup ext3 defaults 1 2

    this will automatically mount the new backup after a reboot.


    After unmounting the new backup , you can rename the folder /new-backup to /backup. Also a corresponding entry in fstab also.
    Reverse engineering Rocks

  5. #5
    Join Date
    Oct 2004
    Location
    Southwest UK
    Posts
    1,175
    once you remove your old drive, will the device letters change? eg. if you have sda and sdb, then you add sdc, when you remove the old sdb from the system, you'll have 2 drives - sda and sdb.

    Its not something you do very often, how does linux enumerate HDD devices?
    Do not meddle in the affairs of Dragons, for you are crunchy and taste good.

  6. #6
    Join Date
    Nov 2005
    Posts
    352
    Quote Originally Posted by gbjbaanb
    once you remove your old drive, will the device letters change? eg. if you have sda and sdb, then you add sdc, when you remove the old sdb from the system, you'll have 2 drives - sda and sdb.

    Its not something you do very often, how does linux enumerate HDD devices?
    Yes, when you add/remove SCSI devices (and SATA as well, depending on the hardware), linux will rename the devices. (That is one reason why using disk labels to mount partitions is sometimes a convenient option.) Linux names the SCSI/SATA devices by the order they appear in the system, so the lowest SCSI id would be sda, the next would be sdb, etc. Standard IDE devices are named by how they are connected to the controller (primary master will always be hda, secondary slave will always be hdd, etc.). SATA drives (as well as any drive connected to an extra controller card) depend on what order the BIOS initializes the controller hardware.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •