Re: didn't can use "fdisk"!

2023-12-02 Thread David Christensen

On 12/2/23 03:24, fuf wrote:

Hello all again.
I  recently  installed Debian-12.  Your advises calmed me but will be used
it's tomorrow so as now eyes shutting down.
Good morning!
I began since top of your advices i.e.
https://wiki.debian.org/NewInBuster#Changes and reading: "The su command in
buster is provided by the util-linux source package, instead of the shadow
source package, and no longer alters the PATH variable by default. This
means that after doing su, your PATH may not contain directories like
/sbin, and many system administration commands will fail. There are several
workarounds:
 Use su - instead; this launches a login shell, which forces PATH to be
changed, but also changes everything else including the working directory."
It was tried and at once into point!,
further I didn't read as fear to tangle.
All to luck!
--fuf



My Debian workstation:

2023-12-02 09:20:20 dpchrist@taz ~
$ cat /etc/debian_version ; uname -a
11.8
Linux taz 5.10.0-26-amd64 #1 SMP Debian 5.10.197-1 (2023-09-29) x86_64 
GNU/Linux



How to login as root using su(1):

2023-12-02 09:22:38 dpchrist@taz ~
$ su -
Password:

2023-12-02 09:22:47 root@taz ~
#


How to list disk partition tables using fdisk(8):

2023-12-02 09:22:47 root@taz ~
# fdisk -l
Disk /dev/sda: 55.9 GiB, 60022480896 bytes, 117231408 sectors
Disk model: INTEL SSDSC2CW06
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: ***redacted***

DeviceStart   End  Sectors  Size Type
/dev/sda1  2048   1953791  1951744  953M EFI System
/dev/sda2   1953792   3907583  1953792  954M Linux filesystem
/dev/sda3   3907584   5861375  1953792  954M Linux filesystem
/dev/sda4   5861376  29298687 23437312 11.2G Linux filesystem
/dev/sda5  29298688 117229567 87930880 41.9G Linux filesystem


Disk /dev/sdb: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: TOSHIBA DT01ACA1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: ***redacted***

Device Boot StartEndSectors   Size Id Type
/dev/sdb12048 1953523711 1953521664 931.5G 83 Linux


Disk /dev/mapper/sda4_crypt: 11.16 GiB, 11983126528 bytes, 23404544 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/sda3_crypt: 954 MiB, 1000341504 bytes, 1953792 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/sda5_crypt: 41.91 GiB, 45003833344 bytes, 87898112 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


David



Re: didn't can use "fdisk"!

2023-12-02 Thread fuf
Hello all again.
I  recently  installed Debian-12.  Your advises calmed me but will be used
it's tomorrow so as now eyes shutting down.
Good morning!
I began since top of your advices i.e.
https://wiki.debian.org/NewInBuster#Changes and reading: "The su command in
buster is provided by the util-linux source package, instead of the shadow
source package, and no longer alters the PATH variable by default. This
means that after doing su, your PATH may not contain directories like
/sbin, and many system administration commands will fail. There are several
workarounds:
Use su - instead; this launches a login shell, which forces PATH to be
changed, but also changes everything else including the working directory."
It was tried and at once into point!,
further I didn't read as fear to tangle.
All to luck!
--fuf


Re: didn't can use "fdisk"!

2023-12-01 Thread Greg Wooledge
On Fri, Dec 01, 2023 at 07:46:28PM +, 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# 



Re: didn't can use "fdisk"!

2023-12-01 Thread Andy Smith
Hi,

On Fri, Dec 01, 2023 at 07:06:58PM +, fuf wrote:
> root@debian:/sbin# fdisk  -l
> bash: fdisk: command not found
> 
> whereas:
> root@debian:/sbin# ls -al
> .
> -rwxr-xr-x  1 root root169520 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



Re: didn't can use "fdisk"!

2023-12-01 Thread Tom Furie
fuf  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



Re: didn't can use "fdisk"!

2023-12-01 Thread Greg Wooledge
On Fri, Dec 01, 2023 at 07:06:58PM +, 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.