Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I want to add new HDD to existing linux machine. I don't have GUI environment and all commands I need to carry out in CLI.
Existing Linux machine has one SCSI HDD and this drive is recognized as -dev/sda.
Now I want to add another HDD SATA and this drive should be recognized as /dev/sdb.
I know I need to use fdisk and mke2fs or mkfs commands to format the drive.
After physically adding the drive and boot Linux OS, what s the first step to be sure that drives is recognized by linux?
Is it fdisk?
lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 223.6G 0 disk
|-sda1 8:1 0 20G 0 part /
|-sda2 8:2 0 3G 0 part [SWAP]
`-sda3 8:3 0 200.6G 0 part /home
You will have to make a mount point, edit /etc/fstab and add each partition you want mounted at boot time. Issue a mount command for each partition will save booting the system.
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,479
Rep:
After installing the disk into the machine, when you restart, run dmesg, it will tell you how it is being seen by the system.
Then use fdisk, or cfdisk, to put an MBR on it, partition it how you want, save it to disk, then write your new file system(s) to your new partition(s).
Personally I'd use ext4, unless you need ext2 for some specific reason.
Thank you guys!
I have used fdsik -l and it did show me two HDDs. I have used fdisk interactively to create partition and swap.
I didn't have to edit fstab file.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.