You are not logged in.

#1 2011-06-12 07:39:38

rg_arc
Member
Registered: 2011-03-20
Posts: 507

[SOLVED] Deleting a partition while triple booting..

So I have searched all over the wiki and I couldn't find anything about deleting a partition while triple booting.

I have arch linux installed and I have been satisfied with it so far and I want to delete the ubuntu natty partition and keep the Windows partition as there are a few programs I need on there.

So what information I have gathered is that I need to install GRUB in arch linux before deleting ubuntu since the GRUB is booting from Ubuntu. The only thing I am confused about is how to find the right commands to do this properly. I looked at the GRUB wiki and it specifies that I should find the GRUB's root with the find command.. such as:

grub> find /grub/stage1

(hd0,0)

Arch linux is located at /dev/sda7 on my computer. I can't seem to find the root from using the grub menu in arch linux.

grub> find /grub/stage1

Error 15: File not found

grub> 

I know I read the wiki right but I guess I am missing some key information here?

Last edited by rg_arc (2011-06-16 20:49:10)

Offline

#2 2011-06-12 08:36:18

Eishorn
Member
From: somewhere
Registered: 2011-04-18
Posts: 36

Re: [SOLVED] Deleting a partition while triple booting..

Do you have a separate /boot partition? If not

 grub> find /boot/grub/stage1 

would be the right command (sda7 is hd0,6). However, I think all you should have to do to replace is deleting ubuntu's GRUB from MBR (as root) using

# dd if=/dev/zero of=<your_disk> bs=440 count=1

and then install GRUB following the wiki instructions.

Offline

#3 2011-06-12 09:11:38

rg_arc
Member
Registered: 2011-03-20
Posts: 507

Re: [SOLVED] Deleting a partition while triple booting..

So the grub> find /boot/grub/stage1 command came up with the same result as the last command. I am guessing that Ubuntu is on hd0,0 but I am not sure about that.

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 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: 0xbdf5b4b2

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048    20482047    10240000   27  Hidden NTFS WinRE
/dev/sda2   *    20482048   313450797   146484375    7  HPFS/NTFS/exFAT
/dev/sda3       313452544   348606463    17576960   83  Linux
/dev/sda4       348608510   625141759   138266625    5  Extended
/dev/sda5       617330688   625141759     3905536   82  Linux swap / Solaris
/dev/sda6       451008512   617328639    83160064   83  Linux
/dev/sda7       348610560   379330559    15360000   83  Linux
/dev/sda8       379332608   451006463    35836928   83  Linux

Partition table entries are not in disk order

This is the result when I put in fdisk -l... so I am just confused about where the ubuntu partition is..

Last edited by rg_arc (2011-06-12 09:12:37)

Offline

#4 2011-06-12 17:27:15

Eishorn
Member
From: somewhere
Registered: 2011-04-18
Posts: 36

Re: [SOLVED] Deleting a partition while triple booting..

Maybe I am missing something here, but I think you don't need the find command at all as long as you are sure that where your arch root partition is (check /etc/fstab). If it is on sda7, GRUB will refer to it as hd0,6. If you do not have a separate /boot partition, your menu.lst entry for arch should look something like this:

# (0) Arch Linux
title  Arch Linux
root   (hd0,6)
kernel /boot/vmlinuz26 root=/dev/sda7 ro
initrd /boot/kernel26.img

To find out where your ubuntu partition is I'd simply mount the two "Linux" partitions left over and see what's on them smile

Offline

#5 2011-06-12 17:38:33

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: [SOLVED] Deleting a partition while triple booting..

Your Arch root partition (or boot partition, if you have one) is where GRUB will go;  If this is your third partition on your first/only disk, it will be (hd0,2).  Counting of partitions starts from 0.  The wiki page has the commands used to install it.

Offline

#6 2011-06-13 02:40:14

rg_arc
Member
Registered: 2011-03-20
Posts: 507

