doing the partitioning on the command-line: a headstart

thedighubs

Member
Nov 21, 2024
124
8
41
g day dear experts

well i am trying to get some basic skills - skills on the command line:

well guess on a sidenote: Anyone should be able to do this.

Background: When doing a new distro install, I i am sometimes asked to do some partitioning: well - i often let the installer handle partitioning and formatting the disk.

Well i want to get this done on my own:

therefore i need to know how to format a storage drive from the terminal.
a very helpful thing would be to dive into all that steps - and the options for commands and to get a base knowledge that i (hopefully) am able to use to extrapolate future uses.
as said above - i eagerly would like to know how to format in the different file systems such as NTFS, FAT32, EXT4: and yes: i think its a good thing to know how to do the partitioning. Letting this do the installer does not help me to get more command line skills. I need to find out more ways to do things on the command lined.


well; my winter-project is to dive into the partitioning of the disk - and to do this via command line:
and that said - i think its good to dive into some file-systems like NTFS FAT EXT 4 and others more.
These common formats are something that i think are the ones that are used in many many use-cases: So i think i have to get more information on how to partition the drive via terminal.


but well: Cannot i do this with the commandline!?

What do you say? Eagerly look forward to hear from you
 
Last edited:

manly

Lifer
Jan 25, 2000
12,997
3,758
136
The command line tool is parted . Time to exercise your Google-fu but here's a starter article:


Note this article creates an older MBR partition table, but nowadays you should be creating GPT only. Besides your favorite search engine (I use DuckDuckGo), consult your Linux man pages as well. I.e. man mkfs

If you like books, this is a good one:

 

thedighubs

Member
Nov 21, 2024
124
8
41
hello and good day dear manly.

thank you so much - thank you for steppin up the plate - and thanks for the article / the link to the book
this is good to know.

i will digg deeper
btw. i own some no starch press books. - good stuff.

have a great day dear Manly :)
 

mikeymikec

Lifer
May 19, 2011
20,161
14,702
136
IMO taking the time to learn all the ins and outs of a command that you apparently barely have a use for now and you're likely very rarely going to use is a bit of a waste of time. You can offset the possibility of forgetting and having to re-learn this info by writing yourself a primer though.

I must have installed various versions and distros of Linux at least 20 times over the years, not once have I used / felt the need to use parted. The most complicated setup I've done is the most recent one: My replacement server, running Ubuntu Server; I used the terminal-based UI setup to set up a software RAID1 array to mirror all the partitions including boot / OS.

PS - I'm not saying that parted has no use. I've been using Windows for nearly 30 years (and considered myself an expert of sorts for about 20 of those) and it's only in the last few years that I've been making increasing use of diskpart (Windows's command-line partition management program), and there's no question that it definitely has its uses ('clean' is very handy for example), but I still would use the Disk Management / Windows Setup UI over diskpart in most cases.

I've also used gparted a few times (maybe as an in-between program, between Disk Management and diskpart, it's been a year or three since I last used it), it provides a fully graphical interface. I have a live CD with it on.

IMO if you want to learn some essential command-line Linux skills then you ought to become comfortable in handling a terminal text editor. While I'm sure it's possible to elevate the privileges of a graphical text editor to edit system config files, it's a pain on Windows through the GUI and on Linux it's a lot easier to type say sudo nano /etc/fstab and be able to save without hopping through any further hoops. I'm used to using nano because it followed the same rules as a terminal text editor I used on my first computer as well as the first terminal-based email program I used on *NIX: pine.
 
Last edited:

thedighubs

Member
Nov 21, 2024
124
8
41
hello good day mikeymikec :)


thank you for the reply - great to hear form you.

IMO taking the time to learn all the ins and outs of a command that you apparently barely have a use for now and you're likely very rarely going to use is a bit of a waste of time. You can offset the possibility of forgetting and having to re-learn this info by writing yourself a primer though.
Food for thoughts.,

so if i got you right you think its more appropiate to do some more "concrete" learning -



you mention like so;

IMO if you want to learn some essential command-line Linux skills then you ought to become comfortable in handling a terminal text editor. While I'm sure it's possible to elevate the privileges of a graphical text editor to edit system config files, it's a pain on Windows through the GUI and on Linux it's a lot easier to type say sudo nano /etc/fstab and be able to save without hopping through any further hoops.

sonds very interesting - well - exactly - the essential command-line things - those are the one that i am after...


btw: perhaps there is a list ion the net with the most prominent and "most widespread" used commands - lets say the top 50 ones

that would be intresting too.


:cool:
 

thedighubs

Member
Nov 21, 2024
124
8
41
HI there - good day deat friends
well at the moment i am tryin to create some iso-file on a stick but this process fails some how. D o you have and ideas what goes wrong here!?

1749400748471.png


i really look forward to hear from you
greetings
 

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,597
4,503
75
It would have helped if you posted that as text. I had to Google "Auf dem Gerät ist kein Speicherplatz mehr verfügbar" to get the right accent marks and get a translation of "There is no more storage space available on the device".

It appears you're trying to copy a more-than-2GB .iso file to a 2GB USB drive. (Or 2GB partition of some kind, somewhere. Are you sure /dev/sdb is your USB drive? :grimacing:)
 
  • Love
Reactions: thedighubs

manly

Lifer
Jan 25, 2000
12,997
3,758
136
Actually, his reply is an extension of this older thread.


My last response still applies. OP needs to understand the difference between /dev/sdb and /dev/sdb1 before using dd .

(Hint: the error message is a result of writing an ISO to a partition device, which is something you probably never want to do?)
 
  • Love
Reactions: thedighubs

thedighubs

Member
Nov 21, 2024
124
8
41
hello and good day dear Ken and Manly
thank you for the reply - and yes: agreed with your idea, Ken!
It would have helped if you posted that as text. I had to Google "Auf dem Gerät ist kein Speicherplatz mehr verfügbar" to get the right accent marks and get a translation of "There is no more storage space available on the device".

yes - i apologize for the untranslated stuff. Sorry dear friends. This is not very polite to post such stuff here.


and yes - also agree with you Manly..
My last response still applies. OP needs to understand the difference between /dev/sdb and /dev/sdb1 before using dd .

i need to take care here - and dive into these details.
thank you so much for your patience with me here.


BTW: very glad to be part of this awesome site!! - Thank (!) you (!) guys (!) for all you do !!

greetings;)