LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Missed hard drive after installing Debian (https://www.linuxquestions.org/questions/linux-newbie-8/missed-hard-drive-after-installing-debian-4175412530/)

LaCaradeculito 06-20-2012 02:22 PM

Missed hard drive after installing Debian
 
Hi,

I've just installed Debian and missed one internal hard drive.

I used to have two of them, one (volume C: to Windows) running Windows XP and another one (E: ), ready for Debian install. The idea was to have OSs separated so to eliminate Windows by just formatting C:.

In partitions table settings I kept C: as NTSF (default), and E: divided into primary and swap parts. Does this give any clue?

By the end of the process I had a dialog going like: "Debian recognized MS Windows already installed. Do you want grub installed too so you can choose OS at start up?" Said ok, rebooted and I just found Debian and Debian recovery mode options. No Windows, and then volume C: didn't show up in file manager nor in media folder.

It appears in BIOS, but giving it booting priority just leave me with a blank screen and an underscore on top, blinking forever. Is there a way to look for the drive before attempting to repair the installation (hope not needed)?

Thanks in advance.

szboardstretcher 06-20-2012 04:20 PM

If you are just trying to find the drive, then you can:

Code:

fdisk -l
or
Code:

dmesg | grep Attached

LaCaradeculito 06-20-2012 09:46 PM

Hi, thanks very much for the tip. Currently, this is what I have. I'm just trying to decifer it. Hopefully the red highlighted part is not an empty drive that could be my lost (accidentaly erased) 150Gb one.

Any clue on this, kindly welcome and appreciated.
Best.


Code:

root@marcelosantorelli:/home/marcelo# fdisk -l

Disk /dev/sda: 164.7 GB, 164696555520 bytes
255 heads, 63 sectors/track, 20023 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xac9c0cf0

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1              1      20023  160834716    7  HPFS/NTFS
/dev/sda2  *      20024      20024        1724+  17  Hidden HPFS/NTFS

Disk /dev/sdb: 61.5 GB, 61492838400 bytes
255 heads, 63 sectors/track, 7476 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000746a1

  Device Boot      Start        End      Blocks  Id  System
/dev/sdb1  *          1        7352    59045888  83  Linux
/dev/sdb2            7352        7477    1003521    5  Extended
/dev/sdb5            7352        7477    1003520  82  Linux swap / Solaris
root@marcelosantorelli:/home/marcelo# dmesg | grep Attached
[    1.543979] sr 1:0:1:0: Attached scsi CD-ROM sr0
[    1.593705] sd 0:0:0:0: [sda] Attached SCSI disk
[    1.636990] sd 0:0:1:0: [sdb] Attached SCSI disk
[    1.667292] sd 0:0:0:0: Attached scsi generic sg0 type 0
[    1.669061] sd 0:0:1:0: Attached scsi generic sg1 type 0
[    1.670627] sr 1:0:1:0: Attached scsi generic sg2 type 5


szboardstretcher 06-20-2012 09:57 PM

That sda1 looks like an NTFS parition. It probably isn't mounted.

Um,.. youll have to install 'ntfs-3g' to be able to mount it. Which is an NTFS userspace driver.

Randicus Draco Albus 06-20-2012 11:43 PM

I would not dare try to give advice on repairing, but sda is your Windows system, with sda1 and sda2 being partitions. sdb is your Linux system. sda2 being hidden appears to be the problem. I do not want to give you bad advice about getting grub to recognise it.

abi0909 06-21-2012 05:40 AM

So here is what has happened - when you install Debian (or any unix flavour), the grub boot loader will replace your Windows Boot loader whixh is needed for Windows to boot directly. Hence, when you choose the Windows drive to be your primary boot device in the BIOS, it will not boot into Windows because there is no boot loader in windows and hence you see the blinking cursor. This does not mean that your Windows is corrupted - the only way to boot from your windows is by booting into the debian disk and then choosing Windows from there. You can also set it up to boot directly from Windows instead of booting into Debian (change the default flag in grub.conf - google for more info).

Now - Grub is smart and if it sees a Windows disk in your machine, it will automatically add it to your Grub menu and will display "Windows" in the Grub splash screen. If you do not see it, then you can "edit" the grub.conf and "add" windows partition into it, so that it will display it the next time. But be extra careful when you edit this file - any one mistake or typo, your Ubuntu will not boot either and you will need to boot into recovery mode to fix this file again. :)

In order to add Windows partition into the your grub - look at this page ---> http://wiki.debian.org/GrubConfiguration .. This explains how to edit your grub and so on and so forth !!

All the best ..

VDP76 06-21-2012 06:58 AM

hi LaCaradeculito,
I think, as abi0909 already said, that your WinXp partition (sda1) is just fine, it looks to me that sda2 is a hidden recovery partition.
The first simple thing I would try to do is
Code:

sudo update-grub
I won't edit grub.conf directly, if you want to make some changes you have to edit /etc/default/grub instead and then run sudo update-grub.

Hope this would help. :)

LaCaradeculito 06-21-2012 11:32 AM

Thanks so much!!!

I made a huge step forward with your explanation, even though I still couldn't look into links extensively. Just with update-grub Windows showed up, and it runs!. That was 90% of my concern since I achieved access to 150Gb I was afraid to have lost. My 10% left is all that data does not appear anywhere in Debian file system yet.

Meanwhile, I got an extra issue. When I chose Windows a next dialog gave two options:
- run Windows (ok, works)
- continue installation (hey, wasn't it finished!), on which I'm again stuck with cd-rom drivers issues, but working. So...

Maybe I still have chances to see that volume after the whole process, if the rest has something to do with the subject. I'll let you know.
Again thank you so much for your advices.

VDP76 06-21-2012 07:30 PM

I am glad I have been of help! :)

Now, for you first concern have a look here, particularly at the section about /etc/fstab (also see this).

About the "continue installation problem", is it about installing Win or Debian?? Anyway, can you finally get to the desktops of both OSs and use them?

LaCaradeculito 08-27-2012 09:51 PM

Hi guys:

new problems. I made the same mess, but inverted.

As I said before, I have two HD in on computer. One is running Debian, the other was working with a corrupted Windows xp that I intended to reinstall (first time I manage MS installation cds). I finally got Windows working fine, but:
1. don't have chance to choose OS at starting: Windows initiates directly
2. don't see the other volume
3. don't seems to exist any grub to update this time

Any clue? I'm freaking out. Thanks very much.
M.

LaCaradeculito 08-27-2012 10:21 PM

VDP76,

sorry for ignoring your kind message. I did't see it until I came back with more problems :)

Yes, during all this time I achieved to see both OSs desktops and work quite fine with the two. However, I never got Windows to see other volumes than the one it is installed in. On the other hand, Debian didn't give much trouble to do it after I got helped.

Thanks so much for the suggestions.

Best.

yancek 08-27-2012 10:43 PM

Re-installing xp overwrote the Grub code in the master boot record. Windows bootloaders won't detect a Linux install so you will either have to manually configure the windows bootloader to boot Debian or reinstall the Debian Grub. You should be able to do that with the Debian installation CD.

You can install Debian Grub to the mbr of sdb (assuming your Debian install is still on sdb?) or to sda. If the former, you can select in the BIOS to boot the Debian drive or the windows drive. If you install Debian Grub to sda, it will of course overwrite the windows boot code in the mbr there but it should create an entry for windows. Post back on which method you would prefer and someone will explain the steps.

VDP76 08-28-2012 03:21 AM

LaCaradeculito,
as mentioned by yancek your MBR has been overwritten by windows install, so now you have to restore GRUB. If you want to do it "manually", see this how-to on chrooting, for that you'll need a live cd (Debian-live or Crunchbang would be ok).
Otherwise a "automatic-GUI" way is using Rescatux (which is also a well documented project).

Finally, you want to see Debian's partitions from windows..well that doesn't come out of the box (M$ doesn't like to play with Tux.. ;)). If you're fine with read-only try Linux Reader (tested myself, works fine); if you really want read/write support (note: I won't let windows potentially mess up my Debian partitions!) there are project like ext2fsd (untested for me).

Have fun! ;)

frankbell 08-28-2012 09:42 PM

Back to the original issue, Debian does not include NTFS drivers by default. As szboardstretcher said, you will have to install them in Debian.

http://wiki.debian.org/NTFS

LaCaradeculito 09-03-2012 03:54 AM

With your help I first thought the solution was near, but I started "failing in circles" =D

My partitions are as follow...
Code:

Disk /dev/sda: 164.7 GB, 164696555520 bytes
255 heads, 63 sectors/track, 20023 cylinders, total 321672960 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xac9c0cf0

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1  *          63    30716279    15358108+  7  HPFS/NTFS/exFAT
/dev/sda2        30716280  321653429  145468575    f  W95 Ext'd (LBA)
/dev/sda5        30716343    71682029    20482843+  7  HPFS/NTFS/exFAT
/dev/sda6        71682093  321653429  124985668+  7  HPFS/NTFS/exFAT

Disk /dev/sdb: 61.5 GB, 61492838400 bytes
255 heads, 63 sectors/track, 7476 cylinders, total 120103200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000a574d

  Device Boot      Start        End      Blocks  Id  System
/dev/sdb1  *        2048      499711      248832  83  Linux
/dev/sdb2          501758  120102911    59800577    5  Extended
/dev/sdb5          501760  120102911    59800576  8e  Linux LVM

What I tried was to rescue the system from Debian netinst liveCD, with which I come to a shell and type...

Code:

$ sudo mkdir /mnt/sdb1
$ sudo mount /dev/sdb1 /mnt/sdb1
(this below doesn-t work)
$ sudo chroot /mnt/sdb1 /usr/sbin/grub-install --recheck /dev/sda
(so...)
$ sudo /usr/sbin/grub-install --recheck  --root-directory /mnt/sdb1 /dev/sda

or simply
Code:

$ sudo update-grub
Then I exit the shell and find a new option "reinstall grub" which was not there before. Looks like the solution but after rebooting I find grub giving no options but to write code. I also tried the same from Knoppix liveCD, but something about the "--root-directory" argument is objected.

VDP76, the linked page you suggested (how to chrooting), resulted in errors such as folders not previously created (should be no problem to mk them then), but finally even chroot command did not work to me either. So I sticked to this guide.

I am confused because I once got my old linux installation... and messed it up again in trying to get Windows option at grub. I do not know what different thing I did that time.

Thank you all so much... and sorry for delaying my answer. I just gave myself the time to try all possibilities suggested here. Hope not to have missed details in my explanation.

M.


All times are GMT -5. The time now is 01:04 PM.