mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Linux

Reply
 
Thread Tools
Old 2015-04-08, 10:37   #1
LaurV
Romulan Interpreter
 
LaurV's Avatar
 
"name field"
Jun 2011
Thailand

24·613 Posts
Default Linux (debian/grub) help

I don't know if this fits in the "homework" help subforum, but as we don't have a "help for idiots" category, I will post it here.

I had a working Debian which took all the disk (500 gigs).

I used lots of linux tricks including gparted to delete the swap partitions, move and shrink the root partition (of course, I had to boot from a live image on usb stick for it, otherwise I could not dismount the root) to half the disk. I created back the swap partition and its mirror or whatever is called.

I tested the system and it was working properly, up to the last bit, in half of that disk.

I did this because I need Win XP SP2 (no, it is not a mistake, it is SP2) running in a computer (not virtual box image, physical computer) and there was no other PC available.

Of course, next step is to install XP.

It didn't work, because the computer is too new, and XP SP2 is too old, and it has no idea about accessing/detecting SATA2 disks. It took me two days to realize why it can't detect the HDD at all and it was always asking me to insert some SCSI driver (?!).

Luckily, and with a help of a colleague, we found out that the BIOS is quite clever, you can go there and set "how the OS sees your disks". We selected classical ATA and we could immediately install XP.

Now, the problem is, we can't boot linux, because windows is enough stupid to assume he is the only OS on the world, and erases the MBR or something like that. We can check the disk separately, and the linux partition is intact. We can also see it if we boot with the Debian live image from usb stick. But we have no idea how to mount it or how to access the files on it: when we try to use gparted, the partitions of the stick are shown and we can't switch to the partitions of the disk.

We tried all tricks we could find on the web to restore the linux boot (it was grub) but we are not able to do it. Somehow, the linux partition is accessible, we can see its content, but we can not mount it, unmount it, etc. We think that it is related to that bios setting which says "the OS sees the disk in SATA mode" or "not in SATA mode". Debian was installed before we switched, windows was installed after. If we switch it back, windows is crashing immediately after showing the "starting windows" message. If we switch it forth (ATA), windows loads normally. Installing a ext2fs tool in windows, we can see the linux partition, but we can't read most of the files (rights? different addressing?)

We would need a walk through like for blinds. Like for blind idiots I mean, not normal blinds.

We are windows guru, but we don't know much linux. We are thinking if it won't be better to use grub for windows or so....

It is still unknown if Debian could run AFTER we changed the disk type in BIOS. We didn't test that before installing XP, and that was a mistake.

Technically, we could completely reinstall Debian from XP, if we could recover few (about 10) files from the actual partition, which are very important and we don't want to lose.

Another annoying thing is that we can't access the net from actual XP, the eth card is too new and it would need a driver. We don't need to access the net for the task we have to do in XP, but we still can handle a driver update after a couple of files exchanged manually with a stick.

Advices?

(thanks a billion in advance)

edit: I see from the "similar topics" that appears down the page that we have a "linux" subforum. Maybe some mod can move this topic there, thanks!

Last fiddled with by LaurV on 2015-04-08 at 10:43
LaurV is offline   Reply With Quote
Old 2015-04-08, 10:47   #2
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

5·787 Posts
Default

Usually, with a dual boot you have to run "grub-install" possibly with the "/dev/sda" or whatever the debian sees the device as. This should be done by booting the installation media (and maybe entering a rescue mode ). HTH

Last fiddled with by paulunderwood on 2015-04-08 at 10:48
paulunderwood is offline   Reply With Quote
Old 2015-04-08, 18:04   #3
Nick
 
Nick's Avatar
 
Dec 2012
The Netherlands

2·3·293 Posts
Default

When you say that you can see Linux on the hard disk after booting the Debian live from USB, how do you see it?
If you reset the BIOS to the original setting and boot Linux either from a USB stick or (as Paul suggests) with the "recovery" mode on an installation DVD, you should be able to mount the hard disk and secure the 10 important files you want before trying anything else.
Nick is online now   Reply With Quote
Old 2015-04-17, 07:26   #4
LaurV
Romulan Interpreter
 
LaurV's Avatar
 
"name field"
Jun 2011
Thailand

24·613 Posts
Default

We solved this problem, after back-ups and completely reinstalling Debian in ATA mode.
Thanks for ppl who tried to help.

