Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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).
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 ###
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.
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.