Error 5123

Severity

16

Message text

DISK INIT encountered an error while attempting to open/create the physical file. Please consult the SQL Server error log (in the SQL Server boot directory) for more details.

NoteThis error may be caused by a hardware problem.

Explanation

This error occurs when a disk init command fails while trying to initialize an operating system file or a raw partition for use as a database device. It can occur for the following reasons:

Action

Check each section below, make any needed changes and then run the command again.


Incorrect device name

Make sure you have the correct physical device name. Refer to the Adaptive Server installation and configuration guide for your platform or “Specifying a physical device name with disk init” in the System Administration Guide: Volume 1 in the chapter “Initializing Database Devices” for instructions.


Permission problem

If Adaptive Server was started using the “sybase” account, there must be permission to write to the raw partition or to create a file in the directory specified by disk init. Raw partitions used by Sybase should always be owned by the “sybase” account. Correct the permissions problem and execute the command again, using a different vdevno. Refer to “Virtual device number” for more information.

NoteAdaptive Server should not be started by “root.” If it is started by root, you will get error 5123 if the device or file is owned by “sybase.”


Incorrect size (pre-12.5 servers)

When you request initialization of a raw device, you must specify a size that is not larger than the size of the raw partition.

The size parameter of the disk init command must be specified in units of 2K blocks (the size of most data pages). There are 512 2K blocks in a megabyte. Use the formula:

#_of_Megabytes * #_of_data_pages_per_Megabyte = #_of_2K_blocks

For example, to initialize a 10MB Sybase device, specify 5120 for the size:

10MB * 512 = 5120

To determine the number of 2K blocks to use for a raw partition on a UNIX system, convert the size of the partition, in sectors, to 2K blocks. The size of a sector varies on different UNIX systems. For example, it is 512 bytes on Sun, so use sectors/4 for the size parameter. It is 1024 bytes on HP, so use sectors/2. Also, see the information below about virtual device numbers. You must restart Adaptive Server or use a different virtual device number when you reissue the disk init command.

Refer to the Adaptive Server Enterprise installation and configuration guide for your platform for more information about Sybase and your operating system’s partitions. For example, on UNIX, there is a size limitation of 2GB for a device file.

NoteNot all operating systems have partitions as described above.

Additional information

Refer to “Initializing Database Devices” in the System Administration Guide: Volume 1 for information about disk init.

Versions in which this error is raised

All versions