Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Installing Gentoo
  • Search

Moving old gentoo install to new hard drive [solved]

Having problems with the Gentoo Handbook? If you're still working your way through it, or just need some info before you start your install, this is the place. All other questions go elsewhere.
Post Reply
Advanced search
31 posts
  • Previous
  • 1
  • 2
Author
Message
gerard27
Advocate
Advocate
Posts: 2377
Joined: Sun Jan 04, 2004 3:30 pm
Location: Netherlands

  • Quote

Post by gerard27 » Wed Apr 07, 2010 8:58 am

@Yamakusure,
Like I said never any problem.
When you use an external OS the /proc and /sys directories of the partition
to be copied are empty.
The /dev directory will be overwritten at the next boot.
I do this on my own box and my wifes lappy.
It takes more diskspace than compressing programs that's all.
I doubt that it's slower.
What I also use it for is to defrag after a major upgrade like kde3.5 => kde4.
Gerard.
To install Gentoo I use sysrescuecd.Based on Gentoo,has firefox to browse Gentoo docs and mc to browse (and edit) files.
The same disk can be used for 32 and 64 bit installs.
You can follow the Handbook verbatim.
http://www.sysresccd.org/Download
Top
Yamakuzure
Advocate
Advocate
User avatar
Posts: 2323
Joined: Wed Jun 21, 2006 11:06 am
Location: Adendorf, Germany
Contact:
Contact Yamakuzure
Website

  • Quote

Post by Yamakuzure » Wed Apr 07, 2010 12:27 pm

@gerard82: Thanks for the info! :)
Edited 220,176 times by Yamakuzure
Top
elensia
n00b
n00b
Posts: 11
Joined: Mon Mar 01, 2010 7:16 pm

  • Quote

Post by elensia » Tue Apr 20, 2010 9:37 pm

I decided to use gerard82 method and did work and solved the
problem for me.

Code: Select all

