Lab for soft and hard links

Hello,
I get this error while creating an hard link, as requested by the exercise.
I even used the exact command as per the solution, but still the same happens

Hi @Mundofik

Is this Q 15 from Lab - Files, Directories, Hard and Soft Links in LFCS course?

I do not know if it is question 15, but the title of the lab is in the screenshot and it is in the LFCS category of the community, so yes, it is for those.

Can you please confirm it?

Because the link that needs to be created for is not /tmp/hlink but /opt/hlink

Don’t know if the exercise was modified or if it gets re-genarated, but I posted the screenshot of the solution provided by KK, the error is not mine.
The exercise was asking for /tmp/hlink

image

Here’s the solution from the lab:

It would help if you could share the question No. please.

Well, it seems the exercise was modified with /opt/hlink rather than /tmp/hlink
Probably it was already reported and they fixed it. I did the exercise last week, but did not have access to the community to post my questions.

Thanks.

I seem to recall there was an internal ticket raised relating to a hard link question recently, so was probably this one - and thus likely now fixed.

The important thing to understand about hard links is that you cannot create a hard link to an object in a different filesystem. This is because a hard link is a link to an inode and inodes are part of a single filesystem.

/tmp is almost always on its own filesystem separate from other filesystems unless the system is incorrectly set up. Thus you can only hard link from somewhere in /tmp to somewhere else in /tmp.

The command df -h shows all the unique filesystems, where they are mounted, the type, size and the free space.

If you’re more used to Windows, think of filesystem in Linux being like a drive (e.g. C:) in Windows. It’s not well known but Windows also supports hard and soft links. You can’t hard link from somewhere on C: to somewhere on D:, but you can soft link.

Great, thank you so much!