Softpanorama
(slightly skeptical) Open Source Software Educational Society

May the source be with you, but remember the KISS principle ;-)

Softpanorama Search

Linux Disk Partitioning

News

Recommended Books

Recommended Links

Reference

LVM

Software RAID

Ext3 filesystem

Repartitioning Grub Booting into Rescue Mode Linux Image-based backups and SystemRescueCD      
Linux Multipath udev Labeling the partition Loopback filesystem How To Manage Your Disk By UUID Humor Etc

You can generally view the partitions that system recognized via fdisk -l. If LVM is used it produced a lot of extra junk messages that need to be filtered, but still information is usable. .

On the desktop PC among the typical reasons that the disk is not visible is that you forget to attach power or interface cable or both :-).

During installation, you are asked which partitioning method to use. You can remove linux partitions on selected drives and create the default layout, remove all partitions on selected drives and create the default layout, use free space on selected drives and create the default layout, or create a custom layout.

Linux uses DOS partitioning scheme with up to four primary partitions. Instead of one primary partitions an extended partition can be created and it can be as many sub partitions on extended partitions as you wish.  That is actually the standard partitioning scheme: three primary partitions and one extended.

Some excellent Windows partitioning and backup tools like Ghost and Partition Magic understand and can work with Linux partitions.

Three primary partitions are usually created directly (boot, root partition and swap). For extended partition traditionally the Logical Volume Manager (LVM) is used to divide the hard drive, and then the necessary Linux mount points are created.

On desktops for reliability you can use hardware or software RAID.  Please note that this is a mixed blessing: in case of corruption recovery is more difficult.

Understanding Partitioning

LVM offer an important benefit: the ability to resize partitions dynamically as well as combining multiple hard drives into logical physical devices. RAID permits  striping and mirrowing of drives. Sometimes it is necessary to just create partitions on the hard drives. Even when using RAID, partitions are created before the LVM or RAID layer is implemented.

To view a list of partitions on the system, use the fdisk -l command as root.  If the system uses LVM or RAID, the fdisk -l output will reflect it.

During installation, the hard drives can be partitioned, given a filesystem type for formatting, and assigned a mount point. If hard drives are added to the system after installation or a hard drive has to be replaced, it is important to understand how to perform these functions post-installation.

Caution

Perform all these actions in rescue mode without the filesystem mounted or ensure the entire device is not mounted before manipulating the partition table for it. Most changes to the partition table require a reboot. When you exit rescue mode, the system will reboot.

Creating Partitions

A partition can be created only from free space on a hard drive.  If there is no free space one or several paritions should be deleted before new can be created. You might also add a new hard drive to the system.

There are two partitioning utilities in Red Hat Enterprise Linux: parted and fdisk.  The parted utility includes a resize utility and is a bit more user-friendly. But most admin still use fdisk. It has support for BSD disk labels and other non-DOS partition tables. For more information see the man page.

Fdisk usage

Fdisk usage is well described in Linux Partition HOWTO ( Partitioning with fdisk) and Novell article  Manually Partitioning Your Hard Drive with fdisk.

Here is the information form HOWTO:

This section shows you how to actually partition your hard drive with the fdisk utility. Linux allows only 4 primary partitions. You can have a much larger number of logical partitions by sub-dividing one of the primary partitions. Only one of the primary partitions can be sub-divided.

Examples:

  1. Four primary partitions (see Section 5.2)
  2. Mixed primary and logical partitions (see Section 5.3)

5.1. fdisk usage

fdisk is started by typing (as root) fdisk device at the command prompt. device  might be something like /dev/hda or /dev/sda (see Section 2.1.1). The basic fdisk commands you need are:

p print the partition table

n create a new partition

d delete a partition

q quit without saving changes

w write the new partition table and exit

Changes you make to the partition table do not take effect until you issue the write (w) command. Here is a sample partition table:

Disk /dev/hdb: 64 heads, 63 sectors, 621 cylinders
Units = cylinders of 4032 * 512 bytes
 
   Device Boot    Start       End    Blocks   Id  System
/dev/hdb1   *         1       184    370912+  83  Linux
/dev/hdb2           185       368    370944   83  Linux
/dev/hdb3           369       552    370944   83  Linux
/dev/hdb4           553       621    139104   82  Linux swap
The first line shows the geometry of your hard drive. It may not be physically accurate, but you can accept it as though it were. The hard drive in this example is made of 32 double-sided platters with one head on each side (probably not true). Each platter has 621 concentric tracks. A 3-dimensional track (the same track on all disks) is called a cylinder. Each track is divided into 63 sectors. Each sector contains 512 bytes of data. Therefore the block size in the partition table is 64 heads * 63 sectors * 512 bytes er...divided by 1024. (See 4 for discussion on problems with this calculation.) The start and end values are cylinders. 

5.2. Four primary partitions

The overview:

Decide on the size of your swap space (see Section 4.4) and where it ought to go (see Section 4.4.3). Divide up the remaining space for the three other partitions.

Example:

I start fdisk from the shell prompt:

# fdisk /dev/hdb 
which indicates that I am using the second drive on my IDE controller. (See Section 2.1.) When I print the (empty) partition table, I just get configuration information.
Command (m for help): p

Disk /dev/hdb: 64 heads, 63 sectors, 621 cylinders
Units = cylinders of 4032 * 512 bytes
I knew that I had a 1.2Gb drive, but now I really know: 64 * 63 * 512 * 621 = 1281982464 bytes. I decide to reserve 128Mb of that space for swap, leaving 1153982464. If I use one of my primary partitions for swap, that means I have three left for ext2 partitions. Divided equally, that makes for 384Mb per partition. Now I get to work.
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-621, default 1):<RETURN>
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-621, default 621): +384M
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (197-621, default 197):<RETURN>
Using default value 197
Last cylinder or +size or +sizeM or +sizeK (197-621, default 621): +128M
Now the partition table looks like this:
   Device Boot    Start       End    Blocks   Id  System
/dev/hdb1             1       196    395104   83  Linux
/dev/hdb2           197       262    133056   83  Linux
I set up the remaining two partitions the same way I did the first. Finally, I make the first partition bootable:
Command (m for help): a
Partition number (1-4): 1
And I make the second partition of type swap:
Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): 82
Changed system type of partition 2 to 82 (Linux swap)      
Command (m for help): 
	The end result:	
				
Disk /dev/hdb: 64 heads, 63 sectors, 621 cylinders
Units = cylinders of 4032 * 512 bytes
 
   Device Boot    Start       End    Blocks   Id  System
/dev/hdb1   *         1       196    395104+  83  Linux
/dev/hdb2           197       262    133056   82  Linux swap
/dev/hdb3           263       458    395136   83  Linux
/dev/hdb4           459       621    328608   83  Linux          
Finally, I issue the write command (w) to write the table on the disk. 

Side topics:

5.3. Mixed primary and logical partitions

The overview: create one use one of the primary partitions to house all the extra partitions. Then create logical partitions within it. Create the other primary partitions before or after creating the logical partitions.

Example:

I start fdisk from the shell prompt:

# fdisk /dev/sda
which indicates that I am using the first drive on my SCSI chain. (See Section 2.1.) 

First I figure out how many partitions I want. I know my drive has a 183Gb capacity and I want 26Gb partitions (because I happen to have back-up tapes that are about that size).

183Gb / 26Gb = ~7

so I will need 7 partitions. Even though fdisk accepts partition sizes expressed in Mb and Kb, I decide to calculate the number of cylinders that will end up in each partition because fdisk reports start and stop points in cylinders. I see when I enter fdisk that I have 22800 cylinders.

> The number of cylinders for this disk is set to 22800.  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., LILO) 2) booting and partitioning software from other
> OSs  (e.g., DOS FDISK, OS/2 FDISK)
So, 22800 total cylinders divided by seven partitions is 3258 cylinders. Each partition will be about 3258 cylinders long. I ignore the warning msg because this is not my boot drive (Section 4). 

Since I have 4 primary partitions, 3 of them can be 3258 long. The extended partition will have to be (4 * 3258), or 13032, cylinders long in order to contain the 4 logical partitions.

I enter the following commands to set up the first of the 3 primary partitions (stuff I type is bold ):

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-22800, default 1): <RETURN>
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-22800, default 22800): 3258
Partition number (1-4): 4
First cylinder (9775-22800, default 9775): <RETURN>
Using default value 9775
Last cylinder or +size or +sizeM or +sizeK (9775-22800, default 22800): <RETURN>
Using default value 22800
/dev/sda1             1      3258  26169853+  83  Linux
/dev/sda2          3259      6516  26169885   83  Linux
/dev/sda3          6517      9774  26169885   83  Linux
/dev/sda4          9775     22800 104631345    5  Extended
Next I segment the extended partition into 4 logical partitions, starting with the first logical partition, into 3258-cylinder segments. The logical partitions automatically start from /dev/sda5.
Command (m for help):  n
First cylinder (9775-22800, default 9775): <RETURN>
Using default value 9775
Last cylinder or +size or +sizeM or +sizeK (9775-22800, default 22800): 13032
The end result is: nt color="#000000">
   Device Boot    Start       End    Blocks   Id  System
/dev/sda1             1      3258  26169853+  83  Linux
/dev/sda2          3259      6516  26169885   83  Linux
/dev/sda3          6517      9774  26169885   83  Linux
/dev/sda4          9775     22800 104631345    5  Extended
/dev/sda5          9775     13032  26169853+  83  Linux
/dev/sda6         13033     16290  26169853+  83  Linux
/dev/sda7         16291     19584  26459023+  83  Linux
/dev/sda8         19585     22800  25832488+  83  Linux
Finally, I issue the write command (w) to write the table on the disk. To make the partitions usable, I will have to format (Section 10.1) each partition and then mount (Section 10.3) it. 

5.4. Submitted Examples

I'd like to submit my partition layout, because it works well with any distribution of Linux (even big RPM based ones). I have one hard drive that ... is 10 gigs, exactly. Windows can't see above 9.3 gigs of it, but Linux can see it all, and use it all. It also has much more than 1024 cylenders.

Table 7. Partition layout example
Partition Mount point Size
/dev/hda1 /boot (15 megs)
/dev/hda2 windows 98 partition (2 gigs)
/dev/hda3 extended (N/A)
/dev/hda5 swap space (64 megs)
/dev/hda6 /tmp (50 megs)
/dev/hda7 / (150 megs)
/dev/hda8 /usr (1.5 gigs)
/dev/hda9 /home (rest of drive)
 

