public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Maxim Blinov <maxim.blinov@embecosm.com>
To: linux-ext4@vger.kernel.org
Subject: Help! How to delete an 8094-byte PATH?
Date: Thu, 27 Jan 2022 07:06:51 +0000	[thread overview]
Message-ID: <d4a67b38-3026-59be-06a8-3a9a5f908eb4@embecosm.com> (raw)

Hi all,

I'm not a subscriber to this list (so please put me in the CC), but I've
hit a really annoying un-googleable issue that I don't know who to ask
about.

A runaway script has been recursively creating sub-directories under
sub-directories until it hit the (apparent) OS limit. The path in
question goes something like this:

/work/build-native/binutils-gdb/gnulib/confdir3/confdir3/confdir3/confdir3/confdir3/........
(you get the idea)

It was only stopped by the following error:
mkdir: cannot create directory 'confdir3': File name too long

OK, fine, that was silly but whatever, right? I tried to delete this
huge directory from the top with

rm -rf confdir3/

but that simply generated the same error as above. So, I figured "Hey,
I'll just walk all the way to the bottom, and delete the directories
one-by-one bottom up". Here's the script I ran to get to the bottom:

$ for i in $(seq 999999); do echo "im $i levels deep"; cd confdir3; done;

It then ran for a while, and eventually I got to the bottom:

```
...
im 892 levels deep
im 893 levels deep
im 894 levels deep
im 895 levels deep
im 896 levels deep
bash: cd: confdir3: File name too long
$ ls
<nothing here>
```

So then, I `cd ../`, and `rmdir confdir3`, but even here, I get

rmdir: failed to remove 'confdir3/': File name too long

I would be very grateful if someone could please help suggest how I
might get this infernal tower of directories off of my precious ext4
partition.

I was thinking maybe there's some kind of magic "forget this directory
inode ever existed" command, but I am out of my depth with filesystems.

Best Regards,

Maxim Blinov

             reply	other threads:[~2022-01-27  7:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-27  7:06 Maxim Blinov [this message]
2022-01-27  7:27 ` Help! How to delete an 8094-byte PATH? Maxim Blinov
2022-01-27 12:20 ` Ritesh Harjani
2022-01-27 13:40   ` Matthew Wilcox
2022-01-27 15:09     ` Maxim Blinov
2022-01-27 15:34       ` Maxim Blinov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d4a67b38-3026-59be-06a8-3a9a5f908eb4@embecosm.com \
    --to=maxim.blinov@embecosm.com \
    --cc=linux-ext4@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox