What happens when I try to change to a parent directory after it has been renamed?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I'm several child directories deep and I enter cd .. and receive this error:



cd: ..: No such file or directory



I am confused- of course there is a parent directory, I'm in it! A little digging shows that my coworker renamed a grandparent directory out from under me and when I tried to move to my parent directory, I got the above error. I tried to reproduce this like so:



server|/n01/data/adf/temp/TEMPTEST/SUB1/SUB2> pwd
/n01/data/adf/temp/TEMPTEST/SUB1/SUB2
server|/n01/data/adf/temp/TEMPTEST/SUB1/SUB2> mv /n01/data/adf/temp/TEMPTEST /n01/data/adf/temp/NEWTEMPTEST
server|/n01/data/adf/temp/TEMPTEST/SUB1/SUB2> pwd
/n01/data/adf/temp/NEWTEMPTEST/SUB1/SUB2


And now I am lost and adrift, changing to the parent directory will give me the same error as before.



server|/n01/data/adf/temp/TEMPTEST/SUB1/SUB2> cd ..
server|/n01/data/adf/temp/NEWTEMPTEST/SUB1>


No error. I changed directories successfully. What happened? Why didn't this error like the first time?







share|improve this question




















  • @RubberStamp I was able to recreate the same behavior using one shell to create and enter the test directory and another shell to rename it.
    – MackM
    Nov 18 '17 at 0:13










  • I left out the very relevant information that the first error I saw was on a EMC Isilon mount, and my attempted recreation was on the server's local disk.
    – MackM
    Nov 18 '17 at 0:26














up vote
1
down vote

favorite












I'm several child directories deep and I enter cd .. and receive this error:



cd: ..: No such file or directory



I am confused- of course there is a parent directory, I'm in it! A little digging shows that my coworker renamed a grandparent directory out from under me and when I tried to move to my parent directory, I got the above error. I tried to reproduce this like so:



server|/n01/data/adf/temp/TEMPTEST/SUB1/SUB2> pwd
/n01/data/adf/temp/TEMPTEST/SUB1/SUB2
server|/n01/data/adf/temp/TEMPTEST/SUB1/SUB2> mv /n01/data/adf/temp/TEMPTEST /n01/data/adf/temp/NEWTEMPTEST
server|/n01/data/adf/temp/TEMPTEST/SUB1/SUB2> pwd
/n01/data/adf/temp/NEWTEMPTEST/SUB1/SUB2


And now I am lost and adrift, changing to the parent directory will give me the same error as before.



server|/n01/data/adf/temp/TEMPTEST/SUB1/SUB2> cd ..
server|/n01/data/adf/temp/NEWTEMPTEST/SUB1>


No error. I changed directories successfully. What happened? Why didn't this error like the first time?







share|improve this question




















  • @RubberStamp I was able to recreate the same behavior using one shell to create and enter the test directory and another shell to rename it.
    – MackM
    Nov 18 '17 at 0:13










  • I left out the very relevant information that the first error I saw was on a EMC Isilon mount, and my attempted recreation was on the server's local disk.
    – MackM
    Nov 18 '17 at 0:26












up vote
1
down vote

favorite









up vote
1
down vote

favorite











I'm several child directories deep and I enter cd .. and receive this error:



cd: ..: No such file or directory



I am confused- of course there is a parent directory, I'm in it! A little digging shows that my coworker renamed a grandparent directory out from under me and when I tried to move to my parent directory, I got the above error. I tried to reproduce this like so:



server|/n01/data/adf/temp/TEMPTEST/SUB1/SUB2> pwd
/n01/data/adf/temp/TEMPTEST/SUB1/SUB2
server|/n01/data/adf/temp/TEMPTEST/SUB1/SUB2> mv /n01/data/adf/temp/TEMPTEST /n01/data/adf/temp/NEWTEMPTEST
server|/n01/data/adf/temp/TEMPTEST/SUB1/SUB2> pwd
/n01/data/adf/temp/NEWTEMPTEST/SUB1/SUB2


And now I am lost and adrift, changing to the parent directory will give me the same error as before.



server|/n01/data/adf/temp/TEMPTEST/SUB1/SUB2> cd ..
server|/n01/data/adf/temp/NEWTEMPTEST/SUB1>


No error. I changed directories successfully. What happened? Why didn't this error like the first time?







share|improve this question












I'm several child directories deep and I enter cd .. and receive this error:



cd: ..: No such file or directory



I am confused- of course there is a parent directory, I'm in it! A little digging shows that my coworker renamed a grandparent directory out from under me and when I tried to move to my parent directory, I got the above error. I tried to reproduce this like so:



server|/n01/data/adf/temp/TEMPTEST/SUB1/SUB2> pwd
/n01/data/adf/temp/TEMPTEST/SUB1/SUB2
server|/n01/data/adf/temp/TEMPTEST/SUB1/SUB2> mv /n01/data/adf/temp/TEMPTEST /n01/data/adf/temp/NEWTEMPTEST
server|/n01/data/adf/temp/TEMPTEST/SUB1/SUB2> pwd
/n01/data/adf/temp/NEWTEMPTEST/SUB1/SUB2


And now I am lost and adrift, changing to the parent directory will give me the same error as before.



server|/n01/data/adf/temp/TEMPTEST/SUB1/SUB2> cd ..
server|/n01/data/adf/temp/NEWTEMPTEST/SUB1>


No error. I changed directories successfully. What happened? Why didn't this error like the first time?









share|improve this question











share|improve this question




share|improve this question










asked Nov 17 '17 at 23:47









MackM

1105




1105











  • @RubberStamp I was able to recreate the same behavior using one shell to create and enter the test directory and another shell to rename it.
    – MackM
    Nov 18 '17 at 0:13










  • I left out the very relevant information that the first error I saw was on a EMC Isilon mount, and my attempted recreation was on the server's local disk.
    – MackM
    Nov 18 '17 at 0:26
















  • @RubberStamp I was able to recreate the same behavior using one shell to create and enter the test directory and another shell to rename it.
    – MackM
    Nov 18 '17 at 0:13










  • I left out the very relevant information that the first error I saw was on a EMC Isilon mount, and my attempted recreation was on the server's local disk.
    – MackM
    Nov 18 '17 at 0:26















@RubberStamp I was able to recreate the same behavior using one shell to create and enter the test directory and another shell to rename it.
– MackM
Nov 18 '17 at 0:13




@RubberStamp I was able to recreate the same behavior using one shell to create and enter the test directory and another shell to rename it.
– MackM
Nov 18 '17 at 0:13












I left out the very relevant information that the first error I saw was on a EMC Isilon mount, and my attempted recreation was on the server's local disk.
– MackM
Nov 18 '17 at 0:26




I left out the very relevant information that the first error I saw was on a EMC Isilon mount, and my attempted recreation was on the server's local disk.
– MackM
Nov 18 '17 at 0:26










2 Answers
2






active

oldest

votes

















up vote
5
down vote



accepted










Renaming the parent directory will not cause such an error. However, deleting will, for instance:



# mkdir -p some/deep/path
# cd some/deep/path
# rm -r some/deep/path
# cd ..
error: No such file or directory


There is no "rename" command per se in Linux. You can "move" things around though. When moving within the same filesystem, this equates to a rename. However, when moving between filsystems, this is effectively a copy / delete operation, which could result in a similar situation as that shown above, for instance:



# mkdir -p /fs1/a/b
# cd /fs1/a/b
# mv /fs1/a /fs2/a
# cd ..
error: No such file or directory


when /fs1 and /fs2 are different filesystems (mount points in this case).






share|improve this answer




















  • The 'rename was done with mv in both cases, but the first case was on an EMC Isilon mount, and my attempt to recreate was on the server's local disk. I'm sorry I left it out before, that is clearly relevant.
    – MackM
    Nov 18 '17 at 0:16

















up vote
1
down vote













Simply renaming the directory would have accomplished nothing, because the name is just a label (that's how you can have two files pointing at the same object using hard links).



The parent directory's content was probably moved into a new directory, and the old directory, now empty, destroyed. This needs to be done while you're in the immediate child directory, I think.



This also happens if you move the directory around between different mounted filesystems while (optionally) renaming it; it's not the rename, but the filesystem change that forces the original to be deleted.






share|improve this answer






















  • The 'rename was done with mv in both cases, but the first case was on an EMC Isilon mount, and my attempt to recreate was on the server's local disk. I'm sorry I left it out before, that is clearly relevant .
    – MackM
    Nov 18 '17 at 0:18










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
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',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f405370%2fwhat-happens-when-i-try-to-change-to-a-parent-directory-after-it-has-been-rename%23new-answer', 'question_page');

);

Post as a guest






























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
5
down vote



accepted










Renaming the parent directory will not cause such an error. However, deleting will, for instance:



# mkdir -p some/deep/path
# cd some/deep/path
# rm -r some/deep/path
# cd ..
error: No such file or directory


There is no "rename" command per se in Linux. You can "move" things around though. When moving within the same filesystem, this equates to a rename. However, when moving between filsystems, this is effectively a copy / delete operation, which could result in a similar situation as that shown above, for instance:



# mkdir -p /fs1/a/b
# cd /fs1/a/b
# mv /fs1/a /fs2/a
# cd ..
error: No such file or directory


when /fs1 and /fs2 are different filesystems (mount points in this case).






share|improve this answer




















  • The 'rename was done with mv in both cases, but the first case was on an EMC Isilon mount, and my attempt to recreate was on the server's local disk. I'm sorry I left it out before, that is clearly relevant.
    – MackM
    Nov 18 '17 at 0:16














up vote
5
down vote



accepted










Renaming the parent directory will not cause such an error. However, deleting will, for instance:



# mkdir -p some/deep/path
# cd some/deep/path
# rm -r some/deep/path
# cd ..
error: No such file or directory


There is no "rename" command per se in Linux. You can "move" things around though. When moving within the same filesystem, this equates to a rename. However, when moving between filsystems, this is effectively a copy / delete operation, which could result in a similar situation as that shown above, for instance:



# mkdir -p /fs1/a/b
# cd /fs1/a/b
# mv /fs1/a /fs2/a
# cd ..
error: No such file or directory


when /fs1 and /fs2 are different filesystems (mount points in this case).






share|improve this answer




















  • The 'rename was done with mv in both cases, but the first case was on an EMC Isilon mount, and my attempt to recreate was on the server's local disk. I'm sorry I left it out before, that is clearly relevant.
    – MackM
    Nov 18 '17 at 0:16












up vote
5
down vote



accepted







up vote
5
down vote



accepted






Renaming the parent directory will not cause such an error. However, deleting will, for instance:



# mkdir -p some/deep/path
# cd some/deep/path
# rm -r some/deep/path
# cd ..
error: No such file or directory


There is no "rename" command per se in Linux. You can "move" things around though. When moving within the same filesystem, this equates to a rename. However, when moving between filsystems, this is effectively a copy / delete operation, which could result in a similar situation as that shown above, for instance:



# mkdir -p /fs1/a/b
# cd /fs1/a/b
# mv /fs1/a /fs2/a
# cd ..
error: No such file or directory


when /fs1 and /fs2 are different filesystems (mount points in this case).






share|improve this answer












Renaming the parent directory will not cause such an error. However, deleting will, for instance:



# mkdir -p some/deep/path
# cd some/deep/path
# rm -r some/deep/path
# cd ..
error: No such file or directory


There is no "rename" command per se in Linux. You can "move" things around though. When moving within the same filesystem, this equates to a rename. However, when moving between filsystems, this is effectively a copy / delete operation, which could result in a similar situation as that shown above, for instance:



# mkdir -p /fs1/a/b
# cd /fs1/a/b
# mv /fs1/a /fs2/a
# cd ..
error: No such file or directory


when /fs1 and /fs2 are different filesystems (mount points in this case).







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 18 '17 at 0:06









isedev

1763




1763











  • The 'rename was done with mv in both cases, but the first case was on an EMC Isilon mount, and my attempt to recreate was on the server's local disk. I'm sorry I left it out before, that is clearly relevant.
    – MackM
    Nov 18 '17 at 0:16
















  • The 'rename was done with mv in both cases, but the first case was on an EMC Isilon mount, and my attempt to recreate was on the server's local disk. I'm sorry I left it out before, that is clearly relevant.
    – MackM
    Nov 18 '17 at 0:16















