LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 03-26-2010, 01:27 PM   #1
asookazian
LQ Newbie
 
Registered: Mar 2010
Posts: 24

Rep: Reputation: 15
Win7 and dual Ubuntu 9.10 partitions


I have a Windows Vista box upgraded to Win7 and then installed two (yes two) instances of Ubuntu 9.10 on the same box.

I don't need one of them (it had a corrupted install ISO disk) and want to remove the partition using fdisk or parted or similar utility.

How do I know which instance of Ubuntu is used for each partition I selected when I reboot the box? There are two different versions displayed and I always select the newer one but how do I know if I remove the right one or not??

Also, when I restart in Win7, the BIOS/OS wants to check the disk everytime and now I've started skipping this check (it takes several mins).

thx.
 
Old 03-26-2010, 02:27 PM   #2
anurupr
Member
 
Registered: Mar 2010
Posts: 71

Rep: Reputation: 16
first the question to be asked is .. are both instances of linux on the same partition ? or is it on a different partition?

also type cat /boot/grub/grub.cfg in the terminal

and post the output here
 
Old 03-27-2010, 01:23 PM   #3
asookazian
LQ Newbie
 
Registered: Mar 2010
Posts: 24

Original Poster
Rep: Reputation: 15
asookazian@asookazian-desktop:/opt/eclipse:11:22 AM:$cat /boot/grub/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s /boot/grub/grubenv ]; then
have_grubenv=true
load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
saved_entry=${prev_saved_entry}
save_env saved_entry
prev_saved_entry=
save_env prev_saved_entry
fi
insmod ext2
set root=(hd0,7)
search --no-floppy --fs-uuid --set e9d21885-b231-41b8-9892-8f0883fd04f8
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
insmod gfxterm
insmod vbe
if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don't
# understand terminal_output
terminal gfxterm
fi
fi
if [ ${recordfail} = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/white
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry "Ubuntu, Linux 2.6.31-20-generic" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd0,7)
search --no-floppy --fs-uuid --set e9d21885-b231-41b8-9892-8f0883fd04f8
linux /boot/vmlinuz-2.6.31-20-generic root=UUID=e9d21885-b231-41b8-9892-8f0883fd04f8 ro quiet splash
initrd /boot/initrd.img-2.6.31-20-generic
}
menuentry "Ubuntu, Linux 2.6.31-20-generic (recovery mode)" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd0,7)
search --no-floppy --fs-uuid --set e9d21885-b231-41b8-9892-8f0883fd04f8
linux /boot/vmlinuz-2.6.31-20-generic root=UUID=e9d21885-b231-41b8-9892-8f0883fd04f8 ro single
initrd /boot/initrd.img-2.6.31-20-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd0,7)
search --no-floppy --fs-uuid --set e9d21885-b231-41b8-9892-8f0883fd04f8
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=e9d21885-b231-41b8-9892-8f0883fd04f8 ro quiet splash
initrd /boot/initrd.img-2.6.31-14-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic (recovery mode)" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd0,7)
search --no-floppy --fs-uuid --set e9d21885-b231-41b8-9892-8f0883fd04f8
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=e9d21885-b231-41b8-9892-8f0883fd04f8 ro single
initrd /boot/initrd.img-2.6.31-14-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Dell Utility Partition (on /dev/sda1)" {
insmod fat
set root=(hd0,1)
search --no-floppy --fs-uuid --set 07d7-0907
drivemap -s (hd0) ${root}
chainloader +1
}
menuentry "Windows 7 (loader) (on /dev/sda3)" {
insmod ntfs
set root=(hd0,3)
search --no-floppy --fs-uuid --set dce817b3e8178b42
chainloader +1
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
 
Old 03-27-2010, 01:26 PM   #4
asookazian
LQ Newbie
 
Registered: Mar 2010
Posts: 24

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by anurupr View Post
first the question to be asked is .. are both instances of linux on the same partition ? or is it on a different partition?
asookazian@asookazian-desktop:/opt/eclipse:11:25 AM:$sudo fdisk -l
[sudo] password for asookazian:

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xd8000000

Device Boot Start End Blocks Id System
/dev/sda1 1 5 40131 de Dell Utility
/dev/sda2 6 1311 10485760 7 HPFS/NTFS
/dev/sda3 * 1311 26258 200386344 7 HPFS/NTFS
/dev/sda4 26259 38913 101651287+ 5 Extended
/dev/sda5 32145 38631 52106796 83 Linux
/dev/sda6 38632 38913 2265133+ 82 Linux swap / Solaris
/dev/sda7 26259 31897 45295204+ 83 Linux
/dev/sda8 31898 32144 1983996 82 Linux swap / Solaris

Partition table entries are not in disk order
 
Old 03-27-2010, 02:41 PM   #5
whizje
Member
 
Registered: Sep 2008
Location: The Netherlands
Distribution: Slackware64 current
Posts: 594

Rep: Reputation: 141Reputation: 141
It seems both instances refer to the same partition /dev/sda7 to be sure you can do
Code:
/bin/ls -lF /dev/disk/by-uuid/
if /dev/sda7 has uuid e9d21885-b231-41b8-9892-8f0883fd04f8 then you know that your linux partition and that you can delete sda5 and sda6
 
1 members found this post helpful.
Old 03-28-2010, 12:59 AM   #6
asookazian
LQ Newbie
 
Registered: Mar 2010
Posts: 24

Original Poster
Rep: Reputation: 15
I tried to delete /dev/sda5 and /dev/sda6. Results:

Code:
asookazian@asookazian-desktop:/dev:10:53 PM:$sudo fdisk /dev/sda

The number of cylinders for this disk is set to 38913.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xd8000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1           5       40131   de  Dell Utility
/dev/sda2               6        1311    10485760    7  HPFS/NTFS
/dev/sda3   *        1311       26258   200386344    7  HPFS/NTFS
/dev/sda4           26259       38913   101651287+   5  Extended
/dev/sda5           32145       38631    52106796   83  Linux
/dev/sda6           38632       38913     2265133+  82  Linux swap / Solaris
/dev/sda7           26259       31897    45295204+  83  Linux
/dev/sda8           31898       32144     1983996   82  Linux swap / Solaris

Partition table entries are not in disk order

Command (m for help): d
Partition number (1-8): 5

Command (m for help): p

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xd8000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1           5       40131   de  Dell Utility
/dev/sda2               6        1311    10485760    7  HPFS/NTFS
/dev/sda3   *        1311       26258   200386344    7  HPFS/NTFS
/dev/sda4           26259       38913   101651287+   5  Extended
/dev/sda5           38632       38913     2265133+  82  Linux swap / Solaris
/dev/sda6           26259       31897    45295204+  83  Linux
/dev/sda7           31898       32144     1983996   82  Linux swap / Solaris

Partition table entries are not in disk order

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
 
Old 03-28-2010, 12:59 AM   #7
asookazian
LQ Newbie
 
Registered: Mar 2010
Posts: 24

Original Poster
Rep: Reputation: 15
asookazian@asookazian-desktop:/dev:10:59 PM:$sudo fdisk -l

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xd8000000

Device Boot Start End Blocks Id System
/dev/sda1 1 5 40131 de Dell Utility
/dev/sda2 6 1311 10485760 7 HPFS/NTFS
/dev/sda3 * 1311 26258 200386344 7 HPFS/NTFS
/dev/sda4 26259 38913 101651287+ 5 Extended
/dev/sda5 26259 31897 45295204+ 83 Linux
/dev/sda6 31898 32144 1983996 82 Linux swap / Solaris
 
Old 03-28-2010, 01:20 AM   #8
asookazian
LQ Newbie
 
Registered: Mar 2010
Posts: 24

Original Poster
Rep: Reputation: 15
Please help! I restarted Ubuntu and now seeing the following on the screen:

GRUB loading.
error: no such partition
grub rescue> ls
(hd0) (hd0,6) (hd0,5) (hd0,3) (hd0,2) (hd0,1)

I have valuable docs/pics on my Win7 partition that are not backed up!

Any way to fix this or undo the deleting of the partitions? I only care about the Win7 currently.

Should I boot using Ubuntu 9.10 ISO?? then what?
 
Old 03-28-2010, 04:33 AM   #9
lupusarcanus
Senior Member
 
Registered: Mar 2009
Location: USA
Distribution: Arch
Posts: 1,022
Blog Entries: 19

Rep: Reputation: 146Reputation: 146
Quote:
Originally Posted by asookazian View Post
Please help! I restarted Ubuntu and now seeing the following on the screen:

GRUB loading.
error: no such partition
grub rescue> ls
(hd0) (hd0,6) (hd0,5) (hd0,3) (hd0,2) (hd0,1)

I have valuable docs/pics on my Win7 partition that are not backed up!

Any way to fix this or undo the deleting of the partitions? I only care about the Win7 currently.

Should I boot using Ubuntu 9.10 ISO?? then what?
Hello,

You can try Super GRUB:
http://www.supergrubdisk.org/wiki/Boot_Problems

Regards,

--Andrew
 
Old 03-28-2010, 05:22 AM   #10
duskxiv
LQ Newbie
 
Registered: Mar 2010
Posts: 6

Rep: Reputation: 0
Can't undo delete, but your windows files are fine; even if you can't boot an operating system from HD you can still rescue them if need be... (Mount /dev/sda3 [or whatever the windows partition is] from a live CD.)

So GRUB is trying to boot the partition you deleted. Look in your /boot/grub/grub.cfg, there is a line that reads:
set root=(hd0,7)
I'm looking at the one in the header, line 15 or so, not the occurence of the same line in the menu entries. If that were changed to
set root=(hd0,3)
then it should try to boot windows instead. Boot from Ubuntu Live CD, mount the un-deleted Ubuntu partiton and make the change in /boot/grub/grub.cfg

To check if that works, startup normally,
grub rescue> set root=(hd0,3)
grub rescue> boot
And hopefully Windows will boot.

When you say you only care about Windows, does that mean you want to see the end of the Ubuntu partitions altogether, or just that you want them repaired but don't have anything of value on them?
If the latter, there's a very easy solution: reinstall Ubuntu over the old Linux partition, thus reinstalling GRUB and fixing everything.

Edit: Argh; complete brain fail. Don't bother editing /boot/grub/grub.cfg; it won't do anything. Sorry. But
Code:
grub rescue> set root=(hd0,3)
grub rescue> boot
should still boot windows and reinstalling Ubuntu fixes grub.

Last edited by duskxiv; 03-28-2010 at 07:46 AM. Reason: brain fail
 
Old 03-28-2010, 05:29 AM   #11
pierre2
Member
 
Registered: May 2009
Location: Perth, AU
Distribution: LinuxMint
Posts: 388
Blog Entries: 9

Rep: Reputation: 88
Quote:
I have valuable docs/pics on my Win7 partition that are not backed up!
before you even do the above, use the live_cd & mount the win7 partition & copy anything of value to another hdd or thumb drive.

Then, re-install the linux as above.
you shouldn't lose anything, but copy it anyway, just in case.
 
Old 03-28-2010, 01:52 PM   #12
asookazian
LQ Newbie
 
Registered: Mar 2010
Posts: 24

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by leopard View Post
Hello,

You can try Super GRUB:
http://www.supergrubdisk.org/wiki/Boot_Problems

Regards,

--Andrew
I tried this as well as booting from Win7 Ultimate DVD. Both failed to boot Win7.

Here is the output on Win7 DVD boot:

Code:
No boot device available
SATA 0:Installed
SATA 1:Installed
SATA 2:None
SATA 3:None
 
Old 03-28-2010, 01:54 PM   #13
asookazian
LQ Newbie
 
Registered: Mar 2010
Posts: 24

Original Poster
Rep: Reputation: 15
When I do a 'cd /boot/grub' and then 'ls -la' I only see 'grubenv' file. Nothing else.
 
Old 03-28-2010, 01:57 PM   #14
asookazian
LQ Newbie
 
Registered: Mar 2010
Posts: 24

Original Poster
Rep: Reputation: 15
When I type:

grub rescue> set root=(hd0,3)
grub rescue> boot

I get:

Unknown command 'boot'

Now what?
 
Old 03-28-2010, 02:11 PM   #15
whizje
Member
 
Registered: Sep 2008
Location: The Netherlands
Distribution: Slackware64 current
Posts: 594

Rep: Reputation: 141Reputation: 141
#

Insert Win 7 installation DVD and boot from DVD drive. While in some older systems you may have to change boot order through system BIOS, most newer systems allow booting from DVD without changing boot order by simply clicking on any key when prompted to doing so.
#
Step 2

Choose your default "Language", "Time", and "keyboard Input" on the first window and click next.
#
Step 3

You're now presented with 3 choices. Click on "Repair Your Computer" to gain access to the System Recovery window. Now choose "Command Prompt" in order to run the desired utility which is called "bootsect.exe". Bootsect is located inside the boot folder so change your directory to boot. Now run "bootsect /nt60 C:\" if you had Win 7 initially installed in the C partition. Alternatively, you can run "bootsect /nt60 SYS" or "bootsect /nt60 ALL" to repair the system partition or all partitions. Eject the DVD, and restart computer. Your computer should now boot Win 7 again.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] dual boot win7 with already installed mint8, error Jesse W Linux - General 8 03-12-2010 07:43 PM
Dual boot with Win7 and ICH10r Raid5 badogg Ubuntu 1 02-01-2010 02:29 PM
Dual boot problem - Win7 & Linux defmania Linux - Hardware 3 01-28-2010 06:34 PM
adding Fedora 10 to dual boot with Win7? lenny45 Fedora 11 10-19-2009 12:04 AM
Lenny Dual Boot w/ Win7 - GRUB problems! Leon W. Malinofsky Debian 3 02-25-2009 09:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration