LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 04-18-2009, 11:36 PM   #1
xmrkite
Member
 
Registered: Oct 2006
Location: California, USA
Distribution: Mint 16, Lubuntu 14.04, Mythbuntu 14.04, Kubuntu 13.10, Xubuntu 10.04
Posts: 554

Rep: Reputation: 30
Moved OS to new hard drive, now partition info is all messed up.


Hello, I moved my ubuntu install to a new 1TB hard drive. I setup a 15GB partition for boot, a 1.5GB partition for swap, another 15GB partition which i use as a backup of my main partition, and the rest (900GB) for storage.

I used partimage to duplicate my main partition from the old drive over to this new one. The rest of the partitions i formatted but left blank.

I ran into a couple of problems getting it to boot off the new drive, and i realized i needed to copy the mbr over, so i used the DD command to do this.

Something went wrong. Now, when i open gparted up, it sees a 700GB partition as the boot partition, and 200+ GB of unformatted. However, if i do a df -h command, it sees 15GB total with 7+ being used.

I'm not sure what i should do to correct this other than redo the whole process of copying the original partition. Any ideas? Is there a simple fix i can do?
-Thanks
 
Old 04-19-2009, 01:02 AM   #2
Drakeo
Senior Member
 
Registered: Jan 2008
Location: Urbana IL
Distribution: Slackware, Slacko,
Posts: 3,716
Blog Entries: 3

Rep: Reputation: 483Reputation: 483Reputation: 483Reputation: 483Reputation: 483
As you I am really lost what you did. the dd command is very powerful. Things to do when copping a system.
there are programs that do this but I use puppy linux.

I put puppy in and boot into ram click on my hard drive I want to copy then click so it shows all hidden folders. then copy the system over to the drive how the major tree folder system. you know bin,boot,dev,etc,home,lib,media,mnt,opt,proc,etc etc.
after you coppied the tree you need to go to your new copy and change your /etc/fstab file so the location of your drive will boot.

Then use puppy to put a grub on your mbr then edit the /boot/grub/menu.1st file to boot according to your fstab file that is in sink with your system.
make sure you put the mbr on the new drive ok.
This may seam to be a harder way to do thing but not always do I want to copy everything over.
I am sure there is plenty of image programs to do this for you but theses steps have never let me down.
step one make the image copy
step two change the fstab to sync with system
step three use the grub or lilo to put the master boot record on the drive
step four boot system and look for errors if any.
It is impossible for me to know what you typed on your dd command but if you did not select the dd if=mbr.hda.25815 of=/dev/hda bs=512 count=1

My /boot/grub has this file in it(mbr.hda.25815) that is an image of my mbr that is then written to the hda but if your new drive is seen as sdb then you will have to do sdb then.
When you partition you must set the new drive to boot first. this creates a space on the first sector of the drive. for the mbr.
Good luck
 
Old 04-19-2009, 01:02 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
Start again.
- don't use partimage. If source and target partitions are (exactly) the same size maybe you can. Maybe.
- don't use dd on the MBR.

Create partitions on the target drive, and mkfs (or mkswap) filesystems on those (new) partitions. Then use "cp -a ..." (or rsync or similar) from a liveCD to copy each (non swap) partition in turn.
Then fix your bootloader and fstab (in need).
 
Old 04-19-2009, 08:48 AM   #4
xmrkite
Member
 
Registered: Oct 2006
Location: California, USA
Distribution: Mint 16, Lubuntu 14.04, Mythbuntu 14.04, Kubuntu 13.10, Xubuntu 10.04
Posts: 554

Original Poster
Rep: Reputation: 30
So basically do i need to just re-do the process? is there no way to fix this? (this is an htpc and it's a little drama to go switching the drives in and out because of the setup, that's why i want to try to repair the partition table if possible)

Also, why not use partimage, isn't that what it is designed for?

In the end, what i want to do is create a script or two so that i can boot into my backup partition and image the primary partition to a backup file, then reboot back into my primary partition and use that image to replace the backup partition. This way i always have a backup partition that is fairly up to date. I've been using partimage to do this and it's worked fine so far, but this time, i'm not sure what went wrong.

-Thanks for the help
 
Old 04-19-2009, 10:12 AM   #5
xmrkite
Member
 
Registered: Oct 2006
Location: California, USA
Distribution: Mint 16, Lubuntu 14.04, Mythbuntu 14.04, Kubuntu 13.10, Xubuntu 10.04
Posts: 554

Original Poster
Rep: Reputation: 30
OK, i went ahead and tried partimage a second time and this time it worked just fine. However, in gparted, it says my root partition is also mounted to /dev/.static/dev or something like that as well as being mounted to /.

Any ideas why this is, or should i start a new post? I am able to just umount that location, but that's kinda weird that it keeps remounting it upon boot.

-Thanks
 
  


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
Help: Moved ide hard drive to different computer and now it won't complete boot rbonafied Mandriva 1 09-25-2008 08:03 AM
Messed up my MBR, now GRUB and Extended Partition Info lost Q-Continuum SUSE / openSUSE 16 05-07-2007 02:29 AM
Moved hard drive with dual boot to another computer atlaika Linux - General 6 11-05-2005 05:38 AM
Moved my Hard Drive, now need HELP! dougp25 Linux - General 3 03-17-2004 11:55 AM
Hard drive partition info dai Linux - General 4 08-09-2002 06:13 AM

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

All times are GMT -5. The time now is 05:22 PM.

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