LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-19-2009, 02:41 PM   #1
Terramann
LQ Newbie
 
Registered: Oct 2009
Location: Buenos Aires
Distribution: Puppy, Ubuntu
Posts: 5

Rep: Reputation: 0
Can I restore my partitions?


Hi Linux Friends,

I have Ubuntu and Puppy distros and I've tried to install WinXP. I did something wrong when I tried to install WinXp, which I haven't succeed to install, and now I can't reboot Ubuntu. I restored MBR for UBuntu but it doesn't recognised my Linux partitions. However, Puppy live CD does access to my partitions but Gparted doesn't again.

How can I fix this?

Thanks in advance,

Regards,
 
Old 10-19-2009, 02:47 PM   #2
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
Windows doesn't get on with Linux, but Linux gets on with windows, I'd advise in future installing windows first and linux second. Still this can be saved, not by fixing the MBR but by going the full lenght re-installing Grub.

If you used a live version of Ubuntu to install it in the first place you should be able to use the grub-install command to restore it... however should it fail then you should be able to use this little link to restore grub after reinstalling it.
 
Old 10-19-2009, 04:38 PM   #3
ArfaSmif
Member
 
Registered: Oct 2008
Location: Brisbane Australia
Distribution: Fedora, Centos
Posts: 267

Rep: Reputation: 54
Windows XP needs to be installed first on your hard drive and then any Linux distro afterwards, as r3sistence has said.

If you need a full blown/dual boot Windows install you will need to install it into the first physical partition on disk and then Linux after.

However if you only need to use Windows XP occasionally, then you can install Windows as a virtual machine within your Linux installation using something like Sun Virtualbox or any of the Linux VM solutions.
 
Old 10-19-2009, 04:40 PM   #4
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339

Rep: Reputation: 231Reputation: 231Reputation: 231
Quote:
Originally Posted by ArfaSmif View Post
Windows XP needs to be installed first on your hard drive and then any Linux distro afterwards, as r3sistence has said.

If you need a full blown/dual boot Windows install you will need to install it into the first physical partition on disk and then Linux after.

However if you only need to use Windows XP occasionally, then you can install Windows as a virtual machine within your Linux installation using something like Sun Virtualbox or any of the Linux VM solutions.
nasty speed penelty
and also you can do it the other way
install ubuntu in a VM on XP
http://www.apcmag.com/how_to_dual_bo...lled_first.htm
http://www.apcmag.com/how_to_dual_bo...lled_first.htm
 
Old 10-19-2009, 06:06 PM   #5
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 7,288

Rep: Reputation: 1384Reputation: 1384Reputation: 1384Reputation: 1384Reputation: 1384Reputation: 1384Reputation: 1384Reputation: 1384Reputation: 1384Reputation: 1384
If you can see your partitions from Puppy, then run the fdisk -l command and post the output. Post the output of the /boot/grub/menu.lst file from Ubuntu (that's what you're trying to use right?) What command did you use to try to restore Grub to the mbr from Ubuntu?

Quote:
I did something wrong when I tried to install WinXp
What was the something wrong here? That's pretty vague an not helpful to getting help.
 
Old 10-19-2009, 09:54 PM   #6
Terramann
LQ Newbie
 
Registered: Oct 2009
Location: Buenos Aires
Distribution: Puppy, Ubuntu
Posts: 5

Original Poster
Rep: Reputation: 0
yancek,

