LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How can I get one harddrive alone when it was split up between 2? (https://www.linuxquestions.org/questions/linux-general-1/how-can-i-get-one-harddrive-alone-when-it-was-split-up-between-2-a-154612/)

anth2oo1 03-07-2004 12:13 PM

How can I get one harddrive alone when it was split up between 2?
 
Hello,
When I purchased my server from my provider, they made the redhat partitions incorrect.

My Setup
I have 2 40 gig Harddrives; I wanted one to be the primary, and the second to be the backup HD that I would make nightly backups to.


My HD Configuration

Code:

[root@main /]# df -k
Filesystem          1K-blocks      Used Available Use% Mounted on
/dev/hdb1            39571244  4509712  33051404  13% /
none                    451912        0    451912  0% /dev/shm
/dev/tmpMnt            193687        14    183673  1% /tmp
/dev/hda1              101089    13266    82604  14% /boot


My fstab
Code:

LABEL=/                /                      ext3    defaults,usrquota,grpquota      1 1
LABEL=/boot            /boot                  ext3    defaults        1 2
none                    /dev/pts                devpts  gid=5,mode=620  0 0
none                    /proc                  proc    defaults        0 0
none                    /dev/shm                tmpfs  defaults        0 0
/dev/hda2              swap                    swap    defaults        0 0
/dev/cdrom              /mnt/cdrom              udf,iso9660 noauto,owner,kudzu,ro 0 0
/dev/tmpMnt            /tmp                    ext2 loop,nosuid,noexec,rw 0 0

My Dilemma

Unfortunatly, everything is all setup and when I went to go and setup my backups, I saw this discrepancy. So I cant format and reinstall redhat, it would be too much to redo everything.

If you see above, /dev/hdb1 is one of the 40 gig HDs, the second one obviously. But it you look at /boot, its on the first HD, and only 100 megs of the first HD is set to /boot. That makes the other 39 some odd gigs non-partitioned.

My Question

I would like to know how I can get all the data, / , on /dev/hda1, have /boot as /dev/hda2 and my backup drive as /dev/hdb1.

Is this possible without reformatting?


Thank you very much.

andzerger 03-07-2004 12:35 PM

boot from a bootdisk, mount hdb1 on /tmproot1, mount hda? on /tmproot2
just copy everything on hdb1 to hda? with 'cp -a * /'
then edit your fstab to mount hda? as /

you need to use a bootdisk so that you arnt copying active devices and processes when you cp -a


All times are GMT -5. The time now is 05:23 PM.