LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   problems with fdisk (https://www.linuxquestions.org/questions/linux-newbie-8/problems-with-fdisk-797964/)

_Linux_Learner 03-26-2010 12:05 AM

problems with fdisk
 
Hi all

I have used fdisk to create two new partition.

Before this partition, I had 6 partition of which /dev/sda6 was the boot partition. I deleted /dev/sda5 partition and hence the earleir /dev/sda6 became /dev/sda5. Now I created two new partitions /dev/sda6 and /dev/sda7.

Due to this change in device label of /dev/sda6 I am not able to boot my computer.

Is there any method to change the disk label of /dev/sda5 to /dev/sda6 ?????

or any other possible solutions....

Thanks in advance

catkin 03-26-2010 12:21 AM

The easiest solution is to boot a system from external media (CD, DVD, USB ...) and correct /etc/fstab. The installation CD should work or something like Knoppix.

Regards defending against this happening again, fstab can be modified to mount devices identified by UUID (nice for computers, inconvenient for people) or by label.

syg00 03-26-2010 02:10 AM

The OP has Ubuntu in his/her profile - that has used UUID for some time.
Perhaps if the problem was described fully we could help better.

_Linux_Learner 03-27-2010 02:29 AM

Quote:

Originally Posted by syg00 (Post 3912899)
The OP has Ubuntu in his/her profile - that has used UUID for some time.
Perhaps if the problem was described fully we could help better.

what more explanation shall I give...........

catkin 03-27-2010 02:33 AM

Quote:

Originally Posted by _Linux_Learner (Post 3914124)
what more explanation shall I give...........

What do you see when you try to boot your computer? Do you see GRUB loading? If so, which stages does it say it is loading. Does GRUB give an error message?

_Linux_Learner 03-27-2010 03:22 AM

Quote:

Originally Posted by catkin (Post 3914128)
What do you see when you try to boot your computer? Do you see GRUB loading? If so, which stages does it say it is loading. Does GRUB give an error message?

It fails to boot stage1.5 gives error15.....

Please help.....

Regards
_Linux_Learner

Mr-Bisquit 03-27-2010 03:29 AM

As mentioned, you will need to edit /etc/fstab to point to the new root partition.

rfernandez 03-27-2010 03:33 AM

Please, boot from your live cd and once in it, mount the boot partition. Afterwards, put the output of "cat /boot/menu.lst" here.

I think it is /boot/menu.lst, but if anyone knows for sure, please be kind to correct so.

catkin 03-27-2010 03:38 AM

Quote:

Originally Posted by _Linux_Learner (Post 3914155)
It fails to boot stage1.5 gives error15

I netsearched for GRUB error 15 and got lots of information but it is complicated. Perhaps the simplest solution would be to create a dummy partition to put /dev/sda5 back in its original place as /dev/sda6. Don't use gparted for this -- it is "smart" about trying to preserve partition numbering. Use fdisk or cfdisk from a bootable Linux.

syg00 03-27-2010 03:41 AM

You've better learn to give (much) better descriptions if you want help.
Quote:

Originally Posted by manual
15 : File not found
This error is returned if the specified file name cannot be found, but everything else (like the disk/partition info) is OK.

From a liveCD go to sf.net and get bootinfoscript and run it.
Post the RESULTS.txt you get as output

djsmiley2k 03-27-2010 04:42 AM

It sounds to me like grub is pointing to the wrong device.

Boot up liveCD of some form (*you should have some sort of install CD you used to setup your system?). Once you've booted this you can experiement by mounting each of your partitions in turn.

Code:

mkdir /test_boot
mount /dev/sda5 /test_boot
ls -la /test_boot

If that returns nothing then try mounting /dev/sda6 in the same way. Hopefully one of them will list your boot partition.

Once you've found your boot partition, edit your /boot/grub/grub.conf to point to the correct drive.( This will most likely be the partition you've just mounted, so sda5 or sda6 depending. )

Code:

nano -w /boot/grub/grub.conf
In the grub.conf you'll need to check both the `root` and `kernel` options;
** Warning - In grub.conf the drive will not be listed as "sda6" it'll most likely be listed as `(hd0,5)` which would be pointing to sda6 (First drive, 6th partition - counts from 0);

You may want to just copy the whole grub.conf to somewhere safe before editing it, incase you make things worse.

_Linux_Learner 03-28-2010 09:01 AM

Hi all,

Using the help given here and on google... I followed the following steps

Boot in using live cd and executed following commands

Code:

sudo mkdir /mnt/root
sudo mount -t ext3 /dev/sda6 /mnt/root
sudo mount -t proc none /mnt/root/proc
sudo mount -o bind /dev /mnt/root/dev
sudo chroot /mnt/root /bin/bash
sudo update-grub

Than I copied all the grub files from /usr/lib/grub/i386-pc to the grub folder on mounted partition..

I made entries in menu.lst file.

This all worked successfully and now on booting I can see the menu.lst file with all the kernels. I can boot windows well.

When I boot ubuntu now the new problem creeps in...
It show a number of errors and finally says

Code:

/dev/disk/by-uuid/<uuid of the root partition> does not exist
Than it throws me to a busy box shell with initramfs prompt..

My menu.lst file looks like follow....

Code:

# menu.lst - See: grub(8), info grub, update-grub(8)
#            grub-install(8), grub-floppy(8),
#            grub-md5-crypt, /usr/share/doc/grub
#            and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not use 'savedefault' or your
# array will desync and will not let you boot your system.
default                0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout                8       

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line)  and entries protected by the
# command 'lock'
# e.g. password topsecret
#      password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#

# examples

 title                Linux
 root                (hd0,5)
 kernel                /vmlinuz root=UUID=8e23f395-c033-4245-b5a4-8638437496aa ro quiet splash
initrd                /initrd.img.2.6.28
quiet

 title                Windows 95/98/NT/2000
 root                (hd0,0)
 makeactive
 chainloader        +1

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
##      kopt_2_6_8=root=/dev/hdc1 ro
##      kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=/dev/hda1 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,0)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
##      alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
##      lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
##      lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
##      altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
##      howmany=7
# howmany=all

## specify if running in Xen domU or have grub detect automatically
## update-grub will ignore non-xen kernels when running in domU and vice versa
## e.g. indomU=detect
##      indomU=true
##      indomU=false
# indomU=detect

## should update-grub create memtest86 boot option
## e.g. memtest86=true
##      memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

### END DEBIAN AUTOMAGIC KERNELS LIST

Please help I am really in trouble.

Regards
_Linux_Learner

_Linux_Learner 03-28-2010 09:11 AM

Quote:

Originally Posted by syg00 (Post 3914168)
You've better learn to give (much) better descriptions if you want help.From a liveCD go to sf.net and get bootinfoscript and run it.
Post the RESULTS.txt you get as output

Result.txt file as follow

Code:

                Boot Info Script 0.55    dated February 15th, 2010                   

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

 => Grub 0.97 is installed in the MBR of /dev/sda and looks on the same drive
    in partition #6 for /grub/stage2 and /grub/menu.lst.

sda1: _________________________________________________________________________

    File system:      ntfs
    Boot sector type:  Windows XP
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  Windows XP
    Boot files/dirs:  /boot.ini /ntldr /NTDETECT.COM

sda2: _________________________________________________________________________

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

sda5: _________________________________________________________________________

    File system:     
    Boot sector type:  Unknown
    Boot sector info: 
    Mounting failed:
mount: unknown filesystem type ''

sda6: _________________________________________________________________________

    File system:      ext3
    Boot sector type:  -
    Boot sector info: 
    Operating System: 
    Boot files/dirs:  /grub/menu.lst

sda3: _________________________________________________________________________

    File system:      ext3
    Boot sector type:  -
    Boot sector info: 
    Operating System:  Ubuntu 9.04
    Boot files/dirs:  /etc/fstab

sda4: _________________________________________________________________________

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

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

Drive: sda ___________________ _____________________________________________________

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x00ff00ff

Partition  Boot        Start          End          Size  Id System

/dev/sda1    *            63  167,766,794  167,766,732  7 HPFS/NTFS
/dev/sda2        230,275,710  312,560,639    82,284,930  f W95 Ext d (LBA)
/dev/sda5        230,275,773  293,202,314    62,926,542  7 HPFS/NTFS
/dev/sda6    *    293,202,378  312,560,639    19,358,262  83 Linux
/dev/sda3        167,766,795  222,484,184    54,717,390  83 Linux
/dev/sda4        222,484,185  230,275,709    7,791,525  82 Linux swap / Solaris


blkid -c /dev/null: ____________________________________________________________

Device          UUID                                  TYPE      LABEL                       

/dev/loop0                                              squashfs                               
/dev/sda1        D29C07B49C079261                      ntfs                                   
/dev/sda3        8e23f395-c033-4245-b5a4-8638437496aa  ext3                                   
/dev/sda4        9b46a9e4-752e-4db8-84d4-89bd780b4193  swap                                   
/dev/sda6        9773c5e7-f63b-4a2b-ad05-6fc7e4c8d34e  ext3                                   

============================ "mount | grep ^/dev  output: ===========================

Device          Mount_Point              Type      Options

rootfs          /                        rootfs    (rw)
/dev/sr0        /cdrom                  iso9660    (ro,noatime)
/dev/loop0      /rofs                    squashfs  (ro,noatime)
/dev/sda3        /media/disk              ext3      (rw,nosuid,nodev,uhelper=hal)
/dev/sda6        /media/disk-1            ext3      (rw,nosuid,nodev,uhelper=hal)


================================ sda1/boot.ini: ================================

[boot loader]

timeout=15

default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS

[operating systems]

multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect


============================= sda6/grub/menu.lst: =============================

# menu.lst - See: grub(8), info grub, update-grub(8)
#            grub-install(8), grub-floppy(8),
#            grub-md5-crypt, /usr/share/doc/grub
#            and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not use 'savedefault' or your
# array will desync and will not let you boot your system.
default                0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout                8       

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line)  and entries protected by the
# command 'lock'
# e.g. password topsecret
#      password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#

# examples

 title                Linux
 root                (hd0,5)
 kernel                /vmlinuz root=UUID=8e23f395-c033-4245-b5a4-8638437496aa ro quiet splash
initrd                /initrd.img.2.6.28
quiet

 title                Windows 95/98/NT/2000
 root                (hd0,0)
 makeactive
 chainloader        +1

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
##      kopt_2_6_8=root=/dev/hdc1 ro
##      kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=/dev/hda1 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,0)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
##      alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
##      lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
##      lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
##      altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
##      howmany=7
# howmany=all

## specify if running in Xen domU or have grub detect automatically
## update-grub will ignore non-xen kernels when running in domU and vice versa
## e.g. indomU=detect
##      indomU=true
##      indomU=false
# indomU=detect

## should update-grub create memtest86 boot option
## e.g. memtest86=true
##      memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

### END DEBIAN AUTOMAGIC KERNELS LIST

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


 155.9GB: grub/menu.lst
 155.8GB: grub/stage2
 150.1GB: initrd.img.2.6.28
 150.1GB: vmlinuz

=============================== sda3/etc/fstab: ===============================

# /etc/fstab: static file system information.
#
# Use 'vol_id --uuid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>  <type>  <options>      <dump>  <pass>
proc            /proc          proc    defaults        0      0
# / was on /dev/sda3 during installation
UUID=8e23f395-c033-4245-b5a4-8638437496aa /              ext3    relatime,errors=remount-ro 0      1
# /boot was on /dev/sda6 during installation
UUID=9773c5e7-f63b-4a2b-ad05-6fc7e4c8d34e /boot          ext3    relatime        0      2
# swap was on /dev/sda4 during installation
UUID=9b46a9e4-752e-4db8-84d4-89bd780b4193 none            swap    sw              0      0
/dev/scd0      /media/cdrom0  udf,iso9660 user,noauto,exec,utf8 0      0
/dev/fd0        /media/floppy0  auto    rw,user,noauto,exec,utf8 0      0/boot          ext3    relatime        0      2
# swap was on /dev/sda4 during installation
UUID=9b46a9e4-752e-4db8-84d4-89bd780b4193 none            swap    sw              0      0
/dev/scd0      /media/cdrom0  udf,iso9660 user,noauto,exec,utf8 0      0
/dev/fd0        /media/floppy0  auto    rw,user,noauto,exec,utf8 0      0
=========================== Unknown MBRs/Boot Sectors/etc =======================

Unknown BootLoader  on sda5

