WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: boot error: mkdir "/home/bruno/.local/bin" Permission denied  (Read 343 times)

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1910
Re: boot error: mkdir "/home/bruno/.local/bin" Permission denied
« Reply #15 on: September 08, 2026, 10:45:53 AM »
Rich, did you try my simple experiment in Reply #11? It would be good to know that someone can reproduce what I'm observing with tar vs.  sudo tar

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 865
Re: boot error: mkdir "/home/bruno/.local/bin" Permission denied
« Reply #16 on: September 08, 2026, 10:47:49 AM »
Can you also see that what tar is being used with backup vs restore ?
sudo tar (maybe busybox or gnu)

Maybe ?
Code: [Select]
which -a tarAnd:
Code: [Select]
sudo which -a tar
« Last Edit: September 08, 2026, 10:57:11 AM by patrikg »

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 865
Re: boot error: mkdir "/home/bruno/.local/bin" Permission denied
« Reply #17 on: September 08, 2026, 11:03:08 AM »
ON GNU
Code: [Select]
  Compatibility options
     -o     When creating, same as --old-archive.  When extracting, same as --no-same-owner.

ON BUSYBOX
Code: [Select]
-o Don't restore user:group

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1910
Re: boot error: mkdir "/home/bruno/.local/bin" Permission denied
« Reply #18 on: September 08, 2026, 11:34:59 AM »
Hi Rich. I think I figured it out what's going on here. Follow along:

Code: [Select]
$ ls -ld .config
drwxr-sr-x   15 bruno    staff          500 Sep  8 11:17 .config

$ rm -rf .config

$ filetool.sh -r
Restoring backup files from /mnt/sda1/tce/mydata.tgz Done.

$ ls -ld .config
drwxr-sr-x   15 root     staff          480 Sep  8 11:17 .config

$ cd .config

~/.config$ ls -l
...
drwxr-xr-x    2 bruno    staff           60 Sep  8 11:17 asunder
drwx--S---    2 bruno    staff           60 Sep  8 11:17 dconf
-rw-r--r--    1 bruno    staff          364 Jan 21  2024 easymail.conf
-rw-r--r--    1 bruno    staff          208 Jul 21 14:07 easyprint.conf
drwxr-sr-x    2 bruno    staff           60 Sep  8 11:17 feh
drwxr-sr-x    2 bruno    staff           60 Sep  8 11:17 foot
drwx------    6 bruno    staff          180 Sep  8 11:17 geany
drwxr-xr-x    2 bruno    staff           60 Sep  8 11:17 gtk-3.0
...

Note how when  filetool.sh -r  runs, my  .config  directory ends up being owned by  root:staff  but its subdirectories are owned by  bruno:staff

I think  tar  is working as advertised: I do not have  /home/bruno/.config  in  /opt/.filetool.lst--I only have its subdirectories:

Code: [Select]
$ cat /opt/.filetool.lst
...
home/bruno/.config/asunder/
home/bruno/.config/dconf
home/bruno/.config/easymail.conf
home/bruno/.config/easyprint.conf
home/bruno/.config/feh/
home/bruno/.config/foot/
home/bruno/.config/geany
home/bruno/.config/gtk-3.0

The zinger here is that if the  sudo tar  step of  filetool.sh -r  has to create any parent directories, the parent directories will be owned by root. This creates problems inside of /home.

I really don't want to backup my entire /home/bruno/.config directory, only the subdirectories that I actually want. Same for /home/bruno/.local

Now that I understand what's going on, I think that tar's behavior is really sneaky here. Almost malicious. Do you agree with patching  filetool.sh  as I proposed in Reply #7 to workaround this sneaky behavior inside of user's home directory? If so, it may help other users from stumbling on this. If not, no biggie because the chown statement I've added to the top of my .profile solves this for me.
« Last Edit: September 08, 2026, 11:50:59 AM by GNUser »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 12998
Re: boot error: mkdir "/home/bruno/.local/bin" Permission denied
« Reply #19 on: September 08, 2026, 12:16:24 PM »
Hi GNUser
Rich, did you try my simple experiment in Reply #11? ...
Yes I did. Here's what the /etc directory looked like:
Code: [Select]
tc@HP-G62:~/test2$ tree -ug etc
etc
|-- [tc       staff   ]  X11
|   `-- [tc       staff   ]  xorg.conf
|-- [tc       staff   ]  firefox
|   `-- [tc       staff   ]  policies
|       `-- [tc       staff   ]  policies.json
|-- [root     staff   ]  group
|-- [root     staff   ]  gshadow
|-- [root     staff   ]  passwd
|-- [root     staff   ]  shadow
`-- [root     root    ]  sudoers

3 directories, 7 files
The etc directory was root:staff.

That was the only part of my backup that contained files owned
by me. This was true for both busybox and GNU  sudo tar.

... Do you agree with patching  filetool.sh  as I proposed in Reply #7 to workaround this sneaky behavior inside of user's home directory? ...
What purpose does the question mark serve, or is it a typo:
Code: [Select]
if grep -Eq "^/?home/$USER" /opt/.filetool.lst; then
I'm a little leery about blindly changing  owner:group  settings on files.

I suspect owner might be OK.

Is it possible to break something if for example a files group was
changed from snd to staff?

Maybe some of the smart kids in the room could weigh in?

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1641
Re: boot error: mkdir "/home/bruno/.local/bin" Permission denied
« Reply #20 on: September 08, 2026, 05:23:03 PM »
The ? just means the leading slash can be there 0 or 1 times.

I'm not sure a blind change to $USER:staff recursively is the right thing too.  I purposely make some root owned stuff in my .local directory and some of it is suid too.   And I'm not running a persistent home.

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1641
Re: boot error: mkdir "/home/bruno/.local/bin" Permission denied
« Reply #21 on: September 08, 2026, 08:05:07 PM »
I just got home, and ran your test in post 11.  when extracted with "sudo tar -xvf mydata.tcz"  the files have the proper ownership.  (Not everything is root owned)

filetool.sh sets "useBusybox"  so this should always be using busybox tar.
Tested in busybox 1.36,

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 12998
Re: boot error: mkdir "/home/bruno/.local/bin" Permission denied
« Reply #22 on: September 08, 2026, 10:36:06 PM »
Hi Paul_123
The ? just means the leading slash can be there 0 or 1 times. ...
Thank you.

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1910
Re: boot error: mkdir "/home/bruno/.local/bin" Permission denied
« Reply #23 on: September 08, 2026, 11:51:42 PM »
The ? just means the leading slash can be there 0 or 1 times.

I'm not sure a blind change to $USER:staff recursively is the right thing too.
Hi Paul_123. Yes, that was my intention with the question mark.

Fair enough on the blind change being ill-advised. I'll just deal with this with a chown in ~/.profile

Thanks for your help, Rich and Paul_123. Thread may be marked as Solved.