LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 08-13-2007, 01:29 AM   #1
DJGCrusader
LQ Newbie
 
Registered: Aug 2007
Posts: 17

Rep: Reputation: 0
Unhappy incomplete ubuntu uninstal, grub wont let windows run,XP CD recovery mode not working


Okay, so I ran out of space on my Ubuntu partition, and it would not let me run it. So in Windows XP i wanted to resize the partitions to make it larger, however my ubuntu partition is uneditable, only deletable! so i desperately deleted it and the swap partition and resized XP to take the whole disk. shortly thereafter i get a blue screen error, and XP restarts. except it doesn't. grub prevents it from loading, showing error"22" i think. I read up using my Ubuntu live cd and found out i need to renew the mbr n get rid of grub. So i popped in my XP cd so ican use "fixmbr", pressed R and bam, "no hard drive detected, make sure its plugged in blah blah". i read up a bit more on my live cd that it must be the SATA driver thing. problem: it needs floppy disk drivers which i A. do not have and B. do not have a floppy DRIVE. back to Ubuntu, i thought lemme reinstall Linux from here. i got to the partition editor and set up lessening my XP install, making a 10 gig ex3 part with a 500mb swap. It said it could not change my xp ntfs part because it is inconsistent. "we suggest you run chkdsk /f in WIndows and restart twice. then try again" Thx a lot, retard, i would if i could BOOT TO XP! then i tried the instructions on this site: http://www.neowin.net/forum/index.php?showtopic=365026
by Markjenson. I did that to try to DD my mbr back and terminal said
Code:
ubuntu@ubuntu:~$ dd if=~/XP_MBR.bin of=/dev/hda bs=446 count=1
dd: opening `/dev/hda': Permission denied
ubuntu@ubuntu:~$ why?
dammbash: why?: command not found
ubuntu@ubuntu:~$ dammit
Problems:
1. NEED MBR BACK, BUT XP CD DOES NOT WANT TO GO INTO RECOVERY MODE!
2. UBUNTU TERMINAL DOES NOT SPEAK ENGLISH!

HELP! =\
 
Old 08-13-2007, 01:41 AM   #2
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
Really, this is a Windows problem. Microsoft should have integrated SATA drivers into the XP installation CD. Because they didn't, the recovery console will not work for you.

The only way to repair it from Linux is to manually write a new MBR with dd, as you have seen. That method should ( I can't say I have ever personally tried) work, but I suspect you are using the wrong device. /dev/hda would be the IDE primary master device. A SATA drive should show up as /dev/sda. hda is probably an IDE optical drive, or doesn't even exist on your system.

To find out what devices you have, run "fdisk -l" and read the output to see which device corresponds with the drive that has Windows installed.

Alternately...you could just buy a floppy drive for $5 on NewEgg. Or at least borrow a drive from another machine.
 
Old 08-13-2007, 02:25 AM   #3
DJGCrusader
LQ Newbie
 
Registered: Aug 2007
Posts: 17

Original Poster
Rep: Reputation: 0
ubuntu@ubuntu:~$ fdisk -l
ubuntu@ubuntu:~$ fdisk -i
fdisk: invalid option -- i

Usage: fdisk [-b SSZ] [-u] DISK Change partition table
fdisk -l [-b SSZ] [-u] DISK List partition table(s)
fdisk -s PARTITION Give partition size(s) in blocks
fdisk -v Give fdisk version
Here DISK is something like /dev/hdb or /dev/sda
and PARTITION is something like /dev/hda7
-u: give Start and End in sector (instead of cylinder) units
-b 2048: (for certain MO disks) use 2048-byte sectors
ubuntu@ubuntu:~$ dd if=~/XP_MBR.bin of=/dev/sda bs=446 count=1
dd: opening `/dev/sda': Permission denied
ubuntu@ubuntu:~$






heres what i did, no use. fdisk -l doesn't work.

Last edited by DJGCrusader; 08-13-2007 at 02:30 AM.
 
Old 08-13-2007, 02:32 AM   #4
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
The command is "fdisk" followed by a lowercase "L". L for "list".

But to see any output, you need to run the command as root. The same goes for trying to write the MBR, now that I think about it.
 
Old 08-13-2007, 02:37 AM   #5
DJGCrusader
LQ Newbie
 
Registered: Aug 2007
Posts: 17

Original Poster
Rep: Reputation: 0
how exactlydo i do this "as root"? and wen i do so should i stilluse SDA instead of HDA?
 
Old 08-13-2007, 02:43 AM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,130

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
"sudo fdisk -l"
And erasing the loader part of the MBR probably won't help.
 
Old 08-13-2007, 02:47 AM   #7
DJGCrusader
LQ Newbie
 
Registered: Aug 2007
Posts: 17

Original Poster
Rep: Reputation: 0
then what exactlyshould i do in that dd command?

btw
ubuntu@ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 60.0 GB, 60011642880 bytes
240 heads, 63 sectors/track, 7752 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 7752 58605088+ 7 HPFS/NTFS
ubuntu@ubuntu:~$



and ur from jersey too? lol its late here
 
Old 08-13-2007, 02:49 AM   #8
DJGCrusader
LQ Newbie
 
Registered: Aug 2007
Posts: 17

Original Poster
Rep: Reputation: 0
IT WORKED! lemme restart

ubuntu@ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 60.0 GB, 60011642880 bytes
240 heads, 63 sectors/track, 7752 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 7752 58605088+ 7 HPFS/NTFS
ubuntu@ubuntu:~$ sudo dd if=~/XP_MBR.bin of=/dev/sda bs=446 count=1
1+0 records in
1+0 records out
446 bytes (446 B) copied, 3.8483e-05 seconds, 11.6 MB/s
ubuntu@ubuntu:~$
 
Old 08-13-2007, 02:59 AM   #9
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Nice it worked. I have thought of trying it out for one machine where XP is running fine, but it's recovery console can't fix it's MBR..or rather it does *seem* to fix it, but after a reboot there's only blank black screen. Apparently it's not working. So now it has a Linux /boot with GRUB stuff on it, to boot the thing..I haven't had the courage to try and dd the image there, because XP's own tools fail (but seem to work; if they refused to work I'd try, but the failure signals there's something big wrong in there).

Another thing what bothers me is posting the file online, downloading it from there. What if it got altered in some place? I hoped the guy had checksums of it there too..so it could be checked. Well, another option is to visit a friend with a live-cd and grab his MBR's 446 first bytes..

EDIT: oops, sorry I thought the reboot was already done & tried booting Windows..well, let's hope it really worked.

Last edited by b0uncer; 08-13-2007 at 03:04 AM.
 
Old 08-13-2007, 03:02 AM   #10
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
Well...the write process succeeded, that doesn't mean it actually worked. There was no doubt that dd would enable him to write a new MBR to the disk, the issue is whether or not that MBR will actually boot Windows.

Until he comes back from that reboot, we don't know if that has happened or not.
 
Old 08-13-2007, 03:08 AM   #11
DJGCrusader
LQ Newbie
 
Registered: Aug 2007
Posts: 17

Original Poster
Rep: Reputation: 0
eh it didnt. blank sreen hehe.well where do we go from here?

is there anyway i can explore the bytes by where the grub/mbr are? or is there a way i can reinstall ubuntu by resizing my windows partition? it won't resize in Gparted and Qparted doesn't even detect it, as I've said before.

Last edited by DJGCrusader; 08-13-2007 at 03:15 AM.
 
Old 08-13-2007, 03:18 AM   #12
DJGCrusader
LQ Newbie
 
Registered: Aug 2007
Posts: 17

Original Poster
Rep: Reputation: 0
heres why: GParted 0.2.5

Resize /dev/sda1 from 55.89 GiB to 44.38 GiB ( ERROR )

check filesystem on /dev/sda1 for errors and (if possible) fix them ( ERROR )

ntfsresize -P -i -f -v /dev/sda1

ntfsresize v1.13.1 (libntfs 9:0:0)
Device name : /dev/sda1
NTFS volume version: 3.1
Cluster size : 4096 bytes
Current volume size: 60011610624 bytes (60012 MB)
Current device size: 60011610624 bytes (60012 MB)
Checking for bad sectors ...
Checking filesystem consistency ...
Accounting clusters ...
Cluster accounting failed at 833357 (0xcb74d): extra cluster in $Bitmap
Cluster accounting failed at 895779 (0xdab23): missing cluster in $Bitmap
Filesystem check failed! Totally 2 cluster accounting mismatches.
ERROR: NTFS is inconsistent. Run chkdsk /f on Windows then reboot it TWICE!
The usage of the /f parameter is very IMPORTANT! No modification was
and will be made to NTFS by this software until it gets repaired.
 
Old 08-13-2007, 03:22 AM   #13
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
At this point we better clarify what it is you want to be doing here.

If you just want to get a usable OS on the machine, why not just blow the whole thing away and install Ubuntu straight onto it? You won't have any SATA driver issue like with XP.

If you need data off of that XP drive, then you are probably better off just mounting it from a live CD and copying it all off to an external drive.

Getting XP installed onto it again isn't going to happen without the SATA drivers, and as already covered you don't have them, nor the floppy drive to enable loading them into the installer.

I think that NTFS-3G can check NTFS volumes, which might clear up that error, but I am not 100% sure on that.

Really, I think you are probably going to have to face the fact here that you destroyed your disk by making all those partition changes without understanding what you were doing. It happens, it isn't a big deal. Rather than spending all your time trying to fix the mess, it is usually a lot more efficient to just come at the problem from a different direction.

Last edited by MS3FGX; 08-13-2007 at 03:24 AM.
 
Old 08-13-2007, 03:37 AM   #14
DJGCrusader
LQ Newbie
 
Registered: Aug 2007
Posts: 17

Original Poster
Rep: Reputation: 0
NTFS-3G? is that a linux program? or a terminal command?
what i'm going to do is download and burn this http://www.sysresccd.org/Main_Page and supposedly i can run fixmbr off that. If it works, on xp i'llfix any errors and never touch linux again. if not, i'll get all my data off here and go ubuntu. at least it'ssomething. when school starts in september i can get it reimaged(its a semi-school issuedlaptop) with xp again


goodnight and thanks, i'll update tommorow when i sort this out. Thanks!

Last edited by DJGCrusader; 08-13-2007 at 03:38 AM.
 
  


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
Grub, Ubuntu and HP Recovery (not booting) greeklegend Linux - General 4 06-03-2006 09:38 AM
LILO wont run - Grub error dave`2005 Linux - Newbie 2 10-10-2005 10:54 AM
Grub remains after uninstal - Help! XJDenton Fedora 3 03-02-2005 07:47 AM
editing grub.conf in recovery mode dave37 Red Hat 2 12-01-2004 06:23 AM
can only run text mode x driver wont work in redhat 7.0 rob,carly Linux - Software 2 08-13-2003 04:48 PM

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

All times are GMT -5. The time now is 04:19 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