LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 02-22-2019, 03:15 AM   #1
Micik
Member
 
Registered: Dec 2004
Distribution: Red hat linux 9
Posts: 189

Rep: Reputation: 16
Adding new HDD - Linux old version


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?

Thank you
 
Old 02-22-2019, 03:29 AM   #2
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,214

Rep: Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849
lsblk will list the drives, and the partition(s).

It will look similar to this:

Code:
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.
 
Old 02-22-2019, 03:53 AM   #3
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,479

Rep: Reputation: Disabled
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.
 
1 members found this post helpful.
Old 02-22-2019, 06:23 AM   #4
Micik
Member
 
Registered: Dec 2004
Distribution: Red hat linux 9
Posts: 189

Original Poster
Rep: Reputation: 16
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.
 
  


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
New HDD install w/data recovery from old HDD w/different distro w/encrypted /home forbinproject Linux - Laptop and Netbook 1 02-27-2012 10:18 PM
adding SATA ext3 HDD into new Suse11.4 box with ext4 system HDD Mail2me Linux - Hardware 4 10-26-2011 07:47 PM
new hdd, old mount needs to point to new hdd mount. phorning Linux - Newbie 3 06-14-2010 05:44 AM
new computer - can I put in the old HDD with installed old linux? carverknut Linux - Software 5 03-18-2009 10:11 AM
How to clone old HDD to NEW HDD? mrjohor Linux - Newbie 15 11-12-2007 02:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:20 PM.

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