Total Pageviews

Monday, January 30, 2017

Creation of Raw partitions

Last login: Thu Jan  5 19:47:20 2017 from 192.168.200.1
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# fdisk -l

Disk /dev/sda: 37.5 GB, 37580963840 bytes
255 heads, 63 sectors/track, 4568 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1020     8193118+  83  Linux
/dev/sda2            1021        3631    20972857+  83  Linux
/dev/sda3            3632        3892     2096482+  82  Linux swap / Solaris
/dev/sda4            3893        4568     5429970    5  Extended
/dev/sda5            3893        4153     2096451   83  Linux
/dev/sda6            4154        4217      514048+  83  Linux
[root@localhost ~]#
[root@localhost ~]# cat /etc/sysconfig/rawdevices
# raw device bindings
# format:  <rawdev> <major> <minor>
#          <rawdev> <blockdev>
# example: /dev/raw/raw1 /dev/sda1
#          /dev/raw/raw2 8 5
[root@localhost ~]# fdisk -l

Disk /dev/sda: 37.5 GB, 37580963840 bytes
255 heads, 63 sectors/track, 4568 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1020     8193118+  83  Linux
/dev/sda2            1021        3631    20972857+  83  Linux
/dev/sda3            3632        3892     2096482+  82  Linux swap / Solaris
/dev/sda4            3893        4568     5429970    5  Extended
/dev/sda5            3893        4153     2096451   83  Linux
/dev/sda6            4154        4217      514048+  83  Linux
[root@localhost ~]#
[root@localhost ~]# fdisk /dev/sda

The number of cylinders for this disk is set to 4568.
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): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): p

Disk /dev/sda: 37.5 GB, 37580963840 bytes
255 heads, 63 sectors/track, 4568 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1020     8193118+  83  Linux
/dev/sda2            1021        3631    20972857+  83  Linux
/dev/sda3            3632        3892     2096482+  82  Linux swap / Solaris
/dev/sda4            3893        4568     5429970    5  Extended
/dev/sda5            3893        4153     2096451   83  Linux
/dev/sda6            4154        4217      514048+  83  Linux

Command (m for help): n
First cylinder (4218-4568, default 4218):
Using default value 4218
Last cylinder or +size or +sizeM or +sizeK (4218-4568, default 4568): +3G
Value out of range.
Last cylinder or +size or +sizeM or +sizeK (4218-4568, default 4568): +1G

Command (m for help): p

Disk /dev/sda: 37.5 GB, 37580963840 bytes
255 heads, 63 sectors/track, 4568 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1020     8193118+  83  Linux
/dev/sda2            1021        3631    20972857+  83  Linux
/dev/sda3            3632        3892     2096482+  82  Linux swap / Solaris
/dev/sda4            3893        4568     5429970    5  Extended
/dev/sda5            3893        4153     2096451   83  Linux
/dev/sda6            4154        4217      514048+  83  Linux
/dev/sda7            4218        4340      987966   83  Linux

Command (m for help): n
First cylinder (4341-4568, default 4341):
Using default value 4341
Last cylinder or +size or +sizeM or +sizeK (4341-4568, default 4568): +1G

Command (m for help): p

Disk /dev/sda: 37.5 GB, 37580963840 bytes
255 heads, 63 sectors/track, 4568 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1020     8193118+  83  Linux
/dev/sda2            1021        3631    20972857+  83  Linux
/dev/sda3            3632        3892     2096482+  82  Linux swap / Solaris
/dev/sda4            3893        4568     5429970    5  Extended
/dev/sda5            3893        4153     2096451   83  Linux
/dev/sda6            4154        4217      514048+  83  Linux
/dev/sda7            4218        4340      987966   83  Linux
/dev/sda8            4341        4463      987966   83  Linux

Command (m for help): n
First cylinder (4464-4568, default 4464):
Using default value 4464
Last cylinder or +size or +sizeM or +sizeK (4464-4568, default 4568): +1G
Value out of range.
Last cylinder or +size or +sizeM or +sizeK (4464-4568, default 4568): +500M

Command (m for help): p

Disk /dev/sda: 37.5 GB, 37580963840 bytes
255 heads, 63 sectors/track, 4568 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1020     8193118+  83  Linux
/dev/sda2            1021        3631    20972857+  83  Linux
/dev/sda3            3632        3892     2096482+  82  Linux swap / Solaris
/dev/sda4            3893        4568     5429970    5  Extended
/dev/sda5            3893        4153     2096451   83  Linux
/dev/sda6            4154        4217      514048+  83  Linux
/dev/sda7            4218        4340      987966   83  Linux
/dev/sda8            4341        4463      987966   83  Linux
/dev/sda9            4464        4525      497983+  83  Linux

Command (m for help): wq
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.
[root@localhost ~]# partprobe
Warning: Unable to open /dev/hda read-write (Read-only file system).  /dev/hda has been opened read-only.
Warning: Unable to open /dev/hdb read-write (Read-only file system).  /dev/hdb has been opened read-only.
[root@localhost ~]# fdisk -l

Disk /dev/sda: 37.5 GB, 37580963840 bytes
255 heads, 63 sectors/track, 4568 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1020     8193118+  83  Linux
/dev/sda2            1021        3631    20972857+  83  Linux
/dev/sda3            3632        3892     2096482+  82  Linux swap / Solaris
/dev/sda4            3893        4568     5429970    5  Extended
/dev/sda5            3893        4153     2096451   83  Linux
/dev/sda6            4154        4217      514048+  83  Linux
/dev/sda7            4218        4340      987966   83  Linux
/dev/sda8            4341        4463      987966   83  Linux
/dev/sda9            4464        4525      497983+  83  Linux
[root@localhost ~]#

No comments:

Post a Comment