What happens when you make a hard link to a file in /mnt, and then unmount?How to make and restore incremental snapshots of hard diskWhy are hard links not allowed for directories?Mount and unmount errors when usb is connected in 12.10.What are some typical uses of hard links?Are softlinks and hardlinks somewhat related to mutable and immutable objects (in java) in any sense?Default number of links for directory?Mount an ext hard drive and then delete the target mount folderWhat is a file system seen as by the OS?Nautilus - no support for hard links?Make link open target file, not file at link location
What is better: yes / no radio, or simple checkbox?
Sampling from Gaussian mixture models, when are the sampled data independent?
What should I do when a paper is published similar to my PhD thesis without citation?
Can I negotiate a patent idea for a raise, under French law?
Does the US political system, in principle, allow for a no-party system?
Can the Witch Sight warlock invocation see through the Mirror Image spell?
Called into a meeting and told we are being made redundant (laid off) and "not to share outside". Can I tell my partner?
What was so special about The Piano that Ada was willing to do anything to have it?
Are these two graphs isomorphic? Why/Why not?
Trocar background-image com delay via jQuery
Writing text next to a table
Are small insurances worth it?
Is there a way to make cleveref distinguish two environments with the same counter?
Difference between `nmap local-IP-address` and `nmap localhost`
Can one live in the U.S. and not use a credit card?
Why is there an extra space when I type "ls" on the Desktop?
If sound is a longitudinal wave, why can we hear it if our ears aren't aligned with the propagation direction?
Professor forcing me to attend a conference, I can't afford even with 50% funding
What does *dead* mean in *What do you mean, dead?*?
Either of .... (Plural/Singular)
Is it possible to clone a polymorphic object without manually adding overridden clone method into each derived class in C++?
Which country has more?
How to write a chaotic neutral protagonist and prevent my readers from thinking they are evil?
Graphic representation of a triangle using ArrayPlot
What happens when you make a hard link to a file in /mnt, and then unmount?
How to make and restore incremental snapshots of hard diskWhy are hard links not allowed for directories?Mount and unmount errors when usb is connected in 12.10.What are some typical uses of hard links?Are softlinks and hardlinks somewhat related to mutable and immutable objects (in java) in any sense?Default number of links for directory?Mount an ext hard drive and then delete the target mount folderWhat is a file system seen as by the OS?Nautilus - no support for hard links?Make link open target file, not file at link location
As far as I know, hard links will not break when a file is deleted. Because the file will remain to exist.
But what happens when you mount
a file system to /mnt
for example, create a hard link to a file on that volume, unmount
the volume, and then try to open the hard link?
mount filesystem hard-link
add a comment |
As far as I know, hard links will not break when a file is deleted. Because the file will remain to exist.
But what happens when you mount
a file system to /mnt
for example, create a hard link to a file on that volume, unmount
the volume, and then try to open the hard link?
mount filesystem hard-link
add a comment |
As far as I know, hard links will not break when a file is deleted. Because the file will remain to exist.
But what happens when you mount
a file system to /mnt
for example, create a hard link to a file on that volume, unmount
the volume, and then try to open the hard link?
mount filesystem hard-link
As far as I know, hard links will not break when a file is deleted. Because the file will remain to exist.
But what happens when you mount
a file system to /mnt
for example, create a hard link to a file on that volume, unmount
the volume, and then try to open the hard link?
mount filesystem hard-link
mount filesystem hard-link
edited 5 hours ago
Volker Siegel
9,09043350
9,09043350
asked Apr 14 '15 at 18:27
latias1290latias1290
1861620
1861620
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
You cannot create hardlinks across mount boundaries. You'll get something like:
ln: failed to create hard link ‘X’ => ‘Y’: Invalid cross-device link
add a comment |
Yes, hard links will not break when a file is deleted. Because the file will remain to exist.
But a hard link to a file on a different file system is not possible, in a fundamental way.
Practically, that means you can not create hard links to files on different file systems, and get an error when trying.
Now, why is it not possible?
A hard link is what you normally call a file. When there is a file system mounted in /mnt
, and you see /mnt/example.txt
, you see the name of the hard link example.txt
on the file system in /mnt
, that points to the data of thee file.
A file system contains file data and file names to access parts of the data. There is a reference from the name to the data. This reference is a hard link.
Creating a hard link means to create a reference to the same file data with a new name.
So a hard link is a central part of a file system, referencing the data. That means that a hard link to a different file system is not possible - because it is a different file system.
In principle, there could be a file system that spans more than one partition, and enlarges when adding /mnt
to it. Then a hard link to a different partition, but in the same file system could be created, and would break when the partition with the data is unmounted.
With this reasons, it's not only that a hard link to a different file system can not be created, but that it can not even exist by definition.strong text
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f609287%2fwhat-happens-when-you-make-a-hard-link-to-a-file-in-mnt-and-then-unmount%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You cannot create hardlinks across mount boundaries. You'll get something like:
ln: failed to create hard link ‘X’ => ‘Y’: Invalid cross-device link
add a comment |
You cannot create hardlinks across mount boundaries. You'll get something like:
ln: failed to create hard link ‘X’ => ‘Y’: Invalid cross-device link
add a comment |
You cannot create hardlinks across mount boundaries. You'll get something like:
ln: failed to create hard link ‘X’ => ‘Y’: Invalid cross-device link
You cannot create hardlinks across mount boundaries. You'll get something like:
ln: failed to create hard link ‘X’ => ‘Y’: Invalid cross-device link
answered Apr 14 '15 at 18:32
Michael TerryMichael Terry
3,3901431
3,3901431
add a comment |
add a comment |
Yes, hard links will not break when a file is deleted. Because the file will remain to exist.
But a hard link to a file on a different file system is not possible, in a fundamental way.
Practically, that means you can not create hard links to files on different file systems, and get an error when trying.
Now, why is it not possible?
A hard link is what you normally call a file. When there is a file system mounted in /mnt
, and you see /mnt/example.txt
, you see the name of the hard link example.txt
on the file system in /mnt
, that points to the data of thee file.
A file system contains file data and file names to access parts of the data. There is a reference from the name to the data. This reference is a hard link.
Creating a hard link means to create a reference to the same file data with a new name.
So a hard link is a central part of a file system, referencing the data. That means that a hard link to a different file system is not possible - because it is a different file system.
In principle, there could be a file system that spans more than one partition, and enlarges when adding /mnt
to it. Then a hard link to a different partition, but in the same file system could be created, and would break when the partition with the data is unmounted.
With this reasons, it's not only that a hard link to a different file system can not be created, but that it can not even exist by definition.strong text
add a comment |
Yes, hard links will not break when a file is deleted. Because the file will remain to exist.
But a hard link to a file on a different file system is not possible, in a fundamental way.
Practically, that means you can not create hard links to files on different file systems, and get an error when trying.
Now, why is it not possible?
A hard link is what you normally call a file. When there is a file system mounted in /mnt
, and you see /mnt/example.txt
, you see the name of the hard link example.txt
on the file system in /mnt
, that points to the data of thee file.
A file system contains file data and file names to access parts of the data. There is a reference from the name to the data. This reference is a hard link.
Creating a hard link means to create a reference to the same file data with a new name.
So a hard link is a central part of a file system, referencing the data. That means that a hard link to a different file system is not possible - because it is a different file system.
In principle, there could be a file system that spans more than one partition, and enlarges when adding /mnt
to it. Then a hard link to a different partition, but in the same file system could be created, and would break when the partition with the data is unmounted.
With this reasons, it's not only that a hard link to a different file system can not be created, but that it can not even exist by definition.strong text
add a comment |
Yes, hard links will not break when a file is deleted. Because the file will remain to exist.
But a hard link to a file on a different file system is not possible, in a fundamental way.
Practically, that means you can not create hard links to files on different file systems, and get an error when trying.
Now, why is it not possible?
A hard link is what you normally call a file. When there is a file system mounted in /mnt
, and you see /mnt/example.txt
, you see the name of the hard link example.txt
on the file system in /mnt
, that points to the data of thee file.
A file system contains file data and file names to access parts of the data. There is a reference from the name to the data. This reference is a hard link.
Creating a hard link means to create a reference to the same file data with a new name.
So a hard link is a central part of a file system, referencing the data. That means that a hard link to a different file system is not possible - because it is a different file system.
In principle, there could be a file system that spans more than one partition, and enlarges when adding /mnt
to it. Then a hard link to a different partition, but in the same file system could be created, and would break when the partition with the data is unmounted.
With this reasons, it's not only that a hard link to a different file system can not be created, but that it can not even exist by definition.strong text
Yes, hard links will not break when a file is deleted. Because the file will remain to exist.
But a hard link to a file on a different file system is not possible, in a fundamental way.
Practically, that means you can not create hard links to files on different file systems, and get an error when trying.
Now, why is it not possible?
A hard link is what you normally call a file. When there is a file system mounted in /mnt
, and you see /mnt/example.txt
, you see the name of the hard link example.txt
on the file system in /mnt
, that points to the data of thee file.
A file system contains file data and file names to access parts of the data. There is a reference from the name to the data. This reference is a hard link.
Creating a hard link means to create a reference to the same file data with a new name.
So a hard link is a central part of a file system, referencing the data. That means that a hard link to a different file system is not possible - because it is a different file system.
In principle, there could be a file system that spans more than one partition, and enlarges when adding /mnt
to it. Then a hard link to a different partition, but in the same file system could be created, and would break when the partition with the data is unmounted.
With this reasons, it's not only that a hard link to a different file system can not be created, but that it can not even exist by definition.strong text
answered 5 hours ago
Volker SiegelVolker Siegel
9,09043350
9,09043350
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f609287%2fwhat-happens-when-you-make-a-hard-link-to-a-file-in-mnt-and-then-unmount%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown