[NTLUG:Discuss] cfdisk and bootable partition flag

Terry trryhend at gmail.com
Thu Jan 12 12:12:15 CST 2006


On 1/12/06, ntlug at levelofdetail.com <ntlug at levelofdetail.com> wrote:
> Thanks for previous replies. Very helpful.
>
> Below is the fdisk output. hda and hdb look a lot alike because I dd hda
> to hdb for backup purposes. (Not the most efficient, I know, but it's
> just a home machine.)
>
> -------
> Disk /dev/hda: 80.0 GB, 80026361856 bytes
> 255 heads, 63 sectors/track, 9729 cylinders
> Units = cylinders of 16065 * 512 = 8225280 bytes
>
>    Device Boot      Start         End      Blocks   Id  System
> /dev/hda1               1         129     1036161   82  Linux swap /
> Solaris
> /dev/hda2             130        5351    41945715   83  Linux
> /dev/hda3            5352        7310    15735667+  83  Linux
> /dev/hda4            7311        9728    19422585   83  Linux
>
> Disk /dev/hdb: 80.0 GB, 80026361856 bytes
> 255 heads, 63 sectors/track, 9729 cylinders
> Units = cylinders of 16065 * 512 = 8225280 bytes
>
>    Device Boot      Start         End      Blocks   Id  System
> /dev/hdb1               1         129     1036161   82  Linux swap /
> Solaris
> /dev/hdb2             130        5351    41945715   83  Linux
> /dev/hdb3            5352        7310    15735667+  83  Linux
> /dev/hdb4            7311        9728    19422585   83  Linux
> -------
>
> The things that originally got me wondering what heck is going on were:
>
> 1. Neither fdisk nor cfdisk indicates a bootable partition. From

It is not necessary to designate a partition as bootable in order for
Linux to boot to it, so we just don't go through any unnecessary steps
such as setting a bootable flag on a certain partition [when it's not
necessary].

The standard directory structure for a Linux system places the
bootable kernel(s) in a specific directory, [/boot], and it can reside
on a small partition by itself, or it can be on a partition with lots
of other files, it doesn't really matter. You can easily determine
where it is by issuing the command
df

In the output of
df
look for /boot or /
if /boot is on a partition by itself, it will be obvious.  If not, it
will be in / and what ever partition / is located in, is where your
/boot directory is.  If you issue command
ls /boot
you should see the kernel or kernels you have the option of booting to.

I guess what I'm trying to say is that having a "bootable partition"
is a thing of the past.  It is no longer necessary to set a "bootable
flag" on a particular partition because of the fact that modern
operating systems just don't require it, ... [not any more].


> previous posts I gather that Grub on the MBR points to the location (a
> physical hd location, not logical) of Grub on the boot sector of the
> bootable partition. I assume, then, that a bootable flag is not even
> needed and wasn't set on installation. (SUSE 9.2)

Yes, the bootable flag is obsolete and has been for some time now.

>
> and then some weirdness -
>
> 2. If I  cfdisk -P /dev/hdb, the cfdisk header indicates that I'm
> looking at hda. (Really!) From the header:
>
> cfdisk 2.12c
> Disk Drive: /dev/hda
> Size: 80026361856 bytes, 80.0 GB
> Heads: 255   Sectors per Track: 63   Cylinders: 9729
>
> Does it say "/dev/hda" because /dev/hdb is a dd copy of /dev/hda? My
> theory - when I dd the entire disk, I'm dd'ing "I am hda" to hdb
> somewhere and cfdisk is picking that up rather than reporting its
> physical location, which we already know because that's what we asked
> for in the first place.
>
> (By they way - cfdisk -P /dev/hda shows that it is /dev/hda also.)

I don't use cfdisk, I use fdisk.  cfdisk may have it's uses, but I
just don't find the need for it. I  have it on one of my systems, but
"cfdsk -P /dev/hda" is not even a valid command  - r, s or t must be
specified for it to be valid.  i.e. 'cfdisk -Pr /dev/hda" or "cfdisk
-Ps /dev/hda" or "cfdisk -Pt /dev/hda" must be used to get any output,
(from my implementation of cfdisk).

fdisk -l /dev/hda
or
fdisk -l /dev/hda
appears [to me] to be a better or more accurate way of looking at
partition information.

The command:
df
will more than likely give you the specific information you are most
interested in seeing.
df  reports filesystem and disk space usage.

The command
uname -a
or
uname -r
will tell you the version of kernel you are running on in your present
session.  And
ls /boot
will show you the actual kernel name(s) that  you have on your system.




More information about the Discuss mailing list