mount /dev/<original> /mnt/gentoo 
mkdir /mnt/backup
mount /dev/<new-partion> /mnt/backup 
cp -a /mnt/gentoo/* /mnt/backup
It worked fine and it copied the old gentoo install from
/dev/hda2 to the new hard drive and partition /dev/sda1

My current sheme is:

# fdisk -l

Code: Select all

Disk /dev/hda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x2ad92ad8

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1               1       10199    81920000    7  HPFS/NTFS
/dev/hda2   *       10199       19457    74367328+   7  HPFS/NTFS

Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xd982d982

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       29903   240195816   83  Linux
/dev/sda2           29904       30401     4000185   82  Linux swap / 
Solaris
After that i re-installed grub and made sure that i got everything
working properly from gentoo side.

# grub

Code: Select all

grub> root (hd1,0)
 Filesystem type is reiserfs, partition type 0x83

 setup (hd0)
 Checking if "/boot/grub/stage1" exists... yes
 Checking if "/boot/grub/stage2" exists... yes
 Checking if "/boot/grub/reiserfs_stage1_5" exists... yes
 Running "embed /boot/grub/reiserfs_stage1_5 (hd0)"...  20 sectors are 
embedded.
succeeded
 Running "install /boot/grub/stage1 d (hd0) (hd0)1+20 p 
(hd1,0)/boot/grub/stage2 /boot/grub/menu.lst"... succeeded
quit.
done
My working grub configuration is:

# cat /boot/grub/grub.conf

Code: Select all

splashimage=(hd1,0)/boot/grub/splash.xpm.gz

default 0
timeout 30

# Linux Partition /dev/sda1

# Genkernel 2.6.31-r10

title=Gentoo Linux 2.6.31-r10  (Genkernel )
root (hd1,0)
kernel /boot/kernel-genkernel-x86_64-2.6.31-gentoo-r10 root=/dev/ram0 
init=linuxrc ramdisk=8192 real_root=/dev/sda1
initrd /boot/initramfs-genkernel-x86_64-2.6.31-gentoo-r10

# Windows Partition /dev/hda1 

title=Microshit Widows
root (hd0,0)
makeactive
chainloader +1


title=Memtest86Plus (memory ram tester)
root (hd1,0)
kernel /boot/memtest86plus/memtest.bin
After this i was able to boot and use gentoo. The new gentoo install
worked but i was not able to access windows.
During this moment /dev/hda was like this as far i was remember

Code: Select all

   Device Boot      Start    Id  System
/dev/hda1   *          1        7  HPFS/NTFS
/dev/hda2                        83  Linux
/dev/hda3                        Linux swap / Solaris

/dev/hda1 was the marked as boot but i could not start windows
as windows didn't boot.

After moving gentoo to the new partition i deleted and created a new
/dev/hda partition which resulted in this:

Code: Select all

Disk /dev/hda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x2ad92ad8

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1               1       10199    81920000    7  HPFS/NTFS
/dev/hda2   *       10199       19457    74367328+   7  HPFS/NTFS
I didn't notice what happened but the new partition got marked as boot.

I played with grub at boot time editing from which partition from
/dev/hda but still no luck. I could not boot from windows anyway
but while playing with it i got some messages complaining about windows
MBR.

I assume that windows MBR got "killed"and that usually means bad
news.
I am also not able to mount /dev/hda1 to access the FS and
recover windows data by copy to another drive.

Code: Select all

# mount /dev/hda1 /mnt/windows/
mount: you must specify the filesystem type
#

Code: Select all

 mount -t ntfs /dev/hda1 /mnt/windows/
mount: wrong fs type, bad option, bad superblock on /dev/hda1,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

Code: Select all

NTFS driver 2.1.29 [Flags: R/O MODULE].
NTFS-fs warning (device hda1): is_boot_sector_ntfs(): Invalid boot 
sector checksum.
NTFS-fs error (device hda1): read_ntfs_boot_sector(): Primary boot 
sector is invalid.
NTFS-fs error (device hda1): read_ntfs_boot_sector(): Mount option 
errors=recover not used. Aborting without trying to recover.
NTFS-fs error (device hda1): ntfs_fill_super(): Not an NTFS 
volume.

If still possible how can i make it boot from windows or at least
to mount the partition to recover the data and re-install windows.

I also thought about install windows into /dev/hda2 and from
there with recover data software proceed to /dev/hda1 recovery
data.

If all my gentoo configurations are correct; what are your
recommendations ?
Top
yzg
Guru
Guru
Posts: 500
Joined: Sat Jun 18, 2005 11:56 am

  • Quote

Post by yzg » Wed Apr 21, 2010 3:10 am

I think dd is the simplest and fastest way for full backup of a partitions.

Code: Select all

dd  if=/dev/hda3  of=/mnt/backup/backup_file.raw
Top
bobspencer123
Guru
Guru
User avatar
Posts: 544
Joined: Mon Dec 19, 2005 1:50 am

  • Quote

Post by bobspencer123 » Wed Apr 21, 2010 1:22 pm

what disc is first in boot priority in your bios?

if it is the new sata drive you just put in then windows does not like being the second boot drive. You probably need to use the map function of grub to trick windows into thinking it is the first drive.

Code: Select all

title=Microshit Widows 
map (hd0) (hd1)
map (hd1) (hd0)
rootnoverify (hd0,0) 
makeactive 
chainloader +1 
or maybe just adding the rootnoverify (instead of root) will solve your problem).

so

Code: Select all

title=Microshit Widows 
rootnoverify (hd0,0) 
makeactive 
chainloader +1 
edit: I would use ntfs-3g to mount windows inside your gentoo install to make a backup if you wish. You have to emerge this program and then just do: mount -t ntfs-3g /dev/hda1 /mnt/windows --- or whatever
Increasingly becoming a 2 channel audio nut!
Top
elensia
n00b
n00b
Posts: 11
Joined: Mon Mar 01, 2010 7:16 pm

  • Quote

Post by elensia » Wed Apr 21, 2010 9:24 pm

bobspencer123 i checked all the hard drive options in the bios and everything was correct.



O also tried more grub options including rootnoverify (hd0,0) and also mount -t ntfs-3g /dev/hda1 /mnt/windows which also complained about not finding a valid NTFS partition.



Then i tried to recover the windows installation with a windows installation cd but all recovery options failed and some didn't even recognize teh filesystem.



I had another option to try to recover data from the old windows install which would be installing a new windows onto /dev/hda2 and then from there to use recovery software to recover data
from the old windows install on /dev/hda1 but i decided to simply redo the windows partitions and install a fresh new install of windows.



Currently this is what i have.


Code: Select all

# fdisk -l



Disk /dev/hda: 160.0 GB, 160041885696 bytes

255 heads, 63 sectors/track, 19457 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk identifier: 0x2ad92ad8



   Device Boot      Start         End      Blocks   Id  System

/dev/hda1   *           1          13      102400    7  HPFS/NTFS

Partition 1 does not end on cylinder boundary.

/dev/hda2              13       19458   156185600    7  HPFS/NTFS



Disk /dev/sda: 250.1 GB, 250059350016 bytes

255 heads, 63 sectors/track, 30401 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk identifier: 0xd982d982



   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1       29903   240195816   83  Linux

/dev/sda2           29904       30401     4000185   82  Linux swap / Solaris



Everything is working properly now.



I conclude this topic for me is solved using the method that gerard82 provided. It was simple and worked and allowed me to move my old gentoo install to a new partition and hard drive.



Thank you for all the help gentlemen :)
Top
Post Reply

31 posts
  • Previous
  • 1
  • 2

Return to “Installing Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic