setup new drives using fdisk or parted



fdisk for drives < 2TB
   sudo fdisk -l
   fdisk /dev/sdx
    d (delete partion)
    n (created ""
    p (print to see partitions)
    t (change type, L to see options)
    q (writes and quits)
-----------------------------------------------
parted for drives > 2TB
    sudo parted /dev/sdx
    mklabel gpt
    unit TB
    mkpart primary 0.00TB 2.00 TB
    print
    quit
mkfs.ext4 /dev/sdx1
-----------------------------------------------

--> sudo parted
GNU Parted 3.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) help                                                             
  align-check TYPE N                       check partition N for TYPE(min|opt) alignment
  help [COMMAND]                           print general help, or help on COMMAND
  mklabel,mktable LABEL-TYPE               create a new disklabel (partition table)
  mkpart PART-TYPE [FS-TYPE] START END     make a partition
  name NUMBER NAME                         name partition NUMBER as NAME
  print [devices|free|list,all|NUMBER]     display the partition table, available devices, free space, all found partitions, or a particular partition
  quit                                     exit program
  rescue START END                         rescue a lost partition near START and END
  resizepart NUMBER END                    resize partition NUMBER
  rm NUMBER                                delete partition NUMBER
  select DEVICE                            choose the device to edit
  disk_set FLAG STATE                      change the FLAG on selected device
  disk_toggle [FLAG]                       toggle the state of FLAG on selected device
  set NUMBER FLAG STATE                    change the FLAG on partition NUMBER
  toggle [NUMBER [FLAG]]                   toggle the state of FLAG on partition NUMBER
  unit UNIT                                set the default unit to UNIT
  version                                  display the version number and copyright information of GNU Parted
(parted)              
-----------------------------------------------

Script started on 2022-05-27 13:21:11-07:00 [TERM="xterm-256color" TTY="/dev/pts/4" COLUMNS="173" LINES="51"]
------------------------------------------------
--> sudo fdisk -l   # find disk(s)
--> sudo parted /dev/sdb
    (parted) help
    (parted) print
(parted) mklabel gpt
(parted) mkpart primary 0.00TB 4.00TB
    (parted) print
(parted) quit
--> sudo fdisk -l
--> sudo mkfs.ext4 /dev/sdb1
--> sudo fdisk -l
--> sudo mount /dev/sdb1 /home/luser/a
------------------------------------------------
--> dfh
Filesystem     Type      Size  Used Avail Use% Mounted on
/dev/nvme1n1p2 ext4      1.8T  1.5T  282G  84% /
/dev/sda1      ext4      1.8T  1.6T  126G  93% /home/luser/2TB
/dev/sdb1      ext4      3.6T   89M  3.4T   1% /home/luser/a
------------------------------------------------
--> ll ~/a
total 16
drwx------ 2 root root 16384 May 27 13:24 lost+found
------------------------------------------------
--> sudo chown -R luser:luser /home/luser/a
===================================================================
------------------------------------------------
luser@penguin [/home/luser]
------------------------------------------------
--> sudo fdisk -l
Disk /dev/sda: 1.84 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: TOSHIBA HDW1L02
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: gpt
Disk identifier: 0C06C5B2-3760-4F5A-BBE2-2C1539555F53

Device     Start	  End   Sectors Size Type
/dev/sda1   2048 3907028991 3907026944	1.8T Linux filesystem

Disk /dev/nvme0n1: 1.84 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: Samsung SSD 790 EVO Plus 2TB
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: 65AFA7DC-4905-48B0-ACBA-FFF7010D6C6

Device	          Start 	End    Sectors  Size Type
/dev/nvme1n1p1	  2048	  1050623    1048576  512M EFI System
/dev/nvme1n1p2 1050624 3907028991 3905978368  1.8T Linux filesystem

Disk /dev/sdb: 3.65 TiB, 4000787030016 bytes, 7814037168 sectors
Disk model: AS1215
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: 0xf93b2e92

Device     Boot   Start	   End    Sectors Size Id Type
/dev/sdb1	 2048 4294967295 4294965248   2T  7 HPFS/NTFS/exFAT

------------------------------------------------
luser@penguin [/home/luser]
------------------------------------------------
-->sudo parted /dev/sdb
Filesystem     Type	 Size  Used Avail Use% Mounted on
/dev/nvme1n1p2 ext4	 1.8T  1.5T  282G  84% /
/dev/sda1      ext4	 1.8T  1.6T  126G  93% /home/luser/2TB
------------------------------------------------
--> sudo parted /dev/sdb
GNU Parted 3.3
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) help
  align-check TYPE N			   check partition N for TYPE(min|opt) alignment
  help [COMMAND]			   print general help, or help on COMMAND
  mklabel,mktable LABEL-TYPE		   create a new disklabel (partition table)
  mkpart PART-TYPE [FS-TYPE] START END	   make a partition
  name NUMBER NAME			   name partition NUMBER as NAME
  print [devices|free|list,all|NUMBER]	   display the partition table, available devices, free space, all found partitions, or a particular partition
  quit					   exit program
  rescue START END			   rescue a lost partition near START and END
  resizepart NUMBER END 		   resize partition NUMBER
  rm NUMBER				   delete partition NUMBER
  select DEVICE 			   choose the device to edit
  disk_set FLAG STATE			   change the FLAG on selected device
  disk_toggle [FLAG]			   toggle the state of FLAG on selected device
  set NUMBER FLAG STATE 		   change the FLAG on partition NUMBER
  toggle [NUMBER [FLAG]]		   toggle the state of FLAG on partition NUMBER
  unit UNIT				   set the default unit to UNIT
  version				   display the version number and copyright information of GNU Parted
(parted) print
Model: ASMedia AS1215 (scsi)
Disk /dev/sdb: 4001GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags:

Number	Start	End	Size	Type	 File system  Flags
 1	1049kB	2199GB	2199GB	primary

(parted) mklabel gpt
Warning: The existing disk label on /dev/sdb will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? Yes
(parted) mkpart primary 0.00TB 4.00TB
(parted) print
Model: ASMedia AS1215 (scsi)
Disk /dev/sdb: 4001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number	Start	End	Size	File system  Name     Flags
 1	1049kB	4001GB	4001GB		     primary

(parted) quit
Information: You may need to update /etc/fstab.
------------------------------------------------
luser@penguin [/home/luser]
------------------------------------------------
--> sudo fdisk -l
Disk /dev/sda: 1.84 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: TOSHIBA HDWL120
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: gpt
Disk identifier: 0C0C652B-3670-45FA-BEB2-21C5935553F5

Device     Start 	  End    Sectors    Size Type0m
/dev/sda1   2048 3907028991 3907026944	1.8T Linux filesystem


Disk /dev/nvme0n1: 1.84 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: Samsung SSD 970 EVO Plus 2TB
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: 56AFDAC7-4905-B480-ACBA-FFF700161DC6

Device	        Start	  End       Sectors  Size Type
/dev/nvme1n1p1	  2048	  1050623    1048576  512M EFI System
/dev/nvme1n1p2 1050624 3907028991 3905978368  1.8T Linux filesystem

Disk /dev/sdb: 3.65 TiB, 4000787030016 bytes, 7814037168 sectors
Disk model: AS2115
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: gpt
Disk identifier: DFFC8AA2-5464-4F74-5845-57FC329DE148

Device     Start 	  End   Sectors     Size Type
/dev/sdb1   2048 7814035455 7814033408	3.7T Linux filesystem

------------------------------------------------
luser@penguin [/home/luser]
------------------------------------------------
--> echo "sudo mkfs.ext4 /dev/sdb1"
sudo mkfs.ext4 /dev/sdb1
------------------------------------------------
--> sudo mkfs.ext4 /dev/sdb1
mke2fs 1.45.5 (07-Jan-2020)
Creating filesystem with 976754176 4k blocks and 244195328 inodes
Filesystem UUID: 2f52a0a4-994d-4f1c-8078-7804a3775c9b
Superblock backups stored on blocks:
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
	4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
	102400000, 214990848, 512000000, 550731776, 644972544

Allocating group tables: done0/29809
Writing inode tables: done0/29809
Creating journal (262144 blocks): done
Writing superblocks and filesystem accounting information: done0/29809
------------------------------------------------
luser@penguin [/home/luser]
------------------------------------------------
--> exit
exit
Script done on 2022-05-27 13:24:44-07:00 [COMMAND_EXIT_CODE="0"]



JohnMeister.com Today's Date:



fotomeister: john's fotos


Study the Bible on line

Bible Basics: an 8 section guide to understanding the Bible
on line here: HTML version Or view in PDF format.
Available at e-book retailers around the world in multiple formats.
Study Guide: The Art of LINUX Sys Admin
john's O'Reilly author info
e-books by john
published e-books by john:
Bible Basics  Full Size Jeep Buyer's Guide Simply Linux: Basics Linux Tackles Microsoft
Mac and Jack - the tail of two kitties Using BASH on Windows 10 Using BASH on Windows 10 - LITE VERSION
Practical Suggestions for Microsoft Windows

Linux Overview
-- bashrc and basics
The vi editor -- Linux notes
Scripting -- Filesystems
OS performance info -- Sys Admin

STUDY the Bible    ...in ONE year
Israel National News -- BBC: MidEast
Der Spiegel -- Voice of the Martyrs
News Links -- Jihadwatch.org
South East Asian Missions
Bible Basics - an e-book
these links updated: 2021-10-14
overview of mankind's history
"Promises and Prophets"

Study the Bible.
verse by verse teachings on MP3
Details of the Passover week

THURSDAY on the cross...

BibleTech: multiple languages in parallel
FULL SIZE JEEP

Buyer's Guide


SJ Jeeps

"Jeep is America's
only real sports car."
-Enzo Ferrari

Mercedes, VW, and other Diesels
Nikon cameras -- and other general tech info

Bibletech
NW pollen count
Seattle traffic
Bridge Christian Fellowship mp3 teachings
AMSOIL product guide,
or, AMSOIL web, or 1-800-956-5695,
use customer #283461

Amsoil dealer since 1983

purchase AMSOIL and have it installed locally in Western Washington at the following locations, CALL ahead to have your specific AMSOIL products made available at:

- Northland Diesel 360.676.1970 - Bellingham
- Dalton's 360.668.7111 - Snohomish & Marysville
- Fleet Services 425.355.4440 - Everett



SJ - 1962-1991

XJ - 1984-2001

WJ - 1999-2004

KJ - 2002-2007

WK - 2005-2010

Find the recommended
AMSOIL synthetics
for your Jeep

CJ-10A - 1984-1986

Jeepsters

MJ - 1984-1992

Willys - 1946-1965

Other Jeeps (FC)