I test new kernels for the USB mass storage, so that explains the large /boot partition. I install LILO into the MBR, and by default I boot windows (I'm not the only one to use this computer).

I also noticed that you don't have any REAL examples of partition tables, and for newbies I HIGHLY suggest putting quite a few up. I'm freshly out of the newbie stage, and partitioning was what messed me up the most.

Usage of parted

As root, issue the parted command followed by the device name such as

parted /dev/sda

You are now in an interactive parted shell, in which the commands executed manipulate the device specified.

Once again, the output will differ depending on the partitioning scheme being used.

To create a partition in parted, issue the following command at the interactive parted prompt:

mkpart <part-type> <fs-type> <start> <end>

<part-type> must be one of primary, logical, or extended. <fs-type> must be one of fat16, fat32, ext2, HFS, linux-swap, NTFS, reiserfs, or ufs. The <start> and <end> values should be given in megabytes and must be given as integers.

The ext3 filesystem is the default filesystem for Red Hat Enterprise Linux. It is the ext2 filesystem plus journaling. To create an ext3 filesystem, use ext2 as the <fs-type> and then use the -j option to mke2fs to make the filesystem ext3 as described in the next section.

After creating the partition, use the print command again to verify that the partition was created. Then type quit to exit parted.

Creating a Filesystem on a Partition

Next, create a filesystem on the partition. To create an ext3 filesystem (default used during installation), as root, execute the following, where <device> is the device name for the partition such as /dev/sda1:

mke2fs -j <device>

If the partition is to be a swap partition, format it with the following command as root:

mkswap <device>

Labeling the Partition

To label the partition, execute the following as root:

e2label <device> <label>

While labeling is not required, partition labels can be useful. For example, when adding the partition to /etc/fstab, the label can be listed instead of the partition device name. This proves useful if the partition number is changed from repartitioning the drive or if the partition is moved.

If the e2label command is used with just the partition device name as an argument, the current label for the partition is displayed.

Creating a Mount Point

Now that the partition is created and has a filesystem, as root, create a directory so it can be mounted:

mkdir <dir-name>

Then, mount the new partition:

mount <device> <dir-name>

such as:

mount /dev/sda5 /data

Access the directory and make sure you can read and write to it.

Finally, add the partition to the /etc/fstab file so it is mounted automatically at boot time. For example:

LABEL=data                 /data                 ext3    defaults        1 2

If a new swap partition is added, be sure to use swap as the filesystem type instead:

LABEL=swap2             swap                    swap    defaults        0 0

Resizing Partitions

The parted utility can also be used to resize a partition. After starting parted as root on the desired device, use the following command to resize a specific partition:

resize <minor-num> <start> <end>

To determine the <minor-num> for the partition, look at the partition table with the print command. The <start> and <end> values should be the start and end points of the partition, in megabytes.

Removing Partitions

To use parted to remove a partition, start parted on the desired device as root, and issue the following command at the interactive prompt:

rm <minor-num>

The minor number for the partition is displayed when you execute the print command to list partitions. The data on the partition will no longer be accessible after the partition is removed, so be sure to back up any data you want to keep before removing the partition.

References

The Linux System Administrator's Guide contains several chapters on this theme:

4. Hardware, Devices, and Tools
4.1. Hardware Utilities
4.2. Kernel Modules
5. Using Disks and Other Storage Media
5.1. Two kinds of devices
5.2. Hard disks
5.3. Storage Area Networks - Draft
5.4. Network Attached Storage - Draft
5.5. Floppies
5.6. CD-ROMs
5.7. Tapes
5.8. Formatting
5.9. Partitions
5.10. Filesystems
5.11. Disks without filesystems
5.12. Allocating disk space

Linux Newbie Guide by Stan, Peter and Marie Klimas contains chapter 4.2 about drives

Part  4.2:  Drives
Where are my drives, how to access them, configure user access, get the zip drive recognized, set 32-bit hard drive IO, increase the limit on the number of opened files, add a new hardrive, manage the swap space ...


Notes:
  • This is a Spartan WHYFF (We Help You For Free) site written by people for whom English is not a native language. Some amount of grammar and spelling errors should be expected.
  • The site contain some broken links as it develops like a living tree... Please try to use Google, Open directory, etc. to find a replacement link (see HOWTO search the WEB for details). We would appreciate if you can mail us a correct link.
Google Search
Open directory

Research Index


Old News ;-)

Partitionining of x86, AMD64, and Intel® 64 systems

Generally you do not need separate partitions for /opt and usr, they can happily co-exist with root partition. The only reason to create /usr partition is to make it read-only.

Unless you have a reason for doing otherwise, we recommend that you create the following partitions for x86, AMD64, and Intel® 64 systems:

[Nov 14, 2008] Cool Solutions Manually Partitioning Your Hard Drive with fdisk

20 Jul 2007 | Novell.com

Creating partitions via the command line interface is simple and quick, also having the kernel acknowledge the partition table has been modified and having the partition scheme take effect without having to reboot your workstation/server and without having to use the parted utility.

The first step to this guide is to see what hard drives are available and what hard drive you would like to partition. If you have multiple hard drives in your machine, fdisk will report them to you as shown in Figure 1. There are two hard drives shown in Figure 1 "sda" and "sdb".

The fdisk command with the -l qualifier ("fdisk -l") will display the current partition tables along with the hard drives that are attached to your workstation/server as shown in Figure 1.

 

linux-1reo:~ # fdisk -l

Disk /dev/sda: 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/sda1   *           1        1402    11261533+   7  HPFS/NTFS 
/dev/sda2            1403        1415      104422+  83  Linux 
/dev/sda3            1416        1546     1052257+  82  Linux swap / Solaris 
/dev/sda4            1547        9729    65729947+   5  Extended 
/dev/sda5            1547        7920    51199123+  8e  Linux LVM 

Disk /dev/sdb: 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/sdb1   *           1        9729    78148161   8e  Linux LVM 

Disk /dev/sdc: 500.1 GB, 500107862016 bytes 
255 heads, 63 sectors/track, 60801 cylinders 
Units = cylinders of 16065 * 512 = 8225280 bytes 
Figure 1: fdisk -l output.

Once you have determined which hard drive you want to partition you can issue the fdisk command followed by the hard drive ("fdisk /dev/sda"), in this article we will use the first hard drive (sda).

 

linux-1reo:~ # fdisk /dev/sda
The number of cylinders for this disk is set to 9729. 
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): 
Figure 2: Partitioning the first hard drive (sda).

Once fdisk has been executed your command prompt will change to "Command (m for help):" and you are ready to examine and partition your hard drive. The commands that are supported by fdisk can be displayed by pressing the "m" character followed by the return key. The commands that we will be using are "p" for printing the partition table, "n" for creating a new partition and "w" for saving the changes and exiting.

Displaying the current partition table

The first step before we start to partition our hard drive is to get a sense of what disk space we have available and what the current partition table looks like. The command we will use from fdisk is the "p" character which will print the current partition table as show in Figure 3.

 

Command (m for help): p 

Disk /dev/sda: 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/sda1   *           1          1402    11261533+   7  HPFS/NTFS 
/dev/sda2            1403        1415      104422+  83   Linux 
/dev/sda3            1416        1546     1052257+  82  Linux swap / Solaris 
/dev/sda4            1547        9729    65729947+   5  Extended 
/dev/sda5            1547        7920    51199123+  8e Linux LVM
Figure 3: Current partition table.

The output shown in Figure 3 shows that we have 1809 cylinders available (9729 ? 7920 = 1809) and with this we can use the calculation (1809 * 16065 * 512 = 14879531520 Bytes) which is roughly about 14 gigabytes. (The 16065 and 512 were taken from the "Units =" statement and may differ on you're system, so you may be require to substitute them if necessary).

Creating a new partition

The next step is to create our new partition. For our example, we will create a partition of type "Linux" with the partition size of one gigabyte. The command that we will use to create our new partition is the "n" character, we will then be asked to select what cylinder to start from (I recommend sticking with the default) and the size of the partition as shown in Figure 4.

 

Command (m for help): n 
First cylinder (7921-9729, default 7921): 
Using default value 7921 
Last cylinder or +size or +sizeM or +sizeK (7921-9729, default 9729): +1024M
Figure 4: Creating a new partition with the size of one gigabyte.

Once the partition has been created, using the "p" character we can display our new partition table which will show the newly created partition, as shown in Figure 5.

 

Command (m for help): p 

Disk /dev/sda: 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/sda1   *           1        1402    11261533+   7  HPFS/NTFS 
/dev/sda2            1403        1415      104422+  83  Linux 
/dev/sda3            1416        1546     1052257+  82  Linux swap / Solaris 
/dev/sda4            1547        9729    65729947+   5  Extended 
/dev/sda5            1547        7920    51199123+  8e  Linux LVM 
/dev/sda6            7921        8045     1004031   83  Linux 
Figure 5: Newly created partition (sda6).

Writing the new partitions to disk

Now that the partition has been successfully created you can save the changes by issuing the "w" character which will write the new partition table to the hard disk as shown in Figure 6.

 

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. 
Syncing disks. 
Figure 6: Writing the new partition table to disk.

Activating the newly created partition

Once the new partition table has been written to the hard disk it is possible to have the kernel read the new partition table without the need of rebooting. The first step is to create a mount point for the new partition, in our example we will use "/media/newpart" and also use the command "partprobe" to have the kernel re-read the partition table, as shown in Figure 7.

 

linux-1reo:~ # mkdir /media/newpart 
linux-1reo:~ # partprobe
Figure 7: Creation of a new mount point and a re-read of the partition table.

Now that a new mount point has been created and the partition table has been re-read by the kernel you can now format the partition and place a file system of your choice on it. (ext2, ext3, ResierFS etc) In our example we have chosen the ResierFS file system as shown in Figure 8.

 

linux-1reo:~ # mkfs.reiserfs /dev/sda6
mkfs.reiserfs 3.6.19 (2003 www.namesys.com)

A pair of credits:
The  Defense  Advanced  Research  Projects Agency (DARPA, www.darpa.mil) is the
primary sponsor of Reiser4.  DARPA  does  not  endorse  this project; it merely
sponsors it.

Alexander  Lyamin  keeps our hardware  running,  and was very  generous  to our
project in many little ways.


Guessing about desired format.. Kernel 2.6.16.21-0.8-default is running.
Format 3.6 with standard journal
Count of blocks on the device: 126496
Number of blocks consumed by mkreiserfs formatting process: 8215
Blocksize: 4096
Hash function used to sort names: "r5"
Journal Size 8193 blocks (first block 18)
Journal Max transaction length 1024
inode generation number: 0
UUID: e20e2dc1-7277-4ab1-930c-038e54548540
ATTENTION: YOU SHOULD REBOOT AFTER FDISK!
        ALL DATA WILL BE LOST ON '/dev/sda3'!
Continue (y/n):y
Initializing journal - 0%....20%....40%....60%....80%....100%
Syncing..ok
ReiserFS is successfully created on /dev/sda3.
linux-1reo:~ #
Figure 8: Formatting the newly created partition.

Once the partition has been formatted with the file system of your choice you can mount and use you're newly created partition, Figure 9 shows the newly created partition being mounted.

 

linux-1reo:~ # mount /dev/sda6 /media/partnew
Figure 9: Mounting the newly created partition.

Final thoughts

Once you have mounted your newly created and formatted partition you can store your files on the partition without having any problems, you may also add your new partition to the "/etc/fstab" file so that the partition will be mounted after every reboot.

Tested on:

SUSE Linux Enterprise Desktop 10
SUSE Linux Enterprise Server 10

 

/dev/dm-0 - LinuxQuestions.org

fdisk -l output in case you are using LVM contains many messages like

Disk /dev/dm-0 doesn't contain a valid partition table

This has been very helpful to me. I found this thread by Goggle on
dm-0 because I also got the no partition table error message.

Here is what I think:

When the programs fdisk and sfdisk are run with the option -l and no argument, e.g.
# /sbin/fdisk -l

they look for all devices that can have cylinders, heads, sectors, etc.
If they find such a device, they output that information to standard
output and they output the partition table to standard output. If there is
no partition table, they have an error message (also standard output).
One can see this by piping to 'less', e.g.
# /sbin/fdisk -l | less

/dev/dm-0 ... /dev/dm3 on my fedora C5 system seem to be device mappers
associated with LVM.

RAID might also require device mappers.

Partitioning question - LinuxQuestions.org

If you run suse 10.3 yast > system > partitioner show you with part is used by suse ,and with part is still unused.
I know if you startup the partitioner it gives you a warning but as long as do not change any think every is oke
If according to the partitioner sdb is unused then you can do every think with it for instance to create a second primary partition for a second OS If you put GRUB of the second OS in the second primary partition Suse is still there
and must it be possible to change suse boot loader in that way that she also load the second OS

BUt there are more ways to do what you like to do

all the best

Using Disk Labels on Linux File Systems - BigAdmin - wikis.sun.com

For creating ext3 and xfs file systems, mkfs.ext3 and mkfs.xfs have
the -L option to specify the disk label that should be used. For
existing file systems, use e2label to label an ext2/ext3 file
system. And for xfs file systems, use xfs_admin. Both of these
commands can be used with the device to display the existing disk
label.

Examples of initializing new file systems with a label:

mkfs.ext3 -L ROOT /dev/sda1
mkfs.xfs -L BIGRAID /dev/sde

Examples of e2label and xfs_admin for existing files systems:

e2label /dev/sda1 PRIMARY_ROOT
e2label /dev/sda1

xfs_admin -L DATA1 /dev/sdf
xfs_admin /dev/sdf

labeling swap devices

You can label a swap device by using the mkswap -L label option.

mkswap -L SWAP0 /dev/sdb5

Alternative / by-id

Alternatively, you can use the udev by-id specification (look
in /dev/disk/by-id). The ID paths are usually pretty long
and less meaningful, but they are device specific and won't
change as a result of hardware changes. It's probably best to
use a disk label as above. However, for vfat/fat file systems
disk labels are not available so the by-id specification
should be used.

 /dev/disk/by-id/scsi-3500000e01632b7d0-part2 swap swap defaults 0 0

Examples of Use

Finally, the following are examples of using disk labels in
two key system files, fstab and grub.conf.

Example of /etc/fstab with disk labels:

LABEL=ROOT          /         ext3    defaults        1 1
LABEL=BOOT          /boot     ext3    defaults        1 2
LABEL=SWAP          swap      swap    defaults        0 0
LABEL=HOME          /home     ext3    nosuid,auto     1 2

Example of /boot/grub/grub.conf with disk labels:

title astrid CentOS primary system
  root (hd0,0)
  kernel (hd0,0)/vmlinuz ro root=LABEL=ASTRID_ROOT0 rhgb quiet
  initrd (hd0,0)/initrd-astrid.img

Summary

Linux systems support disk labels via the udev device manager. Using disk
labels avoids hard coding device names which can change if there's a
change in the hardware configuration (disk added/removed). This will result
in a more robust system.

 

[Apr 3, 2008] Corraling Linux Hard Disk Names - Name That Hard Disk! by Carla Schroder

LinuxPlanet

The Linux kernel is a restless beast, and must continally evolve and change. Especially in ways that mystify us poor end lusers. A recent wrinkle, as of kernel version 2.6.20, is changing the /dev names for ATA devices, so that all ATA and SCSI devices are named /dev/sd*. This is a result of using the shiny new libata subsystem. In the olden days PATA (also called IDE) hard drives and ATAPI devices (CD/DVD, tape drives) were /dev/hd*, and SCSI and SATA devices were /dev/sd*.

However, not all Linux distributions default to using libata. *buntu Feisty and Gutsy are all over the map; some versions of them use the new naming convention, some don't, and I haven't figured out which ones, or why. You can see how your own system handles these names with a couple of simple commands. This example from Kubuntu Gutsy shows the old style:

$ ls /dev|grep '[s|h]d[a-z]'
hda
hda1
hda2
hdc
hdd
sda
sda1
sda2

$ mount|grep ^'/dev'
/dev/hda1 on / type ext3 (rw,errors=remount-ro)
/dev/sda1 on /home type ext3 (rw)
/dev/sda2 on /media/sda2 type ext3 (rw)
/dev/hda2 on /var type ext3 (rw)

The first command shows all the ATA and SCSI devices detected by your kernel. The second command shows which ones are mounted. On this system there is one PATA hard disk with two partitions (hda), two CD/DVD drives (hdc, hdd), and one SATA disk with two partitions (sda). When I boot into Fedora 8, which defaults to libata, it looks like this:

$ ls /dev|grep '[s|h]d[a-z]'
sda
sda1
sda2
sdb
sdb1
sdb2
Where are the two CD/DVD drives? These get /dev/sr* names under libata:
$ ls /dev|grep sr
sr0
sr1

Recommended Links

Reference



Copyright © 1996-2009 by Dr. Nikolai Bezroukov. www.softpanorama.org was created as a service to the UN Sustainable Development Networking Programme (SDNP) in the author free time. Submit comments This document is an industrial compilation designed and created exclusively for educational use and is placed under the copyright of the Open Content License(OPL). Site uses AdSense so you need to be aware of Google privacy policy. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.

Disclaimer:

Last modified: April 29, 2009