LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 08-03-2022, 11:33 PM   #16
dkt0055
LQ Newbie
 
Registered: Jul 2022
Posts: 9

Original Poster
Blog Entries: 4

Rep: Reputation: 0
fdisk command


Quote:
Originally Posted by pan64 View Post
please post the command and all the output, do not explain the result.

Code:
$ apt policy fdisk
fdisk:
  Installed: 2.36.1-8+deb11u1
  Candidate: 2.36.1-8+deb11u1
  Version table:
 *** 2.36.1-8+deb11u1 500
        500 http://deb.debian.org/debian bullseye/main armhf Packages
        500 http://security.debian.org/debian-security bullseye-security/main armhf Packages
        100 /var/lib/dpkg/status

Code:
 dkt0055@localhost:~$
dkt0055@localhost:~$
dkt0055@localhost:~$
dkt0055@localhost:~$ fdisk -l
dkt0055@localhost:~$ fdisk -l
dkt0055@localhost:~$ fdisk -l
dkt0055@localhost:~$


Code:
 $ debian
dkt0055@localhost:~$ man fdisk
FDISK(8)                                      System Administration                                     FDISK(8)

NAME
       fdisk - manipulate disk partition table

SYNOPSIS
       fdisk [options] device

       fdisk -l [device...]

DESCRIPTION
       fdisk  is a dialog-driven program for creation and manipulation of partition tables.  It understands GPT,
       MBR, Sun, SGI and BSD partition tables.
Goes on down to the author's names
 
Old 08-03-2022, 11:44 PM   #17
dkt0055
LQ Newbie
 
Registered: Jul 2022
Posts: 9

Original Poster
Blog Entries: 4

Rep: Reputation: 0
Root and localhost

Quote:
Originally Posted by colorpurple21859 View Post
are you running the commands as root or user?
I try it like four different ways:

1. dkt0055@localhost:~$

2. proot-distro login debian
root@localhost:~#

3. $

4. $ su
UID: 0 cap: 3fffffffff selinux: permissive
~ #

It's confusing!
 
Old 08-04-2022, 12:06 AM   #18
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,899

Rep: Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318
I don't really understand you. fdisk will work only if you execute it as root.
Code:
root@localhost:~# fdisk -l
gparted will only work again as root.
 
1 members found this post helpful.
Old 08-04-2022, 12:14 AM   #19
Debian6to11
Member
 
Registered: Jan 2022
Location: Limassol, Cyprus
Distribution: Debian
Posts: 382
Blog Entries: 1

Rep: Reputation: 71
You have to type the command with sudo at the beginning. This is for all commands that require elevated privileges.
Code:
sudo fdisk -l
 
1 members found this post helpful.
Old 08-04-2022, 01:03 AM   #20
Debian6to11
Member
 
Registered: Jan 2022
Location: Limassol, Cyprus
Distribution: Debian
Posts: 382
Blog Entries: 1

Rep: Reputation: 71
To make this clear. There is a difference when you type a command as a normal user and as a root user. Normal users require elevated privileges for many commands including fdisk. This can be done by adding sudo in front of the command. See the examples listed below.

As a user
Quote:
aris@hb8DebianS:~$ sudo fdisk -l
Disk /dev/nvme0n1: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: CT1000P2SSD8
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: 0A5BA33E-4069-40C9-9BB1-23D68D30B490

Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 205080575 205078528 97.8G Linux filesystem
/dev/nvme0n1p2 205080576 1493946367 1288865792 614.6G Linux filesystem
/dev/nvme0n1p3 1914451968 1916405759 1953792 954M EFI System
/dev/nvme0n1p4 1916405760 1953523711 37117952 17.7G Linux swap
/dev/nvme0n1p5 1493946368 1914449919 420503552 200.5G Linux filesystem
As the root user
Quote:
aris@hb8DebianS:~$ su root
Password:
root@hb8DebianS:/home/aris# fdisk -l
Disk /dev/nvme0n1: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: CT1000P2SSD8
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: 0A5BA33E-4069-40C9-9BB1-23D68D30B490

Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 205080575 205078528 97.8G Linux filesystem
/dev/nvme0n1p2 205080576 1493946367 1288865792 614.6G Linux filesystem
/dev/nvme0n1p3 1914451968 1916405759 1953792 954M EFI System
/dev/nvme0n1p4 1916405760 1953523711 37117952 17.7G Linux swap
/dev/nvme0n1p5 1493946368 1914449919 420503552 200.5G Linux filesystem
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Gparted flashdrive won't boot, but a Clonezilla one will ArtKautz Linux - Software 16 05-01-2020 09:34 PM
LXer: SystemRescueCd and GParted Live Now Based on GParted 0.24.0, Detect ZFS Filesystems LXer Syndicated Linux News 0 10-30-2015 08:42 AM
LXer: GParted Live Switches to Systemd, Includes GParted 0.22.0 LXer Syndicated Linux News 0 03-25-2015 08:03 AM
LXer: GParted Live CD 0.13.0-1 Is Based on GParted 0.13.0 LXer Syndicated Linux News 0 07-16-2012 04:40 PM
[SOLVED] gparted crash on refresh/won't open if usb is mounted sundry_50 Linux - Newbie 2 03-23-2012 07:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 10:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration