View previous topic :: View next topic |
Author |
Message |
mrpaper n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/gallery/BaldursGate/baldursgate2_edwin.gif)
Joined: 18 Jun 2006 Posts: 4 Location: texas
|
Posted: Tue Sep 18, 2007 4:37 am Post subject: transfering data to new hdd |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
xbmodder Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 25 Feb 2004 Posts: 404
|
Posted: Tue Sep 18, 2007 4:46 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
mrpaper n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/gallery/BaldursGate/baldursgate2_edwin.gif)
Joined: 18 Jun 2006 Posts: 4 Location: texas
|
Posted: Tue Sep 18, 2007 4:54 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
Bojan Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 18 Oct 2004 Posts: 145 Location: € Matrix
|
Posted: Tue Sep 18, 2007 7:30 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
mrpaper n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/gallery/BaldursGate/baldursgate2_edwin.gif)
Joined: 18 Jun 2006 Posts: 4 Location: texas
|
Posted: Tue Sep 18, 2007 3:52 pm Post subject: |
|
|
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. ![Very Happy :D](images/smiles/icon_biggrin.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
pdr l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/gallery/Southpark/avatar20.gif)
Joined: 20 Mar 2004 Posts: 618
|
Posted: Tue Sep 18, 2007 4:19 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
Bojan Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 18 Oct 2004 Posts: 145 Location: € Matrix
|
Posted: Tue Sep 18, 2007 8:29 pm Post subject: |
|
|
Code: | cat /etc/fstab | grep -e /dev |
for more elegant output ![Smile :)](images/smiles/icon_smile.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Hu Administrator
![Administrator Administrator](/images/ranks/rank-admin.gif)
Joined: 06 Mar 2007 Posts: 23093
|
Posted: Wed Sep 19, 2007 1:43 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
tarpman Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/194464846347fed31505afc.jpg)
Joined: 04 Nov 2004 Posts: 1083 Location: Victoria, BC, Canada
|
Posted: Wed Sep 19, 2007 2:48 am Post subject: |
|
|
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 |
![Wink ;)](images/smiles/icon_wink.gif) _________________ Saving the world, one kilobyte at a time. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|