Just to point that nothing along the lines "reinstall grub after installing windows" from the web (many tutorials in the wild there) was working, even when we went very intimately with grub, we always got strange errors at the >root and >setup steps in the grub tutorial. We tried to use Ubuntu live, as the people on web complain about the multitude/futility on the Debian live, and we found out that the people on web are right about it, the Ubuntu live CD offers much more functionality (it should not matter what we use for installing grub, the grub should be the same in both, and the booting process should be transparent from one to the other, assuming we can restore the booting chain, but we were not able to, it seems like win xp destroyed the MBR, which was expected, but none of the MBR images we were able to restore did work properly, they were not able to properly boot Debian).
We also read on the web what is the difference between the two addressing modes of the disk and we decided that is not good to keep files written with one after we changed to the other, so a backup of important files, reformat of the linux partitions (half of the disk) and re-installation of Debian was the best solution.
Strange was the fact that we could not write the boot sectors even if we tried to reinstall Debian, unless we selected "format the partition and delete all data" (as opposite to "keep the existing data", we tried to "cheat it" like stopping it after reinstalling grub, which is a step in the middle of the list, but it didn't want to install grub unless we formatted the partition, which we suspect is again something related to that addressing mode of the disk...)

Fun part, in all this process, we reached a stage where we could not boot neither linux nor windows, no matter what we do, but booting from USB we could see all partitions were intact.

After Debian was installed and we put the files back from the backup, we restarted it and surprise, it asked us if we want to boot in Debian or in Windows XP. Of course, we tried both versions and they work as expected. Win XP partition was not damaged at all by our trial-and-fail process (it would not matter anyhow, as it was just a fresh installation).

Lesson learned: when you want dual boot, install windows first, THEN install whatever linux AFTER.

Last fiddled with by LaurV on 2015-04-17 at 07:35
LaurV is offline   Reply With Quote
Old 2015-04-17, 09:06   #5
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

1111010111112 Posts
Default

Even if there is no grub recovery feature with the Debian installation media, I am sure you don't have to reinstall the whole of the operating system. Maybe it is a case of mounting various things like the paritition, "dev", "proc", "sys" etc and chroot'ing, and then running "grub-install".

https://www.youtube.com/watch?v=8lod8sRb_6I

Last fiddled with by paulunderwood on 2015-04-17 at 09:14
paulunderwood is offline   Reply With Quote
Old 2015-04-17, 09:49   #6
LaurV
Romulan Interpreter
 
LaurV's Avatar
 
"name field"
Jun 2011
Thailand

24×613 Posts
Default

Tried MANY things similar with what you linked. Nothing worked. Tried this tutorial (and few similar) step by step and some recovery mode. The freaking part is that Debian Live CD does not have Grub, neither parted, and you have first to apt-get update, apt-get install grub, etc. Tried Debian Live and Ubuntu Live, tried install/recovery. Ubuntu seems much better here, but still not successful. The problem with Debian is that there are 100 different "live CDs", and scarcely documented, I may not have the right one, neither time to dld 20 different images, each image around 1GByte. Tried to reinstall Debian completely without deleting the existent files - the Debian installation offers this, and I expected it to succeed till after the Grub is installed, then I could break it and exit - dream on! - the installation CD could not install Grub unless I formatted the Debian root partition. Remember that Debian was installed in AHCI mode and then (because WinXP has no idea what that is) the disk access was switched to ATA. I assume THAT was my biggest problem. For example, after I found the stage1 file (see tutorials), when going to grub> menu, after typing "root (hd0,blah)" (which went ok) then "setup (hd0,blah)", this gave me an "error 3315" or something like that, I never heard about and neither I could find any helpful advice on the web.
It may be me...

Anyhow, all is well when it ends well.

Last fiddled with by LaurV on 2015-04-17 at 09:51
LaurV is offline   Reply With Quote
Old 2015-04-24, 03:13   #7
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

24×257 Posts
Default

I know I'm coming late with info that isn't of any real value, but I succeeded in recovering Grub on a laptop recently, when I installed Vista after Ubuntu 12.04 had been the sole OS for ages. I had to step through a procedure manually, but I was lucky in that I found the one that worked, or due to it being Ubuntu (or, to it being an old Ubuntu)...

Edit: In case it is of interest to future readers, I used the following link:

Fixing a Broken System

I had to to use the "via the LiveCD terminal" section steps.

Last fiddled with by EdH on 2015-04-24 at 03:25
EdH is offline   Reply With Quote
Old 2015-04-24, 05:56   #8
Dubslow
Basketry That Evening!
 
Dubslow's Avatar
 
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88

3×29×83 Posts
Default

Quote:
Originally Posted by EdH View Post
installed Vista
wat
Dubslow is offline   Reply With Quote
Old 2015-04-24, 06:40   #9
LaurV
Romulan Interpreter
 
LaurV's Avatar
 
"name field"
Jun 2011
Thailand

24·613 Posts
Default

Quote:
Originally Posted by Dubslow View Post
wat
Ha! don't laugh, I still have my Sony FW laptop running Vista. It is quite ok. Long ago in the past I tried a change/update, but I ran into "no available drivers" problems (honestly, Sony sucks at laptops, but at that time it was the only one with 1920*1080 resolution, the screen is still one of the best I have ever seen for a laptop).
LaurV is offline   Reply With Quote
Old 2015-04-24, 07:12   #10
Dubslow
Basketry That Evening!
 
Dubslow's Avatar
 
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88

3·29·83 Posts
Default

Quote:
Originally Posted by LaurV View Post
Ha! don't laugh, I still have my Sony FW laptop running Vista. It is quite ok. Long ago in the past I tried a change/update, but I ran into "no available drivers" problems (honestly, Sony sucks at laptops, but at that time it was the only one with 1920*1080 resolution, the screen is still one of the best I have ever seen for a laptop).
Yeah, but he said he was *just* trying to *install* Vista.

Totally different than having a super old one still going.
Dubslow is offline   Reply With Quote
Old 2015-04-24, 15:39   #11
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

24·257 Posts
Default

Quote:
Originally Posted by Dubslow View Post
Yeah, but he said he was *just* trying to *install* Vista.

Totally different than having a super old one still going.
Long story: I rarely use Windows for anything, but I can't get my USB IC programmer to run under linux** and I needed it for a trip. My laptop had a Vista license on it so I compressed the Ubuntu partition and installed Vista. (I didn't "try," I did.) Of course the grub went away, so I followed the above routine and got it back.

**that includes in a virtual Win machine
EdH is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Howto start mprime automically for (Debian) Linux joblack Software 26 2018-11-05 11:18
Debian PSA Xyzzy Linux 12 2017-06-19 04:15
Troubles with Debian Netinst ET_ Linux 4 2007-03-13 20:41
Debian developer needed... Xyzzy Linux 5 2006-06-01 14:56
GRUB IronBits Teams 0 2003-07-05 15:20

All times are UTC. The time now is 17:26.


Sat Dec 4 17:26:14 UTC 2021 up 134 days, 11:55, 1 user, load averages: 1.27, 1.35, 1.33

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.