Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
transfering data to new hdd
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
mrpaper
n00b
n00b


Joined: 18 Jun 2006
Posts: 4
Location: texas

PostPosted: Tue Sep 18, 2007 4:37 am    Post subject: transfering data to new hdd Reply with quote

Hello everyone, I have a faulty sata drive and I purchased a new one to replace it, I believe my /home/ dir is located on the faulty drive and I don't know the first thing to begin transferring that to the new hdd. any help would be appreciated. I use reiserfs.

Thanks!
Back to top
View user's profile Send private message
xbmodder
Guru
Guru


Joined: 25 Feb 2004
Posts: 404

PostPosted: Tue Sep 18, 2007 4:46 am    Post subject: Reply with quote

plug both drives in
Let's say the bad drive is SDA
and the new drive is SDB
assuming you used the default gentoo partitioning scheme:
A) Swap the two drives and install gentoo on the good drive (as sda)
B) Swap the drives back
C) From a livecd do this:
Code:

mkdir /mnt/sda
mkdir /mnt/sdb
mount /dev/sda3 /mnt/sda
mount /dev/sdb3 /mnt/sda
rsync -av /mnt/sda/home/* /mnt/sdb/home/

_________________
http://xbmodder.us/
Back to top
View user's profile Send private message
mrpaper
n00b
n00b


Joined: 18 Jun 2006
Posts: 4
Location: texas

PostPosted: Tue Sep 18, 2007 4:54 am    Post subject: Reply with quote

So I need to install gentoo on the new drive from a livecd?

Is it possible to format the drive from my system and then, say, cp /home/ to the new drive?
Back to top
View user's profile Send private message
Bojan
Tux's lil' helper
Tux's lil' helper


Joined: 18 Oct 2004
Posts: 145
Location: € Matrix

PostPosted: Tue Sep 18, 2007 7:30 am    Post subject: Reply with quote

mrpaper wrote:
So I need to install gentoo on the new drive from a livecd?


It is not very clear to me - do you want to copy just your /home directory or the whole system?

In case you want to copy just your homedir rsyncing, as described earlier, is sufficient. You can boot from live cd or you can mount the new drive somewhere (e.g /mnt/sdab) and use rsync

Code:
rsync -av /home/* /mnt/sdb/



mrpaper wrote:
Is it possible to format the drive from my system and then, say, cp /home/ to the new drive?


Of course you can. Use fdisk. First check the installed drives by issuing fdisk -l
just to make sure, you won't format something you don't want to.

In case you want to copy the whole system, assuming that your /dev/sda is not corrupted in a way, you can build a custom stage 4. http://gentoo-wiki.com/HOWTO_Custom_Stage4
Back to top
View user's profile Send private message
mrpaper
n00b
n00b


Joined: 18 Jun 2006
Posts: 4
Location: texas

PostPosted: Tue Sep 18, 2007 3:52 pm    Post subject: Reply with quote

Well Im not sure exactly what is on which drive (I have two). But I believe when I installed gentoo way back in the day, that I put /home/ on this faulty drive, so I guess I just need to mv my /home/ directory to the new hdd. Is there a way I could check what is located on my hdd?

Thanks for the help so far. :D
Back to top
View user's profile Send private message
pdr
l33t
l33t


Joined: 20 Mar 2004
Posts: 618

PostPosted: Tue Sep 18, 2007 4:19 pm    Post subject: Reply with quote

Just run the "mount" command with no arguments. Also /etc/fstab will probably tell you in case you have some partitions you do not automount.
Back to top
View user's profile Send private message
Bojan
Tux's lil' helper
Tux's lil' helper


Joined: 18 Oct 2004
Posts: 145
Location: € Matrix

PostPosted: Tue Sep 18, 2007 8:29 pm    Post subject: Reply with quote

Code:
cat /etc/fstab | grep -e /dev

for more elegant output :)
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23093

PostPosted: Wed Sep 19, 2007 1:43 am    Post subject: Reply with quote

Since you speak of elegance, I must point out that you have engaged in a Useless Use Of Cat. :) When reading only one file, it is simpler to let grep read the file directly: grep -e /dev < /etc/fstab.
Back to top
View user's profile Send private message
tarpman
Veteran
Veteran


Joined: 04 Nov 2004
Posts: 1083
Location: Victoria, BC, Canada

PostPosted: Wed Sep 19, 2007 2:48 am    Post subject: Reply with quote

Hu wrote:
Since you speak of elegance, I must point out that you have engaged in a Useless Use Of Cat. :) When reading only one file, it is simpler to let grep read the file directly: grep -e /dev < /etc/fstab.

Or even let grep(1) read the file directly:
Code:
grep /dev /etc/fstab

;)
_________________
Saving the world, one kilobyte at a time.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum