LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Need to migrate data from old HDD (https://www.linuxquestions.org/questions/linux-hardware-18/need-to-migrate-data-from-old-hdd-357136/)

Jakeh2k1 08-26-2005 03:07 AM

Need to migrate data from old HDD
 
Hi all,

I had a file system error on an old hdd, i now have a new hdd in my server, however i want to migrate the data from my old hdd which is attatched, and i'm completely lost as what to do :(

The old drive is on the system as /dev/hdc

Can anyone give me a run through on what to do please?


TIA

Jake

Nathanael 08-26-2005 04:04 AM

you mount a partition at a mountpoint, access the hdd via the mountpoint and copy data out ont the new hdd...
for this you will only need max 4 commands (i assume)

sfdisk -l #that is a lowercase L
use this to find out which partition of hdc you need to mount

mount
use this to mount the old hdd at a mountpoint

cd
use this to access the mountpoint (the directory under which your old hdd is now accessable)

and finaly
cp
stands for copy :-)

if you need help for either of these commands use man:
man <commandname> ie: man mount

Jakeh2k1 08-26-2005 09:08 AM

Hi Nathanael,

Thanks for the reply.

I've mounted it: "mount" returns this for the hdd:

/dev/hdc on /tmp/foo type ext2 (rw)

However, i can't cd to it, it says it's not a directory


Jack

Nathanael 08-26-2005 09:45 AM

that is because /dev/hdc is your entire drive... but you need to mount a partition, that is why i mentioned "sfdisk -l" because this will give you a more precise overview of what partition you are looking for, example:
Code:

fdisk -l output:


Disk /dev/hda: 19485 cylinders, 16 heads, 63 sectors/track
Units = cylinders of 516096 bytes, blocks of 1024 bytes, counting from 0

  Device Boot Start    End  #cyls    #blocks  Id  System
/dev/hda1  *      0+    61      62-    31216+  83  Linux
/dev/hda2        62    1053    992    499968  82  Linux swap / Solaris
/dev/hda3      1054  19484  18431    9289224  83  Linux
/dev/hda4          0      -      0          0    0  Empty

so here you can see that we will not want to mount /dev/hda2 since this is the swap space, hda1 looks ok, but it is too small, and i know that this is my /boot partition so in this case i would want to have a look at hda3. this means i do following:
mount /dev/hda3 /mnt/foo

Nathanael 08-26-2005 09:49 AM

mount to /mnt this directory is exactly for that purpose
mnt for mount

/tmp is only for temporary stuff...
tmp (short for temp) for temporary

:-)

Jakeh2k1 08-26-2005 09:50 AM

Hi,

Ok i've done that, now i've got /mnt/foo with just lost+found hehe.

Mounted ok, but sfdisk -l doesn't return a /dev/hdc option

fdisk -l returns it, but says

Disk /dev/hdc: 80.0 GB, 80026361856 bytes
16 heads, 63 sectors/track, 155061 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Disk /dev/hdc doesn't contain a valid partition table


Jake

Nathanael 08-26-2005 10:09 AM

what does fdisk -l give you?

or try using part /dev/hdc
hit p for the part. table
and hit q to exit

Jakeh2k1 08-26-2005 08:22 PM

fdisk -l returns:

Code:

[root@*]# fdisk -l

Disk /dev/hda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/hda1  *          1          13      104391  83  Linux
/dev/hda2              14        144    1052257+  82  Linux swap
/dev/hda3            145        9729    76991512+  83  Linux

Disk /dev/hdc: 80.0 GB, 80026361856 bytes
16 heads, 63 sectors/track, 155061 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Disk /dev/hdc doesn't contain a valid partition table


Part doesn't do anything

Jake

Nathanael 08-27-2005 04:22 AM

Quote:

Disk /dev/hdc doesn't contain a valid partition table
you might be better off trying this the other way round... try booting up from you old hdd, if that should work you can mount the new hdd (you will want to mount /dev/hda3)

but unless you have a backup of you parition table, i currently assume you dont, you will not be able to retrieve any data at all! (that is waht i think)

another bet woult be to google for 'doesn't contain a valid partition table'

sorry about that.

Jakeh2k1 08-28-2005 03:23 PM

the old hdd isn't bootable unfortuantely.

Ah well, nevermind

THanks for your help though! much appreciated :)


Jack


All times are GMT -5. The time now is 12:04 AM.