LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Dual-boot not working with Win7 & Arch (installation problem?) (https://www.linuxquestions.org/questions/linux-newbie-8/dual-boot-not-working-with-win7-and-arch-installation-problem-932402/)

Krauger 03-02-2012 04:39 PM

Dual-boot not working with Win7 & Arch (installation problem?)
 
Hello,

I decided to reinstall Windows today and wanted to try Linux after a long time. I have two seperate hard disks, one for Windows and the other for Linux. I partitioned the Windows disk into three parts (one primary and two logical) and installed Windows first.

After that I booted into Arch installation and partitioned the Linux hard disk with cfdisk. I created four (primary) partitions: /root (ext4, 30 GB), /var (ext4, 10 GB), /swap ( swap, 2 GB) and /home (ext4, ~500 GB). Then I selected GRUB as my boot loader and had to select where I want to install it... I might have made a mistake there, according to some article on Arch Wiki I installed it on the Linux hard disk (on /root I think, at least that's what I selected in cfdisk) and completed the installation. Then I tried to reboot as prompted, but got a long list of errors.

The error messages were something about missing logical parts and "SQUASHFS Error". I couldn't reboot the system so I had to manually hit reset button. I thought I had managed to break my MBR or something, but seemingly Windows works just fine. I just can't boot into Linux at all, and I don't see the Linux hard disk on Windows. Easeus Partition Manager shows both hard disks and there seems to be "MBR" part on both...

Is it possible to recover my Arch? Or should I install it again, and if so, what did I do wrong the first time?

Btw, Windows is on the "first" hard disk so Linux partitions were labelled as "sdb" 1-4, and I installed GRUB on the first one, i.e., /root.

syg00 03-02-2012 05:29 PM

FWIW I don't like your (Linux) partition scheme - better if you had also created an extended there as well; much more flexible. As it is, you can't create any more partitions - say should you choose to try another distro (as well as Arch). Might add some weight to the "re-install completely" option.
Generally I prefer to allow grub to be the boot-loader - it will then allow you to chose. For that it will need to be in the MBR of /dev/sda. Any reason you chose not to do that ?.
The Win7 BCD can load Arch as you have installed it - have a search for EasyBCD. It's free and quite handy if you insist on using Win7 to boot.

Edit: sorry, you can also "fix" things so grub will boot both without a complete re-install. Tell us what you want to achieve, you'll get a solution.

Krauger 03-02-2012 06:11 PM

Hmm, well I suppose I could just re-install Arch for the sake of flexibility. I guess I can just wipe the whole disk and assign /var, /swap and /home partitions as logical in cfdisk? There was another thing I was wondering when I created the partitions with cfdisk: if I remember right, I had to label one partition as "Bootable" in order to write the partition table. That doesn't interfere with the fact that MBR should have been put in the Window's hard disk?

I chose to put Grub on sdb (Linux hard disk) because of this article: https://wiki.archlinux.org/index.php...Arch_Dual_Boot. It says: "3/Be sure to install GRUB on the MBR on the Arch drive (I didn't test with syslinux but it should work too)."

I'd appreciate exactness regarding Grub and how to make Windows boot from it. :) The article I linked says how grub's menu file should be modified, but seemingly I failed anyway.

syg00 03-02-2012 07:23 PM

Ahhh - that's different again. Try changing the boot drive in your BIOS. If you did it correctly Arch should boot. Then post the output of these commands (try them as root).
Code:

cat /boot/grub/menu.lst
fdisk -l


Krauger 03-03-2012 07:48 PM

I switched booting to the Linux disk and got Grub. Then I selected Arch and got the following error:
Code:

File system type unknown, partition type 0x7
kernel /boot/vmlinuz-linux root = /dev/sdb1 ro
Error 17: Cannot mount selected partition


yancek 03-03-2012 09:35 PM

Quote:

File system type unknown, partition type 0x7
That indicates a windows partition. You didn't post the output of the commands asked for earlier by syg00 which would be helpful. It would be more helpful if you could use your Arch or any other Linux Live CD to download and run the bootinfoscript to provide detailed information on your boot files:

http://sourceforge.net/projects/bootinfoscript/

syg00 03-03-2012 09:49 PM

The problem is that changing the BIOS boot drive (usually) changes the drive designation in Linux. So what was /dev/sda and /dev/sdb during install is now reversed. So it all goes to hell unless you use something like UUID or LABEL.
Lemme go find an Arch CD to see how easy it is to fix this from a chroot off the install disk.

Edit: must have been a while since I installed an Arch. That's a liveCD - use that to go get that bootinfoscript as requested. Then we can give you a simple fix to put grub in the MBR.

Set your BIOS boot drive back to the way it was before getting the info.

syg00 03-03-2012 11:22 PM

So I misinterpreted liveCD - was expecting a GUI.
Same old Arch. Going to be too hard to do from that. Go get a "normal" (GUI) liveCD to download the bootinfo script.

For a better description of what is involved, use this link.

Krauger 03-04-2012 06:47 AM

Alright, downloaded openSUSE LiveCD and bootinfo script gave the following results:

Code:

                  Boot Info Script 0.60    from 17 May 2011


============================= Boot Info Summary: ===============================

 => Windows is installed in the MBR of /dev/sda.
 => Grub Legacy (v0.97) is installed in the MBR of /dev/sdb and looks on the
    same drive in partition #1 for /boot/grub/stage2 and /boot/grub/menu.lst.

sda1: __________________________________________________________________________

    File system:      ntfs
    Boot sector type:  Windows Vista/7
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  Windows 7
    Boot files:        /bootmgr /Boot/BCD /Windows/System32/winload.exe

sda2: __________________________________________________________________________

    File system:      Extended Partition
    Boot sector type:  Unknown
    Boot sector info: 

sda5: __________________________________________________________________________

    File system:      ntfs
    Boot sector type:  Windows XP
    Boot sector info:  According to the info in the boot sector, sda5 starts
                      at sector 63.
    Operating System: 
    Boot files:       

sda6: __________________________________________________________________________

    File system:      ntfs
    Boot sector type:  Windows XP
    Boot sector info:  According to the info in the boot sector, sda6 starts
                      at sector 63.
    Operating System: 
    Boot files:       

sdb1: __________________________________________________________________________

    File system:      ext4
    Boot sector type:  -
    Boot sector info: 
    Operating System:   Arch Linux () ()
    Boot files:        /boot/grub/menu.lst /etc/fstab

sdb2: __________________________________________________________________________

    File system:      ext4
    Boot sector type:  -
    Boot sector info: 
    Operating System: 
    Boot files:       

sdb3: __________________________________________________________________________

    File system:      swap
    Boot sector type:  -
    Boot sector info: 

sdb4: __________________________________________________________________________

    File system:      ext4
    Boot sector type:  -
    Boot sector info: 
    Operating System: 
    Boot files:       

============================ Drive/Partition Info: =============================

Drive: sda _____________________________________________________________________

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sda1    *            63  108,486,944  108,486,882  7 NTFS / exFAT / HPFS
/dev/sda2        108,486,945 1,953,520,064 1,845,033,120  f W95 Extended (LBA)
/dev/sda5        108,487,008  275,241,644  166,754,637  7 NTFS / exFAT / HPFS
/dev/sda6        275,241,708 1,953,520,064 1,678,278,357  7 NTFS / exFAT / HPFS


Drive: sdb _____________________________________________________________________

Disk /dev/sdb: 640.1 GB, 640135028736 bytes
255 heads, 63 sectors/track, 77825 cylinders, total 1250263728 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sdb1    *            63    48,821,534    48,821,472  83 Linux
/dev/sdb2          48,821,535    68,854,589    20,033,055  83 Linux
/dev/sdb3          68,854,590    72,758,384    3,903,795  82 Linux swap / Solaris
/dev/sdb4          72,758,385 1,250,263,727 1,177,505,343  83 Linux


"blkid" output: ________________________________________________________________

Device          UUID                                  TYPE      LABEL

/dev/loop0      77456e5b-aa8d-4811-9dd2-fa3850603f66  ext4     
/dev/sda1        48AEF5BDAEF5A39A                      ntfs     
/dev/sda5        01CCF8B2E6242F60                      ntfs     
/dev/sda6        01CCF8B2EC286840                      ntfs     
/dev/sdb1        4b4ea850-baf1-440b-8cca-78ce65d575ae  ext4     
/dev/sdb2        d5ee381e-29a8-41d1-ae5b-7c7104e12e42  ext4     
/dev/sdb3        c5c18410-bc8a-4a10-923c-3d17e82624da  swap     
/dev/sdb4        f28ae256-2022-418f-98a8-1e62bfed09de  ext4     

================================ Mount points: =================================

Device          Mount_Point              Type      Options

/dev/sr0        /livecd                  iso9660    (ro,relatime)


=========================== sdb1/boot/grub/menu.lst: ===========================

--------------------------------------------------------------------------------
# Config file for GRUB - The GNU GRand Unified Bootloader
# /boot/grub/menu.lst

# DEVICE NAME CONVERSIONS
#
#  Linux          Grub
# -------------------------
#  /dev/fd0        (fd0)
#  /dev/sda        (hd0)
#  /dev/sdb2      (hd1,1)
#  /dev/sda3      (hd0,2)
#

#  FRAMEBUFFER RESOLUTION SETTINGS
#    +-------------------------------------------------+
#          | 640x480    800x600    1024x768  1280x1024
#      ----+--------------------------------------------
#      256 | 0x301=769  0x303=771  0x305=773  0x307=775
#      32K | 0x310=784  0x313=787  0x316=790  0x319=793
#      64K | 0x311=785  0x314=788  0x317=791  0x31A=794
#      16M | 0x312=786  0x315=789  0x318=792  0x31B=795
#    +-------------------------------------------------+
#  for more details and different resolutions see
#  https://wiki.archlinux.org/index.php/GRUB#Framebuffer_resolution

# general configuration:
timeout  5
default  0
color light-blue/black light-cyan/blue

# boot sections follow
# each is implicitly numbered from 0 in the order of appearance below
#
# TIP: If you want a 1024x768 framebuffer, add "vga=773" to your kernel line.
#
#-*

# (0) Arch Linux
title  Arch Linux
root  (hd1,0)
kernel /boot/vmlinuz-linux root=/dev/sdb1 ro
initrd /boot/initramfs-linux.img

# (1) Arch Linux
title  Arch Linux Fallback
root  (hd1,0)
kernel /boot/vmlinuz-linux root=/dev/sdb1 ro
initrd /boot/initramfs-linux-fallback.img

# (2) Windows
#title Windows
#rootnoverify (hd0,0)
#makeactive
#chainloader +1
--------------------------------------------------------------------------------

=============================== sdb1/etc/fstab: ================================

--------------------------------------------------------------------------------
#
# /etc/fstab: static file system information
#
# <file system>        <dir>        <type>        <options>        <dump>        <pass>
tmpfs                /tmp        tmpfs        nodev,nosuid        0        0
/dev/sdb1 / ext4 defaults 0 1
/dev/sdb2 /var ext4 defaults 0 1
/dev/sdb3 swap swap defaults 0 0
/dev/sdb4 /home ext4 defaults 0 1
--------------------------------------------------------------------------------

=================== sdb1: Location of files loaded by Grub: ====================

          GiB - GB            File                                Fragment(s)

  16.127212048 = 17.316462080  boot/grub/menu.lst                            1
  16.127440929 = 17.316707840  boot/grub/stage2                              1
  0.181067944 = 0.194420224    boot/initramfs-linux-fallback.img              1
  0.170058727 = 0.182599168    boot/initramfs-linux.img                      1
  16.127208233 = 17.316457984  boot/vmlinuz-linux                            1

======================== Unknown MBRs/Boot Sectors/etc: ========================

Unknown BootLoader on sda2

00000000  5f 45 45 c0 c1 0c 4a 06  e8 06 55 e7 bf e4 0d 0b  |_EE...J...U.....|
00000010  81 be 3e 1f ab 12 9a a8  4d 03 c0 40 86 0d f0 61  |..>.....M..@...a|
00000020  20 21 00 6f 81 46 aa 6e  0e 95 b2 e0 a6 a3 87 d9  | !.o.F.n........|
00000030  65 ec c7 c8 68 be 7e 2b  e0 fc 08 b3 05 aa fe 3e  |e...h.~+.......>|
00000040  50 9e 13 83 c0 7f 66 25  00 7a a2 f6 f8 19 83 c0  |P.....f%.z......|
00000050  41 66 0d 41 81 00 49 04  05 77 00 e8 f9 8f 8b 40  |Af.A..I..w.....@|
00000060  52 41 a0 28 06 40 f0 10  4f 83 00 78 3c 1f fb e0  |RA.(.@..O..x<...|
00000070  1a 0f 0f ff bb c1 e0 20  61 06 08 60 f0 10 1c 80  |....... a..`....|
00000080  78 92 01 a5 e2 48 42 1e  7f c5 fd ca af 29 f0 78  |x....HB......).x|
00000090  0f e8 42 02 bf 7a dd 26  07 80 81 f4 1b df 9e fa  |..B..z.&........|
000000a0  bd a7 82 98 5e 0a 20 f0  10 34 83 c0 40 a6 23 80  |....^. ..4..@.#.|
000000b0  6a 42 e0 61 78 33 81 e0  20 41 07 80 80 e4 18 21  |jB.ax3.. A.....!|
000000c0  09 20 ca 81 43 f1 25 46  97 a8 8a 3d 75 a2 50 c8  |. ..C.%F...=u.P.|
000000d0  1e 03 fa 91 26 cf ab b5  c0 f0 10 44 83 7f f3 e3  |....&......D....|
000000e0  fe 5d 38 10 31 b3 cd cc  05 38 14 43 e1 90 3c 07  |.]8.1....8.C..<.|
000000f0  f8 62 54 50 5d e2 22 f0  80 5c 07 d5 c5 a1 d0 7c  |.bTP]."..\.....||
00000100  0f ee c1 82 18 41 fc fe  06 40 f0 10 20 83 c0 40  |.....A...@.. ..@|
00000110  76 10 ae 17 89 75 9e 41  90 5c 01 83 38 fd 3e e3  |v....u.A.\..8.>.|
00000120  09 1b 01 f4 87 2b 0c c2  e0 1f 95 94 e2 b7 85 c0  |.....+..........|
00000130  1e 55 79 f7 9e f8 51 0c  05 20 68 0d 7d aa a7 c0  |.Uy...Q.. h.}...|
00000140  c5 2c 79 f1 f2 b9 bb 17  39 97 ae 8a fc a7 d5 c0  |.,y.....9.......|
00000150  28 c7 80 d7 ef 2f 57 e1  e7 ec ad c7 aa a6 c1 80  |(..../W.........|
00000160  37 e3 b2 10 61 2b f4 f0  05 e0 58 a7 95 23 7e 52  |7...a+....X..#~R|
00000170  0c 2f 50 b8 57 3f 61 4e  23 e2 13 03 26 5b 53 e3  |./P.W?aN#...&[S.|
00000180  a5 d5 62 9a a7 c0 b8 e1  d3 1b 03 16 40 ce 38 05  |..b.........@.8.|
00000190  30 1a 0a 04 a0 80 24 aa  12 41 48 5f 15 2f 64 06  |0.....$..AH_./d.|
000001a0  16 f8 bc 20 97 45 77 25  84 00 78 bb 0b 95 28 9c  |... .Ew%..x...(.|
000001b0  3c 0d 01 82 19 77 cb 81  08 be 6f 79 fa e1 00 fe  |<....w....oy....|
000001c0  ff ff 07 fe ff ff 3f 00  00 00 4d 79 f0 09 00 fe  |......?...My....|
000001d0  ff ff 05 fe ff ff 8c 79  f0 09 14 7f 08 64 00 00  |.......y.....d..|
000001e0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000001f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 55 aa  |..............U.|
00000200


=============================== StdErr Messages: ===============================

  No volume groups found
mdadm: No arrays found in config file or automatically


syg00 03-04-2012 06:11 PM

That looks sane, with one exception. Your Windows entry is commented out in the grub menu.lst. If that isn't rectified you won't see, let alone be able to boot, a Windows entry in your (grub) boot menu. I presume you did that deliberately, so it needs to be undone.

If you don't have a Win7 recovery disk, now would be an excellent time to create one.
After that, from the Arch liveCD, these commands will re-write the MBR on the Windows disk. The Windows loader code will be over-written - you have been warned.
Code:

grub
root (hd1,0)
setup (hd0)
quit

Reboot.

Krauger 03-04-2012 06:43 PM

EDIT: Meh, didn't realize I could just boot with the Arch installation CD and fix grub there!

Alright, managed to boot into Arch now! Can I just uncomment the Windows part on /boot/grub/menu.lst in order to get Windows on Grub's list? I mean, I don't have to change any values there?

syg00 03-04-2012 07:20 PM

Grub appears to be o.k. - can't say what happened to the Arch install itself.

What you're looking for is the Arch menu.lst, not the liveCD (as in OpenSuSE) one.
You'll need to find and mount that partition (from "files" will be fine; just click on the "30 Gig Filesystem"). Then from that mount-point locate the menu.lst - will probably be something like /media/4b4ea850-baf1-440b-8cca-78ce65d575ae/boot/grub/menu.lst unless you used a label on the filesystem.

Next you need to edit that file as root. Use <Alt>-F2 to open a command prompt, and use the full path you got above - including the complete (and correct) string of numbers and digits that is the UUID
Code:

gnomesu gedit /media/4b4ea850-baf1-440b-8cca-78ce65d575ae/boot/grub/menu.lst
Do your edit, save it and reboot.
All of the above presumes you have a gnome liveCD.

Krauger 03-04-2012 07:46 PM

Yeah, was initially trying to fix the wrong menu.lst file. Now that I managed to boot into Arch I could just edit it there. Uncommented the Windows part and successfully booted into Windows this time. Everything seems to be working now, thanks a lot syg00!!! This case is solved, now I can get to the business. :)


All times are GMT -5. The time now is 11:07 AM.