00000000  9f 28 d4 27 2d d0 97 7f  ec 8e 55 a9 68 fc d3 3f  |.(.'-.....U.h..?|
00000010  3d bf 44 ff fb 92 00 ea  8f f2 ba 3b d8 83 0f 2a  |=.D........;...*|
00000020  e0 57 67 7b 10 61 e5 5c  0c ad 1b 5c 0c 61 0b 81  |.Wg{.a.\...\.a..|
00000030  95 a3 6b 81 8c 21 70 e4  19 46 ff f5 aa df ff 55  |..k..!p..F.....U|
00000040  ab ad 86 81 c9 66 46 ed  09 c2 28 90 29 b6 99 27  |.....fF...(.)..'|
00000050  51 0b 70 cf 41 d1 4e 4d  4c e6 48 a5 3b 8c 34 25  |Q.p.A.NML.H.;.4%|
00000060  ab 58 83 32 a6 f1 25 49  10 d9 3d 1c 9c b5 98 04  |.X.2..%I..=.....|
00000070  cf 91 3e 54 06 8b 9a 79  ee e7 ca 12 23 95 24 38  |..>T...y....#.$8|
00000080  e1 72 25 48 8d d4 7a cf  94 6a 13 96 e8 4b bf f6  |.r%H..z..j...K..|
00000090  47 2a d4 b4 7e 69 9f 9e  df d3 90 65 09 7f f5 aa  |G*..~i.....e....|
000000a0  df ff 54 bf 17 a6 55 01  52 85 9e 1e 02 a5 07 b6  |..T...U.R.......|
000000b0  8b 15 ac bb a5 ae 6f 37  25 22 44 d4 7a 0e 58 17  |......o7%"D.z.X.|
000000c0  9f e3 56 58 3d 6c 70 ad  6b 78 b6 44 e0 5d 00 e1  |..VX=lp.kx.D.]..|
000000d0  7b 82 82 0a e6 1e 52 80  5e d6 4d 0b fe 0d e9 d4  |{.....R.^.M.....|
000000e0  55 1e 20 ea e4 97 fa 6a  6a 95 af 20 1c 97 b2 bb  |U. ....jj.. ....|
000000f0  05 35 06 d9 af f0 ab d4  6d da 3f ab 4f ff aa be  |.5......m.?.O...|
00000100  2f 4c 69 e2 a5 0a 54 35  85 4e 0f 9c 88 95 ac b5  |/Li...T5.N......|
00000110  d0 51 9a 06 70 48 f4 23  d1 e8 39 3d 5b ff 8d 59  |.Q..pH.#..9=[..Y|
00000120  5a f3 58 e1 5a d6 36 5a  a2 24 0a e8 03 85 ee 0a  |Z.X.Z.6Z.$......|
00000130  08 2b 91 87 ca 50 00 ed  64 d0 bd 46 0d e9 d4 3d  |.+...P..d..F...=|
00000140  47 88 3a b9 10 5e ba 6a  6a 93 47 6c 40 39 2f 65  |G.:..^.jj.Gl@9/e|
00000150  76 0a 6a 0d b3 5f e1 57  96 36 63 42 ff 56 9f ff  |v.j.._.W.6cB.V..|
00000160  14 9e ce 09 86 db 8d f6  52 4f d1 4b 3c 0d 91 e5  |........RO.K<...|
00000170  d2 6d 50 aa d9 84 ef 26  cb e9 95 3d 96 a7 49 22  |.mP....&...=..I"|
00000180  83 19 d5 5e 6f 97 2d 54  8f aa 12 33 18 19 9f f7  |...^o.-T...3....|
00000190  8e 96 46 aa f7 28 18 1e  e5 88 6f 86 ad bd 03 eb  |..F..(....o.....|
000001a0  c6 5a cb d5 fe d1 a9 f7  b7 e1 5e ae ba d5 6a da  |.Z........^...j.|
000001b0  fe ef 96 7d df ff fb 92  00 ec 8f f3 1d 46 d6 83  |...}.........F..|
000001c0  2f 52 e0 63 08 da d0 65  ea 5c 0b 84 b7 5c 0c 61  |/R.c...e.\...\.a|
000001d0  09 81 89 16 eb 41 8c 21  30 ff a2 b6 6f 4c 36 c8  |.....A.!0...oL6.|
000001e0  6f b0 d2 73 45 1c 6e 8d  51 bd d2 2e 50 a5 0c c2  |o..sE.n.Q...P...|
000001f0  1d c8 ca ec 65 4f 65 8f  ca 24 50 53 12 99 e5 de  |....eOe..$PS....|
00000200

Regards
_Linux_Learner

rfernandez 03-28-2010 09:21 AM

See this line?

Code:

title                Linux
 root                (hd0,5)
 kernel                /vmlinuz root=UUID=8e23f395-c033-4245-b5a4-8638437496aa ro quiet splash
initrd                /initrd.img.2.6.28
quiet

It's where your problem is. It's poiting to (hd0,5), which means /dev/sda6 (which no longer exists or doesn't hold de /boot partition). From your first post, I'm guessing that the partition that has /boot in it is now the /dev/sda5 (hd0,4). So, what you'll have to do is edit this menu.lst in /dev/sda5. djsmiley2k already told you how to do that.

Good luck. =)

tommylovell 03-28-2010 12:14 PM

hmmm. rfernandez, I'm not sure that is correct. But it certainly wouldn't hurt making your suggested change to the root statement, as I could be wrong. Actually, I'm often wrong.

If that doesn't help, I'd suggest changing it back to (hd0, 5).

'root (hd0,5)' has gotten grub to the Linux kernel and the initial ramdisk.
I think the statement "Than it throws me to a busy box shell with initramfs prompt.." demonstrates that.

I suspect the problem has to do with mounting the root file system and that we're we're past grub problems. Everything in the bootinfoscript output looks good to me.

_Linux_Learner, what were the messages that preceeded "/dev/disk/by-uuid/<uuid of the root partition> does not exist"?

If you do an 'ls -l /dev/disk/by-uuid' at the initramfs prompt, what do you get? Does it show any other disks? Or do you get an error?


All times are GMT -5. The time now is 11:50 PM.