The 'rename was done with mv in both cases, but the first case was on an EMC Isilon mount, and my attempt to recreate was on the server's local disk. I'm sorry I left it out before, that is clearly relevant.
– MackM
Nov 18 '17 at 0:16




The 'rename was done with mv in both cases, but the first case was on an EMC Isilon mount, and my attempt to recreate was on the server's local disk. I'm sorry I left it out before, that is clearly relevant.
– MackM
Nov 18 '17 at 0:16












up vote
1
down vote













Simply renaming the directory would have accomplished nothing, because the name is just a label (that's how you can have two files pointing at the same object using hard links).



The parent directory's content was probably moved into a new directory, and the old directory, now empty, destroyed. This needs to be done while you're in the immediate child directory, I think.



This also happens if you move the directory around between different mounted filesystems while (optionally) renaming it; it's not the rename, but the filesystem change that forces the original to be deleted.






share|improve this answer






















  • The 'rename was done with mv in both cases, but the first case was on an EMC Isilon mount, and my attempt to recreate was on the server's local disk. I'm sorry I left it out before, that is clearly relevant .
    – MackM
    Nov 18 '17 at 0:18














up vote
1
down vote













Simply renaming the directory would have accomplished nothing, because the name is just a label (that's how you can have two files pointing at the same object using hard links).



The parent directory's content was probably moved into a new directory, and the old directory, now empty, destroyed. This needs to be done while you're in the immediate child directory, I think.



This also happens if you move the directory around between different mounted filesystems while (optionally) renaming it; it's not the rename, but the filesystem change that forces the original to be deleted.






share|improve this answer






















  • The 'rename was done with mv in both cases, but the first case was on an EMC Isilon mount, and my attempt to recreate was on the server's local disk. I'm sorry I left it out before, that is clearly relevant .
    – MackM
    Nov 18 '17 at 0:18












up vote
1
down vote










up vote
1
down vote









Simply renaming the directory would have accomplished nothing, because the name is just a label (that's how you can have two files pointing at the same object using hard links).



The parent directory's content was probably moved into a new directory, and the old directory, now empty, destroyed. This needs to be done while you're in the immediate child directory, I think.



This also happens if you move the directory around between different mounted filesystems while (optionally) renaming it; it's not the rename, but the filesystem change that forces the original to be deleted.






share|improve this answer














Simply renaming the directory would have accomplished nothing, because the name is just a label (that's how you can have two files pointing at the same object using hard links).



The parent directory's content was probably moved into a new directory, and the old directory, now empty, destroyed. This needs to be done while you're in the immediate child directory, I think.



This also happens if you move the directory around between different mounted filesystems while (optionally) renaming it; it's not the rename, but the filesystem change that forces the original to be deleted.







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 18 '17 at 13:12

























answered Nov 18 '17 at 0:06









LSerni

2,326615




2,326615











  • The 'rename was done with mv in both cases, but the first case was on an EMC Isilon mount, and my attempt to recreate was on the server's local disk. I'm sorry I left it out before, that is clearly relevant .
    – MackM
    Nov 18 '17 at 0:18
















  • The 'rename was done with mv in both cases, but the first case was on an EMC Isilon mount, and my attempt to recreate was on the server's local disk. I'm sorry I left it out before, that is clearly relevant .
    – MackM
    Nov 18 '17 at 0:18















The 'rename was done with mv in both cases, but the first case was on an EMC Isilon mount, and my attempt to recreate was on the server's local disk. I'm sorry I left it out before, that is clearly relevant .
– MackM
Nov 18 '17 at 0:18




The 'rename was done with mv in both cases, but the first case was on an EMC Isilon mount, and my attempt to recreate was on the server's local disk. I'm sorry I left it out before, that is clearly relevant .
– MackM
Nov 18 '17 at 0:18

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f405370%2fwhat-happens-when-i-try-to-change-to-a-parent-directory-after-it-has-been-rename%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?