incomplete ubuntu uninstal, grub wont let windows run,XP CD recovery mode not working
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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!
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.
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.
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:~$
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.
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.
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.