Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #264054 > unrolled thread
| Started by | fuf <fuflono@gmail.com> |
|---|---|
| First post | 2023-12-01 20:30 +0100 |
| Last post | 2023-12-01 21:10 +0100 |
| Articles | 5 — 4 participants |
Back to article view | Back to linux.debian.user
didn't can use "fdisk"! fuf <fuflono@gmail.com> - 2023-12-01 20:30 +0100
Re: didn't can use "fdisk"! Tom Furie <tom@furie.org.uk> - 2023-12-01 20:40 +0100
Re: didn't can use "fdisk"! Greg Wooledge <greg@wooledge.org> - 2023-12-01 20:40 +0100
Re: didn't can use "fdisk"! Andy Smith <andy@strugglers.net> - 2023-12-01 20:50 +0100
Re: didn't can use "fdisk"! Greg Wooledge <greg@wooledge.org> - 2023-12-01 21:10 +0100
| From | fuf <fuflono@gmail.com> |
|---|---|
| Date | 2023-12-01 20:30 +0100 |
| Subject | didn't can use "fdisk"! |
| Message-ID | <HGhn4-apAk-3@gated-at.bofh.it> |
[Multipart message — attachments visible in raw view] — view raw
Hello all.
I'm embarrassed because didn't can use "fdisk"!
I work as normal user, open the terminal, switch to "root" user but get:
root@debian:/sbin# fdisk -l
bash: fdisk: command not found
whereas:
root@debian:/sbin# ls -al
.....
-rwxr-xr-x 1 root root 169520 Mar 23 2023 fdisk
....
why?
I reinstalled "util-linux" and "fdisk" by "Synaptic" but nothing varied.
What is matter?, give me any advice, please.
--fuf
[toc] | [next] | [standalone]
| From | Tom Furie <tom@furie.org.uk> |
|---|---|
| Date | 2023-12-01 20:40 +0100 |
| Message-ID | <HGhwJ-apDj-1@gated-at.bofh.it> |
| In reply to | #264054 |
fuf <fuflono@gmail.com> writes: > Hello all. > I'm embarrassed because didn't can use "fdisk"! > I work as normal user, open the terminal, switch to "root" user but > get: > root@debian:/sbin# fdisk -l > bash: fdisk: command not found > > whereas: > root@debian:/sbin# ls -al > ..... > -rwxr-xr-x 1 root root 169520 Mar 23 2023 fdisk It would seem that /sbin isn't in your $PATH. What method did you use to become root? Cheers, Tom
[toc] | [prev] | [next] | [standalone]
| From | Greg Wooledge <greg@wooledge.org> |
|---|---|
| Date | 2023-12-01 20:40 +0100 |
| Message-ID | <HGhwJ-apDj-11@gated-at.bofh.it> |
| In reply to | #264054 |
On Fri, Dec 01, 2023 at 07:06:58PM +0000, fuf wrote:
> I'm embarrassed because didn't can use "fdisk"!
> I work as normal user, open the terminal, switch to "root" user but get:
> root@debian:/sbin# fdisk -l
> bash: fdisk: command not found
https://wiki.debian.org/NewInBuster#Changes
Or the tl;dr version:
echo 'ALWAYS_SET_PATH yes' >> /etc/default/su
After this, exit from your root shell, and "su" again, and this time
the PATH will be correctly set.
[toc] | [prev] | [next] | [standalone]
| From | Andy Smith <andy@strugglers.net> |
|---|---|
| Date | 2023-12-01 20:50 +0100 |
| Message-ID | <HGhGp-apGC-3@gated-at.bofh.it> |
| In reply to | #264054 |
Hi,
On Fri, Dec 01, 2023 at 07:06:58PM +0000, fuf wrote:
> root@debian:/sbin# fdisk -l
> bash: fdisk: command not found
>
> whereas:
> root@debian:/sbin# ls -al
> .....
> -rwxr-xr-x 1 root root 169520 Mar 23 2023 fdisk
> ....
> why?
My first guess is that you may have done "su" which results in you
not having /sbin in your path. So you need to execute it as
/sbin/fdisk, or "su -", or become root by some other means.
https://sources.debian.org/src/util-linux/2.33.1-0.1/debian/util-linux.NEWS/
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=833256#80
This has been the case since the release of Debian 10 (buster).
If it's not that, please state Debian version, how you became root,
and
$ ls -la /sbin/fdisk
Thanks,
Andy
--
https://bitfolk.com/ -- No-nonsense VPS hosting
[toc] | [prev] | [next] | [standalone]
| From | Greg Wooledge <greg@wooledge.org> |
|---|---|
| Date | 2023-12-01 21:10 +0100 |
| Message-ID | <HGhZL-aq2h-9@gated-at.bofh.it> |
| In reply to | #264061 |
On Fri, Dec 01, 2023 at 07:46:28PM +0000, Andy Smith wrote: > My first guess is that you may have done "su" which results in you > not having /sbin in your path. So you need to execute it as > /sbin/fdisk, or "su -", or become root by some other means. At this point, we no longer need to guess. It's immediately clear. Using "su -" is an acceptable solution, though not my preferred one if this is your own system, as opposed to one where you are a "guest admin". I'd rather fix the problem permanently, by putting appropriate content into the /etc/default/su file. unicorn:~$ cat /etc/default/su ALWAYS_SET_PATH yes unicorn:~$ su Password: root@unicorn:/home/greg# declare -p PATH declare -x PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" root@unicorn:/home/greg#
[toc] | [prev] | [standalone]
Back to top | Article view | linux.debian.user
csiph-web