Skip to content

device/FIFO hardlinks #2324

@ThomasWaldmann

Description

@ThomasWaldmann

While borg has great support for hardlinked regular files, it does not yet do anything special for hardlinked other filesystem items:

# create some devices and a symlink
tw@tux:~/aaa$ sudo mknod b00 b 0 0
tw@tux:~/aaa$ sudo mknod c00 c 0 0
tw@tux:~/aaa$ ln -s /vmlinuz symlink

# create hardlinks to them
tw@tux:~/aaa$ sudo ln b00 b00h
tw@tux:~/aaa$ sudo ln c00 c00h
tw@tux:~/aaa$ sudo ln symlink symlinkh

# at the left there is the inode number:
tw@tux:~/aaa$ ls -li
total 0
4187051 brw-r--r-- 2 root root 0, 0 Mar 21 04:44 b00
4187051 brw-r--r-- 2 root root 0, 0 Mar 21 04:44 b00h
4187052 crw-r--r-- 2 root root 0, 0 Mar 21 04:44 c00
4187052 crw-r--r-- 2 root root 0, 0 Mar 21 04:44 c00h
4187053 lrwxrwxrwx 2 tw   tw      8 Mar 21 04:45 symlink -> /vmlinuz
4187053 lrwxrwxrwx 2 tw   tw      8 Mar 21 04:45 symlinkh -> /vmlinuz

tw@tux:~/aaa$ borg init repo
tw@tux:~/aaa$ borg create repo::arch .

tw@tux:~/aaa$ mkdir extr ; cd extr
tw@tux:~/aaa/extr$ sudo borg extract ../repo::arch

tw@tux:~/aaa/extr$ ls -li
total 0
4187086 brw-r--r-- 1 root root 0, 0 Mar 21 04:44 b00
4187087 brw-r--r-- 1 root root 0, 0 Mar 21 04:44 b00h
4187100 crw-r--r-- 1 root root 0, 0 Mar 21 04:44 c00
4187101 crw-r--r-- 1 root root 0, 0 Mar 21 04:44 c00h
4187080 lrwxrwxrwx 1 tw   tw      8 Mar 21 04:45 symlink -> /vmlinuz
4187083 lrwxrwxrwx 1 tw   tw      8 Mar 21 04:45 symlinkh -> /vmlinuz

So, the hardlinked devices/symlink were not restored in a hardlinked way.

borg 1.0.10.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions