LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   incomplete ubuntu uninstal, grub wont let windows run,XP CD recovery mode not working (https://www.linuxquestions.org/questions/linux-newbie-8/incomplete-ubuntu-uninstal-grub-wont-let-windows-run-xp-cd-recovery-mode-not-working-576671/)

DJGCrusader 08-13-2007 01:29 AM

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! =\

MS3FGX 08-13-2007 01:41 AM

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.

DJGCrusader 08-13-2007 02:25 AM

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.

MS3FGX 08-13-2007 02:32 AM

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.

DJGCrusader 08-13-2007 02:37 AM

how exactlydo i do this "as root"? and wen i do so should i stilluse SDA instead of HDA?

syg00 08-13-2007 02:43 AM

"sudo fdisk -l"
And erasing the loader part of the MBR probably won't help.

DJGCrusader 08-13-2007 02:47 AM

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

DJGCrusader 08-13-2007 02:49 AM

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:~$

b0uncer 08-13-2007 02:59 AM

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.

MS3FGX 08-13-2007 03:02 AM

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.

DJGCrusader 08-13-2007 03:08 AM

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.

DJGCrusader 08-13-2007 03:18 AM

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.

MS3FGX 08-13-2007 03:22 AM

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.

DJGCrusader 08-13-2007 03:37 AM

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!


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