Summary: Troubleshooting onspaces -c failures in GBase Database(GBase 8s). Learn how to check file paths, Linux permissions, dbspace names, chunk size, offset, and page size before creating a new dbspace.
When onspaces -c fails in GBase Database(GBase 8s), the error message is often just one or two lines. But the actual cause may be a missing file, incorrect ownership, a duplicate dbspace name, or an invalid parameter.
Instead of repeatedly modifying the command, check the five common causes below in order. Each one has a simple verification method.
1. The Chunk File Does Not Exist
onspaces uses an existing file as the physical storage location for a chunk. It does not create the file automatically.
Check whether the specified path exists:
ls -l /data/gbase/datachk01
If the file is missing, create it:
touch /data/gbase/datachk01
If the directory does not exist, create it first:
mkdir -p /data/gbase
Two situations are particularly easy to overlook:
- A typo in the file path.
- A storage mount point that has not been mounted.
Both can cause GBase Database to report that the target file cannot be accessed.
Before running onspaces -c, confirm that the directory and file exist and that the underlying filesystem is mounted.
2. File Ownership or Permissions Are Incorrect
Even when the file exists, GBase Database may reject it if the database user cannot access it correctly.
Check the file:
ls -l /data/gbase/datachk01
The expected ownership and permission settings in this example are:
Owner: gbasedbt
Group: gbasedbt
Mode: 660
If the file was created by root, correct its ownership and permissions:
chown gbasedbt:gbasedbt /data/gbase/datachk01
chmod 660 /data/gbase/datachk01
The important point is that the database process must have the appropriate access to the chunk file.
Both overly restrictive and unnecessarily permissive settings can cause problems, depending on the environment and security configuration.
For a standard setup, verify the expected gbasedbt:gbasedbt ownership and 660 permissions before proceeding.
3. The Dbspace Name Already Exists
The -c option creates a new dbspace. Its name must be unique within the database instance.
Check existing storage spaces:
onstat -d | grep -i datadbs01
If the dbspace already exists, creating another one with the same name will fail.
First decide what you actually need:
-
Create a new dbspace: Use
onspaces -c. -
Add a chunk to an existing dbspace: Use
onspaces -a.
For example:
onspaces -a datadbs01 -p /data/gbase/datachk02 -o 0 -s 512000
This distinction is important when managing storage capacity in GBase Database. Creating a new dbspace and expanding an existing one are different operations.
4. Chunk Size or Offset Is Invalid
Two parameters deserve particular attention:
-
-s: Chunk size, specified in KB. -
-o: Offset, specified in KB.
A typical command looks like this:
onspaces -c -d datadbs01 \
-p /data/gbase/datachk01 \
-o 0 \
-s 512000
Here, the requested chunk size is 512,000 KB.
Before executing the command, check available filesystem capacity:
df -h /data/gbase
Common mistakes include:
- Requesting more space than the filesystem can provide.
- Confusing KB with MB when calculating
-s. - Specifying an invalid offset.
- Using an offset that overlaps an existing occupied region in the target file.
For a new, empty chunk file, an offset of 0 is commonly used.
If the file already contains data, the offset must be selected carefully to avoid overwriting existing content.
Always verify the actual available capacity and parameter units before creating the chunk.
5. The Page Size Is Invalid
The page size is another parameter that can cause dbspace creation to fail.
In GBase Database(GBase 8s), supported page sizes include:
- 2KB
- 4KB
- 8KB
- 16KB
The page size must be a multiple of 2KB and cannot exceed 16KB.
For example:
-k 16
Specifies a 16KB page size.
Avoid assuming that alternative unit formats such as -k 16K are accepted. Check the command syntax for your installed version.
There is also an important distinction between creating and expanding storage:
When adding a chunk to an existing dbspace, the new chunk must use a page size compatible with that dbspace.
A page-size mismatch can prevent the operation from succeeding.
Troubleshooting Order: Check Preconditions Before Parameters
The five causes can be organized into a simple troubleshooting sequence:
| Order | What to check | Verification |
|---|---|---|
| 1 | File existence | ls -l |
| 2 | Ownership and permissions | ls -l |
| 3 | Dbspace name uniqueness | onstat -d |
| 4 | Size and offset |
df -h and command parameters |
| 5 | Page size | Verify -k and existing dbspace configuration |
This sequence follows a practical principle: check the file, permissions, naming, and parameters one layer at a time.
An error such as "cannot open file" may appear straightforward, but the underlying cause could be an incorrect owner, an unavailable mount point, or an invalid path.
Checking each precondition independently is more effective than repeatedly changing command arguments without identifying the actual problem.
A Five-Item Checklist Before Running onspaces -c
Before creating a dbspace in GBase Database, verify these five items:
- File: The target chunk file exists and its filesystem is mounted.
-
Ownership: The file belongs to
gbasedbt:gbasedbt. -
Permissions: The file has the expected
660mode. - Naming: The dbspace name does not already exist.
- Parameters: Chunk size is specified in KB, offset is valid, and page size meets the supported requirements.
These checks take little time, but they can prevent unnecessary troubleshooting.
Final Thoughts
Storage creation in GBase Database(GBase 8s) does not involve a particularly complicated command. Most failures occur because one of the prerequisites has not been satisfied.
The best approach is to turn these five checks into a standard pre-creation checklist and include it in your database operations runbook.
Dbspace creation may be an infrequent operation, but that is exactly why a documented procedure matters. When the command is used only occasionally, relying on memory is less reliable than following a verified checklist.
Top comments (0)