How to create a partition in Solaris Operating system?

In RHEL we use “fdisk” command to divide a disk in to individual partitions, likewise in Solaris, we execute “format” command to create the partitions.First, check how many hard disks available by running the following command,

Step:1 Check the Hard-disk details
#echo |format

From the above screenshot it has been confirmed we have one hard disk attached to the server.

Step:2 Check the currently configured partition details
#format

Step:3 Use “partition” from the above list to select partition table

Step:4 Use “print” from the above list to display the current partition table details

As we can see from the above output slice 0,1,2,4,7,8 are already created, we can now only create a partition under slice 5.

Step:5 Select any unassigned slice to create a new partition (Here I have applied slice 5)

Step:6 Enter the partition id tag, if you use”?” then it will display the available tag and use one of those, Here I have used “reserved”

Step:7 Enter the partition permission flags, Same as above if you use “?” it will display the available flags .you can use one of those

Step:8 Enter the new starting cylinder, here I have applied 201 according to my existing partition table

Step:9 Enter the partition size, here I have used 500MB according to the existing partition table

Step:10 Again use the “print” to see the newly created partition table

As you can see from the above output, the newly created partition is shown in the partition table(slice 5)

Step:11 Now save the partition information to the kernel memory by using the “label” followed by yes

Note: If you forget to label the partition details to the kernel memory then it won’t be available for use.
Step:12 check the partition layout once again by using the “print” and exit from the format command by using the quit followed by “q”

Step:13 Create a new filesystem

In Linux we use the command “mkfs” to create a new filesystem, here we use “newfs” to create a new “ufs “file system

Syntax:

#newfs   <physical device name>

#newfs  /dev/rdsk/c0d0s5

Note: To create a new filesystem you must use the raw disk(rdsk)

As you can see from the above output the slice s5 is formatted successfully with the “ufs” filesystem

Step:14 Check  whether the file system is in the clean state
#fsck  /dev/rdsk/c0d0s5

Step:15 Now mount the filesystem to some mount point directory to bring the partition to online
#mkdir   /ORACLE

#mount  /dev/dsk/c0d0s5   /ORACLE

Step:16 Check the currently mounted filesystem information by using the following command
#df  -h

As you can see from the above screenshot the slice /dev/dsk/c0d0s5 has been successfully mounted on the mount point directory /ORACLE

In Our next article, I will show you how to make the partition available permanently even after restarting the server.

If you found this article useful, Kindly Subscribe here 👉🏿👉🏿  Click this link to Subscribe

Never miss an article Do like my official  FB page 👉🏿 Learn Linux in an easier way

 

Managing Solaris OS FileSystem

A Filesystem is nothing but it is a collection of files and directories that make up a structured set of information.Solaris OS supports three different types of Filesystem

1.Disk-Based Filesystem

2.Distributed System

3.Pseudo filesystem

Let us see the types one by one in detail

Disk-Based Filesystem:

These types are found on the harddisks, CDROM’s, DVD, floppy.The following are the examples  of the disk-based filesystem

UFS –Unix File System is the default file system in Solaris OPerating system and it is based on the Berkeley fast filesystem

hsfs – High Sierra file system is a special type of filesystem developed for the use of CDROM’s media

pcfs – PC filesystem is the UNIX implementation of the DOS(Disk Operating System) FAT32 filesystem.The pcfs filesystem it allows the Solaris OS to access the PC-DOS formatted filesystems.It allows the users to use the UNIX commands for direct read and write access to PC-DOS files.

udfs – Universal Disk Formatted Filesystem is used for the optical storage targeted at DVDROM media.This filesystem allows universal data exchange and support read and writes operations.

 

Distributed Filesystem:

This filesystem it gives the network access to the file system resources

NFS- Network File system allows the users to share the files among many types of system on the network NFS filesystem makes part of the filesystem on one system appear as though it were part of the local directory tree.

Pseudo filesystem: 

These are the memory based filesystem.These filesystems provide for better system performance and also giving access to kernel information.The pseudo file system includes the following

1.tmpfs = The temporary file system stores files in memory, which avoids the overhead of writing to a disk-based filesystem.The tmfs filesystem is created and remob=ved automatically every time the system is rebooted.

2.swapfs = The swap filesystem is used by the kernel to manage the swap space on disks.

3.procfs = It holds the list of ongoing active processes under the /proc directory .all the processes are listed by a process number.all the information from this directory can be fetched with the ps command.

4.mntfs = The mount filesystem provides the read-only information from the kernel about the locally mounted filesystem details.

5.devfs = This filesystem is used to manage the namespace of all devices on the system This file system  is mainly used for the /devices

 

So in our next article, I will show you how to create partitions in Solaris.

If you found this article useful, Kindly Subscribe here 👉🏾 Click this link to Subscribe
Never miss an article Do like my official  FB page 👉🏿 Learn Linux in an easier way

 

Learn Solaris OS Device Naming conventions

In Solaris operating systems all the devices are identified with the three different names, Let us see what all are the  types of names available

1.Logical device name or Block disk devices

2.Physical device name or Character disk devices.

3.Instance name

Logical Device Name:

A user can access the hardware or device with this logical names, after login to the operating system if a user needs to access the system devices he/she has to access  the device with the logical name.So a logical device name is used to refer to a device when you are entering the commands on the command line

All Logical device names are kept in the directory path /dev and these logical device names are symbolically linked to the physical device names under the path /devices directory.So all the devices have an entry inside the /dev/dsk (logical device name path)and /dev/rdsk (physical device name path).

rdsk means RAW DISK

The logical device name contains the controller number, target number, disk number and slice number i.e c#t#d#s#

To check all the logical device names run the following command

# ls /dev/dsk
c0t0d0s0 c0t0d0s4 c0t2d0s0 c0t2d0s4 c1t1d0s0 c1t1d0s4
c0t0d0s1 c0t0d0s5 c0t2d0s1 c0t2d0s5 c1t1d0s1 c1t1d0s5
c0t0d0s2 c0t0d0s6 c0t2d0s2 c0t2d0s6 c1t1d0s2 c1t1d0s6
c0t0d0s3 c0t0d0s7 c0t2d0s3 c0t2d0s7 c1t1d0s3 c1t1d0s7

c0t0d0s0 to c0t0d0s7  = Represent the device name for the disk slice0 to slice 7 for a disk that is attached to the controller 0 at target 0, on disk unit 0.

c0t2d0s0 to c0t2d0s7 = Represent the device name for the disk slice0 to slice 7 for a disk that is attached to the controller 0 at target 2, on disk unit 0.

c1t1d0s0 to c1t1d0s7 = Represent the device name for the disk slice0 to slice 7 for a disk that is attached to the controller 1 at target 1, on disk unit 0.

Note: On X86 hardware you will not find target, target shows only on SPARC hardware.

Physical Device Names:

The physical device name is nothing but it has the device hardware location i.e the complete PCI address of a device, the physical addresses contain the series of nodes which is separated by slashes, that indicates the path to the devices.All the physical devie names are kept under the /devices directory.

To check all the physical device name details

#ls  -l  /dev/rdsk

To list a individual disk hardware path details

#ls -l /dev/dsk/c0d0s0

Note: Am running the Solaris server fromX86 hardware that is why from the above output it is not showing the target id.

3.Instance Names:

Kernel will assign a shorten name for all the available devices  that are connected to the server that is called as an instance name or we can say like it is a shortened name for the physical device name

Let me show you this with one example:

1.sdn = which means here sd is the disk name and n is the number, such as sd0 for the first SCSI disk  device

2.dadn = which means here dad is the disk name and n is the number, such as dad0 for the first IDE disk  device

for example run the ls -l  /dev/rdsk command to get the physical path details from that output you can find the instance name as below

 

As you can see from the above screenshot sd shows it is an SCSCI disk and the disk number is 0.

How to List the system devie details?

In solaris operating system there are several ways avaiable to list the device physical path information.Let us see that one by one

1./etc/path_to_inst_file

As I explained above the instance name for the devices, For each and every devices the  system stores its physical name and instance name inside the /etc/path_to_inst file.These names are used by the kernel to identify the devices.This file is maintained by the kernel and it is not recommed to edit this file for any purpose

Let me show the entires inside the /etc/path_to_inst file below

Note: Different system have different physical device paths

The following is  a /etc/path_to_inst file from a system that has a diffrent bus architecture, here in this case it is an example of an system that has  onboard sun system bus(SBus)

# cat /etc/path_to_inst
#
# Caution! This file contains critical kernel state
#
“/sbus@1f,0” 0 “sbus”
“/sbus@1f,0/espdma@e,8400000” 0 “dma”
“/sbus@1f,0/espdma@e,8400000/esp@e,8800000” 0 “esp”
“/sbus@1f,0/espdma@e,8400000/esp@e,8800000/sd@3,0” 3 “sd”
“/sbus@1f,0/espdma@e,8400000/esp@e,8800000/sd@2,0” 2 “sd”
“/sbus@1f,0/espdma@e,8400000/esp@e,8800000/sd@1,0” 1 “sd”
“/sbus@1f,0/espdma@e,8400000/esp@e,8800000/sd@0,0” 0 “sd”
“/sbus@1f,0/espdma@e,8400000/esp@e,8800000/sd@6,0” 6 “sd”
“/sbus@1f,0/espdma@e,8400000/esp@e,8800000/sd@5,0” 5 “sd”

2. The prtconf command

prtconf means Print configuration  to get all the system configuration details like Total memory installed, configuration of the peripheral  which is formatted as device tree.The main adavantage of prtconf is it will display all possible instances of devices, wherether the device is attached to the system or not.

#prtconf

This command display all possible instances of devices, wherether the device is attached to the system or not.

If you dont want to see the devices which are not attached you can use the option -v with the prtconf command.

#prtconf   |grep  -v not

 

3.With “format” command

By using the format command you can get the physical name as well the logical names of the disks that are connected to your server and also you can check how many harddisk connected to the server by using this command (In Linux we use fdisk command to list all the disk details the same like here in solaris we use the format command)

#format

Note: Press Control+d to exit  the format command without selecting the disk.

 

If you found this article useful, Kindly Subscribe here  👉🏿 Click this link to Subscribe
Never miss an article Do like my official  FB page 👉🏿Learn Linux in an easier way

Understanding Basic Architecture of a Disk(Solaris)

Introduction:

Before we start the administration parts of Solaris operating system it is must to know the basic architecture disk, Basically, a disk device has both physical component and logical components

The physical components have disk platters and read and write heads

The logical components have disk slices, cylinders, tracks and sectors

Structure of physical disk explanation:

1.The disk storage part is composed of a couple of platters

2.The platters rotate.

3.The head actuator arms move the read and write heads as a unit radially then the read and write heads read and write data on the magnetic surface on both the side of the platters.

Sector = Its a smallest addressable unit on a platter, by default one sector, can hold 512 bytes of data.It can be also known as disk blocks
Tracks = A series of sectors positioned end to end in a circular path.
cylinder=A bulk of tracks.

 

What are Disk Slices in Solaris?

We know after dividing the disk in to individual partitions we call it as a logical partition or LVM partition or raid based on the partition type we use in RHEL, In Solaris, we call it as a slice, once the disk is divided in to individual partitions it is known as disk slices.

For example, One slice can hold critical file system data and another slice on the same disk holds user related files and many more.

Note: A disk under the Solaris OS is divided in to 8 slices i.e labeled from slice 0 to slice 7

Note: Slice 2 it contains the important data about the whole disk, size of the disk, a total number of cylinders remains available for the storage of files and directories.

A starting cylinder and the ending cylinder define each slice.These  cylinder values say the size of a slice,

Let me show you one example

imagine I have total cylinder 3200 (in human readable format 32 GB)

slice 0 offset cylinder:(0-1500),so total cylinder value for slice 0 is 1501

slice 1 offset cylinder:(1501-2000),so total  499 cylinders

slice 2  offset cylinder:(0-3199),so entire   cylinder value is 3200

offset means starting cylinder

Let us have a look at the below tabular column about the disk slices

 

Disk slice Naming convention:

Knowing about the Disk slice naming convention is must in order to learn Solaris disk management an eight character string represent the entire name of the slice.These eight character strings include

1.controller number

2.target number

3.disk number

4.slice number

Controller number:

It identifies the Host Bus Adapter(HBA) which is responsible to control the communication between the system and disk unit. HBA is nothing but responsible for sending and receiving the commands and data to the device.

All controller numbers are assigned in sequential order such as c0,c1,c2,c3 so on…

Target Number:

Is nothing but it is a  unique hardware address that is assigned to each disk, tape, CDROM.Same as controller target numbers are assigned in sequential order such as t0,t1,t2,t3 and so on…

Disk Number:

This is the special number reflects the number of disks at the target location.The Disk Number is also called as LUN.

Slice number:

The slice number range starts from 0 to 7 i.e s0 to s7.Total eight slices

The below diagram shows the string that represents the full name of the disk slice.

In our next article, I will explain the OS device naming conventions in Solaris.

If you found this article useful, Kindly Subscribe here 👉🏿  Click this link to Subscribe
Never miss an article Do like my official  FB page 👉🏿 Learn Linux in a easier way

****************************************************************************************************