[TriLUG] Ubuntu 16.04 - /proc delete directories not permitted

Brian McCullough via TriLUG trilug at trilug.org
Sun Jul 10 10:18:31 EDT 2016


On Sun, Jul 10, 2016 at 08:26:02AM -0400, Triangle Linux Users Group discussion list wrote:
> I ran a backup script I believe had worked before.
> Result was /proc filled directories and subdirectories. Most with 41
> directories/files.
> Permissions are typically  -rw-r--r--. Owner:Group = root:root.
> using cli for just one  such directory:
>     "/proc$ sudo rm -rf  1/sm*
>     [sudo] password for mver:
>     rm: cannot remove '1/smaps': Permission denied"
> 
> There are 131071 Gb of directories/files there in /proc most of it nonsense
> Attempts to  sudo chown mver:mver/ or sudo chmod 0555 or 0777 fail to change
> anything (although the -v parm suggests that the changes are been attempted
> but not permitted.

OK, Mike.

First, /proc is a pseudo file system.  There are some items there that
you can change to controls certain aspects of the operation of your
machine, but many others are simply "reports" of kernel variables and
the like.  Things like /proc/cpuinfo are like that.

As Joe mentioned, /proc/mem and /proc/kmem are reports of the contents
of system memory.



> The problem started with:
> 
> "sudo tar -cpzf bkupUb16.04-${dt}.tar.gz --exclude='bkupUb'*
> --exclude='/home' --exclude='/media'  --exclude='/mnt' --exclude='/tmp'
> --one-file-system / home"  where $dt was a date string.

Two things here, to start with, perhaps three.

Where are you running this command?

Firstly, I would move the asterisk in the first exclude INSIDE the
quotes.

Secondly, I would add another exclude for /proc, and, perhaps, another
for /sys.


/proc will be re-created next time you reboot the machine.





Brian




More information about the TriLUG mailing list