Re: [SOLVED] Deleting a partition while triple booting..

Ok so I think I have narrowed it down.. and.. this is really just a double check so I don't put something where it shouldn't be.

This is /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
......
# 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  [/boot/vmlinuz26]
root   (hd0,0)
kernel /vmlinuz26 root=/dev/sda3 ro
initrd /kernel26.img

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

And here is my fstab:

#
# /etc/fstab: static file system information
#
# <file system>        <dir>         <type>    <options>          <dump> <pass>
devpts                 /dev/pts      devpts    defaults            0      0
shm                    /dev/shm      tmpfs     nodev,nosuid        0      0
/dev/sda5 swap swap defaults 0 0
/dev/sda7 / ext4 defaults,noatime 0 1
/dev/sda8 /home ext4 defaults,noatime,user_xattr 0 2

So I will just put (hd 0,0)?

Offline

#7 2011-06-13 07:29:47

rg_arc
Member
Registered: 2011-03-20
Posts: 507

Re: [SOLVED] Deleting a partition while triple booting..

grub> root (hd0,
 Possible partitions are:
   Partition num: 0,  Filesystem type unknown, partition type 0x27
   Partition num: 1,  Filesystem type unknown, partition type 0x7
   Partition num: 2,  Filesystem type is ext2fs, partition type 0x83
   Partition num: 4,  Filesystem type unknown, partition type 0x82
   Partition num: 5,  Filesystem type is ext2fs, partition type 0x83
   Partition num: 6,  Filesystem type is ext2fs, partition type 0x83
   Partition num: 7,  Filesystem type is ext2fs, partition type 0x83

I found this finally.. but I believe

grub> root (hd0,6)

is the right place for GRUB. I can't seem to get the other commands to work.

Offline

#8 2011-06-13 09:47:01

Eishorn
Member
From: somewhere
Registered: 2011-04-18
Posts: 36

Re: [SOLVED] Deleting a partition while triple booting..

Yes, hd0,6 is right according to your fstab. All you have to do now is to write it to your MBR

# grub-install /dev/sda

and change your menu.lst to

# (0) Arch Linux
title  Arch Linux
root   (hd0,6)
kernel /vmlinuz26 root=/dev/sda7 ro
initrd /kernel26.img

Then you have to uncomment the windows entry and change the rootnoverify line to your windows partition (Taking a look at your fdisk output I strongly believe it is hd0,1). Also consider a arch fallback entry.

Offline

#9 2011-06-13 10:44:24

hokasch
Member
Registered: 2007-09-23
Posts: 1,461

Re: [SOLVED] Deleting a partition while triple booting..

I know I read the wiki right but I guess I am missing some key information here?

Actually, if you look at the Wiki it is quite clear the command you used only applies to setups with a seperate /boot partition (from your fstab, /boot resides on /). Grub should find its stage1 files from the console, otherwise double-check if grub is installed correctly in Arch. The Wiki recommends using grub shell instead of grub-install.

To check which partitions belong to Ubuntu, just have a look at Ubuntu's fstab.

Offline

#10 2011-06-13 16:10:08

perbh
Member
From: Republic of Texas
Registered: 2005-03-04
Posts: 765

Re: [SOLVED] Deleting a partition while triple booting..

... and after doing all of the above - you will not be able to boot into your windows partition ...
gawd - I just hate grub2 which wants to take over absolutely everything!!

So here it is - short and sweet:

1) boot into arch from your current setup
2) You must allow windows in your menu.lst - more specifically:

default 0
timeout 10
title archlinux
  root (hd0,6)
  kernel /boot/vmlinuz root=/dev/sda7 ro
  initrd /boot/kernel26.img

title windows
  rootnoverify (hd0,1)
  chainloader +1

3) make sure grub is properly installed - like this:

# cp /usr/lib/grub/i386-pc/* /boot/grub
# grub
grub> root (hd0,6)
grub> setup (hd0)
grub> exit
#

Now you should be able to reboot and reaching both windows and arch - and you can just 'empty' your ubuntu partion(s) (mkfs -t ext4 /dev/sda3 and mkfs -t ext4 /dev/sda6).
The latter is (of course) _after_ you have checked that ubuntu /boot is on sda3 and ubuntu root on sda6 (which is what I assume after reading the above - but I may well be wrong!! - so proceed with caution)

[edit]
I have several times experienced grub barfing at the 'setup (hd0)', but just repeat the command and it will be ok the 2nd time
[/edit]

Last edited by perbh (2011-06-13 16:12:35)

Offline

#11 2011-06-14 05:21:00

rg_arc
Member
Registered: 2011-03-20
Posts: 507

Re: [SOLVED] Deleting a partition while triple booting..

Ok this is the change I made in menu.lst:

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

I just uncommented the Windows section.. and since I don't use Windows 7 I kept the make active part.

This is basically telling me that GRUB is installed properly:

grub> root (hd0,6)
 Filesystem type is ext2fs, partition type 0x83

grub> setup (hd0)
 Checking if "/boot/grub/stage1" exists... yes
 Checking if "/boot/grub/stage2" exists... yes
 Checking if "/boot/grub/e2fs_stage1_5" exists... yes
 Running "embed /boot/grub/e2fs_stage1_5 (hd0)"...  16 sectors are embedded.
succeeded
 Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,6)/boot/grub/stage2 /boot/grub
/menu.lst"... succeeded
Done.

So, I should be able to use Gnome Partition Editor to delete Ubuntu and still be in the clear? If so, I can use this thread for future reference... thanks

Edit: Ok so now I can't access arch linux but I can access Windows, so I believe I must have installed GRUB in the right partition but failed to specify the proper root. I should have put (hd0,7) instead of (hd0,6). Is there any way to come back from this?

Here are the error messages:

embed /boot/grub/e2fs_Stage1-5 (hd0,6)" ...failed (This is not fatal)

This was after I booted into the grub after restarting.

Last edited by rg_arc (2011-06-14 07:08:47)

Offline

#12 2011-06-16 13:59:43

perbh
Member
From: Republic of Texas
Registered: 2005-03-04
Posts: 765

Re: [SOLVED] Deleting a partition while triple booting..

So - why did you do 'rootnoverify (hd0,0)' for windows?? It is a 'hidden' windows partition - and judging by the size - it is a recovery partition. You want to use 'rootnoverify (hd0,1)'

And - _you_ have to know which partition you installed arch on - we can only go by what you tell us - and in all the above it has been assumed that arch is on /dev/sda7 (ie hd(0,6)).
And - if you delete your ubuntu partition - all bets are off as to which partition arch will end up on. When you partition a disk - you are kinda caught - you cant just delete and create partitions at will and think that the remaining will automagically adjust themselves .
No Sir, you can wipe the partition(s) by 'mkfs' and then mount it under (say) /data or /data2 or /whatever and use the reclaimed space that way (I know, for _some_ filesystems it is possible to shrink/expand them - within limits - but that is an exotic way of eventually getting into trouble.

Anyways - if your arch partition really is on (hd0,7) ie /dev/sda8, then the best you can do is just to boot off a live-cd - or your arch-install-cd , do a changeroot and reinstall grub.

Offline

#13 2011-06-16 20:45:07

rg_arc
Member
Registered: 2011-03-20
Posts: 507

Re: [SOLVED] Deleting a partition while triple booting..

This was the first time I tried this. So I made a mistake or two, thankfully I haven't deleted ubuntu yet and I still can access Windows. My friend has a boot cd we can use, we should be able to fix everything and eventually delete Ubuntu. So thankfully I have some help. But I want to use this as an example for the next time I want to make changes like this again. Thanks for the help

Offline

Board footer

Powered by FluxBB