Quote:
What command did you use to try to restore Grub to the mbr from Ubuntu?
Code:
grub
find /boot/grub/stage1
"hd0,5)"
root (hd0,5)
setup (hd0
Quote:
What was the something wrong here? That's pretty vague an not helpful to getting help.
Yes! You're right indeed. Unfortunately I don't remember...

Quote:
If you can see your partitions from Puppy, then run the fdisk -l command and post the output.
Code:
Disk /dev/sda: 82.3 GB, 82348277760 bytes
255 heads, 63 sectors/track, 10011 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1          73      586341   82  Linux swap / Solaris
/dev/sda2              74       10011    79826985    5  Extended
/dev/sda5              74        1190     8972271    e  W95 FAT16 (LBA)
/dev/sda6            3481       10011    52460226   83  Linux
Quote:
Post the output of the /boot/grub/menu.lst file from Ubuntu (that's what you're trying to use right?)
Code:
title		Ubuntu 8.10, kernel 2.6.27-14-generic
root		(hd0,4)
kernel		/boot/vmlinuz-2.6.27-14-generic root=UUID=2c627b7f-fb27-4dd7-954e-2202d5c11e0d ro quiet splash 
initrd		/boot/initrd.img-2.6.27-14-generic
quiet

title		Ubuntu 8.10, kernel 2.6.27-14-generic (recovery mode)
root		(hd0,4)
kernel		/boot/vmlinuz-2.6.27-14-generic root=UUID=2c627b7f-fb27-4dd7-954e-2202d5c11e0d ro  single
initrd		/boot/initrd.img-2.6.27-14-generic

title		Ubuntu 8.10, memtest86+
root		(hd0,4)
kernel		/boot/memtest86+.bin
quiet

title		Puppy Linux 430 frugal
rootnoverify	(hd0,5)
kernel		/puppy430/vmlinuz pmedia=idehd psubdir=puppy430 nosmp
initrd		/puppy430/initrd.gz
Regards!
 
Old 10-19-2009, 11:21 PM   #7
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 7,288

Rep: Reputation: 1384Reputation: 1384Reputation: 1384Reputation: 1384Reputation: 1384Reputation: 1384Reputation: 1384Reputation: 1384Reputation: 1384Reputation: 1384
Your menu.lst shows (hd0,4) as Ubuntu and (hd0,5) as Puppy. The only Linux partition you have, according to fdisk command, is sda6 which is (hd0,5) and that would be your Puppy install. No windows partitions. Assume you are able to boot Puppy off the hard drive? Your find command you posted, run from Grub, only shows the Puppy stage1. Your partition setup is a little unusual, the only primary partitions are swap and the extended partition. YOu'll need another primary for windows if you want to install it. When you restored Grub, you restored to Puppy partition not Ubuntu.

What's the FAT16 partition on sda5, I assume it's not a windows OS because it won't boot from a logical partition. I'd suggest you create another partition/partitions for Ubuntu and reinstall. If you plan to install windows, do that first and remember to create a primary partition for windows.
 
Old 10-19-2009, 11:29 PM   #8
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
From the menu.lst, it looks like Ubuntu was on sda5 (hd0,4). From the fdisk output it looks like you've tried to install windows on there. You can try to change the type of that partition to 83 using fdisk, but the windows install might already have wiped Ubuntu of it.

And your restore action found your puppy installation. Did you have puppy installed? You only mentioned a liveCD.
 
Old 10-20-2009, 06:57 AM   #9
Terramann
LQ Newbie
 
Registered: Oct 2009
Location: Buenos Aires
Distribution: Puppy, Ubuntu
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by yancek View Post
Your menu.lst shows (hd0,4) as Ubuntu and (hd0,5) as Puppy. The only Linux partition you have, according to fdisk command, is sda6 which is (hd0,5) and that would be your Puppy install. No windows partitions. Assume you are able to boot Puppy off the hard drive? Your find command you posted, run from Grub, only shows the Puppy stage1. Your partition setup is a little unusual, the only primary partitions are swap and the extended partition. YOu'll need another primary for windows if you want to install it. When you restored Grub, you restored to Puppy partition not Ubuntu.

What's the FAT16 partition on sda5, I assume it's not a windows OS because it won't boot from a logical partition. I'd suggest you create another partition/partitions for Ubuntu and reinstall. If you plan to install windows, do that first and remember to create a primary partition for windows.
Yes, I know that the partition is funny, I have created it some years ago in my first Linux steps and it has been working well, so I haven't changed it. I think, now is the moment to reconfigure all my partitions and install first Windows.

Regards.
 
Old 10-20-2009, 07:14 AM   #10
Terramann
LQ Newbie
 
Registered: Oct 2009
Location: Buenos Aires
Distribution: Puppy, Ubuntu
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Wim Sturkenboom View Post
From the menu.lst, it looks like Ubuntu was on sda5 (hd0,4). From the fdisk output it looks like you've tried to install windows on there. You can try to change the type of that partition to 83 using fdisk, but the windows install might already have wiped Ubuntu of it.

And your restore action found your puppy installation. Did you have puppy installed? You only mentioned a liveCD.
Yes, Ubuntu is actually installed on sda5 and Puppy on sda6, which is my Ubuntu home partition too. As far as I know, Ubuntu isn't wiped out. I can access to all the disk and all the information on it with Puppy Live CD, but I can't boot from it and Gparted shows me an empty HD. I've tried to install Windows on sda7, which is an FAT partition.

Despite the fact that I have a basic computer knowledge, I'm not very keen on Linux basic commands. Can you explain me more detailed how to change the partition to 83 using fdisk?

Thanks in advance!
 
Old 10-20-2009, 08:11 AM   #11
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
Either be root or use sudo, depending on the distro.
Code:
wim@aao:~$ sudo fdisk /dev/sda
[sudo] password for wim: 

Command (m for help): p

Disk /dev/sda: 8069 MB, 8069677056 bytes
255 heads, 63 sectors/track, 981 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xf5d28b9b

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         850     6827593+  83  Linux
/dev/sda2             851         981     1052257+  82  Linux swap / Solaris

Command (m for help):  t
Partition number (1-4): 1 replace this by your partition number
Hex code (type L to list codes): 83
Command (m for help):  w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
wim@aao:~$
And now I hope that my system still boots
 
Old 10-20-2009, 10:02 AM   #12
Terramann
LQ Newbie
 
Registered: Oct 2009
Location: Buenos Aires
Distribution: Puppy, Ubuntu
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks Wim!

I'll try it later (I have to work), and I keep you posted. In the meanwhile, I've partially solved it. Strange as it may seam, fdisk shows me the partitions partially, e.g. it doesn't show the home partition which is sda7, but Puppy does. I've changed menu.lst with the "new" order as it is shown by Puppy. Nonetheless, I want to fix it in order to learn more.

Regards.
 
Old 10-20-2009, 12:31 PM   #13
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 7,288

Rep: Reputation: 1384Reputation: 1384Reputation: 1384Reputation: 1384Reputation: 1384Reputation: 1384Reputation: 1384Reputation: 1384Reputation: 1384Reputation: 1384
If you are planning to install windows, you will need to create another primary partition as windows doesn't boot from a logical partition, at least according to microsoft. You can boot windows post W98 from a logical partition if you have another version of windows on a primary partition. or at least the boot files.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Cannot restore partitions from one computer to another. Both RAID0 HawaiiMike Linux - General 10 11-02-2009 11:37 AM
How can I backup/restore different partitions individually? n1c0_ds Linux - Hardware 10 09-07-2009 09:36 AM
LXer: Backup and Restore Linux Partitions Using Partimage LXer Syndicated Linux News 0 01-22-2007 10:54 AM
back up and restore disk partitions ekdya Debian 2 10-05-2006 04:43 PM
Ubuntu install deleted all my partitions - any way to restore them? Spitfire24 General 5 12-15-2005 06:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:15 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration