Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore backup on RawDevice (error during "open O_CREAT" operation for file "/dev/sda1") [CORE6541] #6768

Closed
firebird-automations opened this issue Apr 16, 2021 · 6 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Sascha Michel (datiscum1)

My blockdevice
root@U2004Firebird4Test:~#⁠ ls -lh /dev/sda1
brw-rw---- 1 firebird firebird 8, 0 Apr 15 20:53 /dev/sda1

root@U2004Firebird4Test:~#⁠ time /opt/firebird/bin/gbak -C -user sysdba -pas 'XXXXXXX' /DB/MATest.fbk /dev/sda1
gbak: ERROR:I/O error during "open O_CREAT" operation for file "/dev/sda1" <---- why error on open/create File ??
gbak: ERROR: Error while trying to create file
gbak: ERROR: Device or resource busy
gbak: ERROR:failed to create database /dev/sda1
gbak:Exiting before completion due to errors

brw-rw---- 1 firebird firebird 8, 0 Apr 15 20:53 /dev/sda1
root@U2004Firebird4Test:~#⁠ time dd if=/dev/zero of=/dev/sda1 bs=32k count=1000 oflag=sync
1000+0 records in
1000+0 records out
32768000 bytes (33 MB, 31 MiB) copied, 0.154765 s, 212 MB/s

I have not found any other syntax for "raw devices", is there something new/different here ?

Commits: d5bcc64 2dd7b3f

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 4.0.0 [ 10931 ]

Fix Version: 3.0.8 [ 10960 ]

@AlexPeshkoff
Copy link
Member

Sascha Michel added a comment - 24/Apr/21 03:41 PM
/opt/firebird/bin/gbak -v -C -user sysdba -pas 'XXXXX' /DB/MATest.fbk /dev/sda1

gbak:opened file /DB/MATest.fbk
gbak:transportable backup -- data in XDR format
gbak: backup file is compressed
gbak:backup version is 10
gbak: ERROR:I/O error during "open O_CREAT" operation for file "/dev/sda1"
gbak: ERROR: Error while trying to create file
gbak: ERROR: Device or resource busy
gbak: ERROR:failed to create database /dev/sda1
gbak:Exiting before completion due to errors

Even if there is no data in the RawDevice, the switch "-Rep" must be used. Is that the way it is supposed to be?

/opt/firebird/bin/gbak -C -REP -user sysdba -pas 'XXXXX' /DB/MATest.fbk /dev/sda1

This will work.

@AlexPeshkoff
Copy link
Member

I can not reproduce this. Tried once again:

fbs3 /usr/home/firebird/HEAD/gen/Debug/firebird/bin # ./gbak -v -C -user sysdba -pas masterkey e.gbak /dev/sdb3
gbak:opened file e.gbak
gbak:transportable backup -- data in XDR format
gbak: backup file is compressed
gbak:backup version is 11
gbak:created database /dev/sdb3, page_size 8192 bytes
gbak:started transaction
gbak:restoring domain FIRSTNAME
..................
gbak:finishing, closing, and going home
gbak:adjusting the ONLINE and FORCED WRITES flags
fbs3 /usr/home/firebird/HEAD/gen/Debug/firebird/bin #

I can find particular place in code where error
gbak: ERROR:I/O error during "open O_CREAT" operation for file "/dev/sda1"
is raised but I have no idea why does engine reach that line on your box.

To help ypu I need a way to reproduce this.

@AlexPeshkoff
Copy link
Member

BTW, what version did you check last time? Snapshot with the fix?

@datiscum
Copy link

Sorry, but I didn't get an email that there was a new message.
I only tested it with the Firebird 4 snapshot "Firebird-4.0.0.2439".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants