LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 08-26-2005, 03:07 AM   #1
Jakeh2k1
LQ Newbie
 
Registered: Oct 2004
Posts: 20

Rep: Reputation: 0
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
 
Old 08-26-2005, 04:04 AM   #2
Nathanael
Member
 
Registered: May 2004
Location: Karlsruhe, Germany
Distribution: debian, gentoo, os x (darwin), ubuntu
Posts: 940

Rep: Reputation: 33
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
 
Old 08-26-2005, 09:08 AM   #3
Jakeh2k1
LQ Newbie
 
Registered: Oct 2004
Posts: 20

Original Poster
Rep: Reputation: 0
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
 
Old 08-26-2005, 09:45 AM   #4
Nathanael
Member
 
Registered: May 2004
Location: Karlsruhe, Germany
Distribution: debian, gentoo, os x (darwin), ubuntu
Posts: 940

Rep: Reputation: 33
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
 
Old 08-26-2005, 09:49 AM   #5
Nathanael
Member
 
Registered: May 2004
Location: Karlsruhe, Germany
Distribution: debian, gentoo, os x (darwin), ubuntu
Posts: 940

Rep: Reputation: 33
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

:-)
 
Old 08-26-2005, 09:50 AM   #6
Jakeh2k1
LQ Newbie
 
Registered: Oct 2004
Posts: 20

Original Poster
Rep: Reputation: 0
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
 
Old 08-26-2005, 10:09 AM   #7
Nathanael
Member
 
Registered: May 2004
Location: Karlsruhe, Germany
Distribution: debian, gentoo, os x (darwin), ubuntu
Posts: 940

Rep: Reputation: 33
what does fdisk -l give you?

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

Last edited by Nathanael; 08-26-2005 at 10:10 AM.
 
Old 08-26-2005, 08:22 PM   #8
Jakeh2k1
LQ Newbie
 
Registered: Oct 2004
Posts: 20

Original Poster
Rep: Reputation: 0
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
 
Old 08-27-2005, 04:22 AM   #9
Nathanael
Member
 
Registered: May 2004
Location: Karlsruhe, Germany
Distribution: debian, gentoo, os x (darwin), ubuntu
Posts: 940

Rep: Reputation: 33
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.
 
Old 08-28-2005, 03:23 PM   #10
Jakeh2k1
LQ Newbie
 
Registered: Oct 2004
Posts: 20

Original Poster
Rep: Reputation: 0
the old hdd isn't bootable unfortuantely.

Ah well, nevermind

THanks for your help though! much appreciated


Jack
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
recover data from formatted hdd sebastiano Linux - General 5 03-27-2006 08:40 AM
hdd data problem b4u Linux - Hardware 1 06-26-2005 10:52 AM
Installing a second HDD (with old data) conn-fused Linux - Hardware 2 10-08-2004 06:01 PM
Migrate data from RHC1 to RHFC1.92 install jmanjohn61 Linux - Distributions 0 05-15-2004 07:21 AM
Do i loose my data when i reparition my HDD exley Linux - Newbie 3 12-28-2003 06:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 06:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration