The Linux Community Forum

General Help & Advice => Hardware Compatibility => Topic started by: emp1953 on January 11, 2022, 06:23:49 pm

Title: Installing 2nd hard drive in existing linux computer [SOLVED]
Post by: emp1953 on January 11, 2022, 06:23:49 pm
I have installed a 2nd SATA 500Gb hard drive in my existing Fedora 19 computer.  How do I get the OS of recognize and use this new HD?
Thank You all for any help
Title: Re: Installing 2nd hard drive in existing linux computer
Post by: Keith on January 11, 2022, 06:39:18 pm
Hi Emp53 - and welcome to the Forum.

Once the new HDD is attached, it should appear listed in your file manager. 
I am not familiar with Fedora but if it works anything like Ubuntu, you can also check with the following command:
Code: [Select]
 df | grep "/dev/sd"
This should list drives sda1 and sdb1

By the way; is the new HDD external or internal?

Keith
Title: Re: Installing 2nd hard drive in existing linux computer
Post by: emp1953 on January 11, 2022, 06:41:24 pm
It is internal installed on the SATA3 connector on the motherboard.  Seagate New in box.
Title: Re: Installing 2nd hard drive in existing linux computer
Post by: emp1953 on January 11, 2022, 06:42:57 pm
The results of that ls | grep command only show sda1.  nothing else.
Title: Re: Installing 2nd hard drive in existing linux computer
Post by: emp1953 on January 11, 2022, 06:50:19 pm
Under activities there is a "disks" utility that is a gui representation of whats in the system.  This utility shows two 500Gb seagate hard drives,  the first one listed as the master boot record and is the one that I assume I boot from and contains my Fedora OS.  its device Id is /dev/sda1 and shows a mounting location
The second device Id is /dev/sdb  this does not show a mounting location.   If it is /dev/sdb then do I simply need to mount the device, if so, where should I mount it?
Title: Re: Installing 2nd hard drive in existing linux computer
Post by: emp1953 on January 11, 2022, 06:53:06 pm
By the way the HD box does not say whether it is formatted.
Title: Re: Installing 2nd hard drive in existing linux computer
Post by: Keith on January 11, 2022, 07:07:05 pm
1. First of all, please copy and paste the output from the df command that you entered so that we can see what's happening.

2.
Quote
By the way the HD box does not say whether it is formatted
I presume you mean the box it came in.  But it will be formatted. 
Title: Re: Installing 2nd hard drive in existing linux computer
Post by: emp1953 on January 11, 2022, 07:08:49 pm
output from "fdisk -l"

[email protected] ~]# fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes, 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000510f7

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1026047      512000   83  Linux
/dev/sda2         1026048   976773119   487873536   8e  Linux LVM

Disk /dev/sdb: 500.1 GB, 500107862016 bytes, 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/mapper/fedora_new--host--7-swap: 4177 MB, 4177526784 bytes,
8159232 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/fedora_new--host--7-root: 53.7 GB, 53687091200 bytes,
104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/fedora_new--host--7-home: 441.7 GB, 441714737152
bytes, 862724096 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Title: Re: Installing 2nd hard drive in existing linux computer
Post by: Keith on January 11, 2022, 07:40:08 pm
Quote
Disk /dev/sdb: 500.1 GB, 500107862016 bytes, 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
This looks good.
Now please execute my suggestion:
Code: [Select]
 df | grep "/dev/sd"
and post the output here. It's best to copy the output and paste it here, rather than just typing it. 
Title: Re: Installing 2nd hard drive in existing linux computer
Post by: emp1953 on January 11, 2022, 08:46:52 pm
[email protected] ~]# df | grep "/dev/sd"
/dev/sda1                               487652    103222    354734  23% /boot

Title: Re: Installing 2nd hard drive in existing linux computer
Post by: Keith on January 11, 2022, 08:58:25 pm
That's interesting:  fdisk recognises the new disk but df doesn't. 
I don't have any ideas at present, but will have a think.  Perhaps another Member can help.
Title: Re: Installing 2nd hard drive in existing linux computer
Post by: emp1953 on January 11, 2022, 09:00:26 pm
Does it need to be mounted?
Title: Re: Installing 2nd hard drive in existing linux computer
Post by: Keith on January 12, 2022, 09:43:31 am
It does indeed.
First of all, try
Code: [Select]
mount | grep "/dev/sd"
to check if it's mounted somewhere unexpected.
Title: Re: Installing 2nd hard drive in existing linux computer
Post by: SeZo on January 12, 2022, 10:31:52 am
It looks to me that dev/sdb is not partitioned:
Quote
Disk /dev/sdb: 500.1 GB, 500107862016 bytes, 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Missing the partition data
Title: Re: Installing 2nd hard drive in existing linux computer
Post by: Keith on January 12, 2022, 11:19:31 am
The fdisk -l command doesn't list partitions, I think.  It didn't list your sda partitions.
Please execute
Code: [Select]
mount | grep "/dev/sd"
and report the full result.
Title: Re: Installing 2nd hard drive in existing linux computer
Post by: SeZo on January 12, 2022, 12:22:06 pm
the fdisk -l does list partitions:
Quote
Disk /dev/sda: 500.1 GB, 500107862016 bytes, 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000510f7

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1026047      512000   83  Linux
/dev/sda2         1026048   976773119   487873536   8e  Linux LVM

but listed none of them for /dev/sdb
Title: Re: Installing 2nd hard drive in existing linux computer
Post by: Keith on January 12, 2022, 12:25:12 pm
It does indeed with the "long" option.
Please try
Code: [Select]
mount | grep "/dev/sd"
and post the whole output.
Title: Re: Installing 2nd hard drive in existing linux computer
Post by: emp1953 on January 12, 2022, 02:38:48 pm
[[email protected] home]# mount | grep "/dev/sd"
/dev/sda1 on /boot type ext4 (rw,relatime,seclabel,data=ordered)
Title: Re: Installing 2nd hard drive in existing linux computer
Post by: Keith on January 12, 2022, 02:47:20 pm
Sezo - Sorry, I missed your name on your posts. 

Neither fdisk -l nor df list sdb on Emp's computer so I can't see how to create partitions unless the drive can be seen.  If you can advise him, please jump in and take over.

Keith
Title: Re: Installing 2nd hard drive in existing linux computer
Post by: emp1953 on January 12, 2022, 03:37:44 pm
Assuming the new HD came formatted is it also safe to assume that it is NTFS  ?
Title: Re: Installing 2nd hard drive in existing linux computer
Post by: Keith on January 12, 2022, 05:31:12 pm
Probably, yes, but Linux will cope with that.  One can use fdisk to specify a range of formats, all of which Linux can use.
Title: Re: Installing 2nd hard drive in existing linux computer
Post by: emp1953 on January 12, 2022, 06:08:31 pm
Are there any BIOS settings that need to be changed so the HD is seen upon boot up?
Title: Re: Installing 2nd hard drive in existing linux computer
Post by: Keith on January 12, 2022, 06:12:44 pm
No, I think not.  One can select the boot order, and it might be interesting to boot into the BIOS to see if your new disk is listed as an optional HDD to boot from. 
Title: Re: Installing 2nd hard drive in existing linux computer
Post by: emp1953 on January 12, 2022, 06:53:18 pm
Nothing on any of the listings I've done shows that it has a boot sector?
Title: Re: Installing 2nd hard drive in existing linux computer
Post by: SeZo on January 12, 2022, 08:05:32 pm
Not familiar with fedora so please forgive my ignorance if this does not work as intended.

The problem appears to be that the HDD (/dev/sdb) appears to be un-partitioned.
Therefore there are no mountable partitions.

You could install parted:

Code: [Select]
sudo yum install parted -y

Then list the available
Code: [Select]
sudo fdisk -l

(make sure /dev/sdb is listed)

Then run parted:
Code: [Select]
sudo parted -a optimal /dev/sdb
Note you will stay in parted shell, shown as (parted)
print out the current HDD configuraion
Code: [Select]
(parted) print

This should give you the list of partitions (I assume will be none)

To create a standard dos partition table (use gpt if you prefer GPT):

Code: [Select]
(parted) mklabel msdos
(parted) print

Create one primary partition as ext4
(you still need to create the filesystem, see later)

Code: [Select]
(parted) mkpart primary ext4 0% 95%
(parted) print
A new partition should be listed
then exit
Code: [Select]
(parted) q

Now create the filesystem
Code: [Select]
sudo mkfs.ext4 /dev/sdb1

Note, you can create ntfs instead of ext4 if you like.

After that it will get automounted (probably)
Title: Re: Installing 2nd hard drive in existing linux computer
Post by: Keith on January 12, 2022, 08:19:31 pm
Many thanks, Sezo.

Keith
Title: Re: Installing 2nd hard drive in existing linux computer
Post by: emp1953 on January 13, 2022, 01:05:46 am
Apparently "parted" is not in my repository. googled how to get it and install it, suggestions using dnf and git.  Also not in my distro.  I feel like a rat in a maze, with no cheese.
Title: Re: Installing 2nd hard drive in existing linux computer
Post by: SeZo on January 13, 2022, 10:08:24 am
Surprised that parted is not in the repo for your distro, it is Fedora you are using?
According to this : https://docs.fedoraproject.org/en-US/Fedora/14/html/Storage_Administration_Guide/s1-disk-storage-parted.html (https://docs.fedoraproject.org/en-US/Fedora/14/html/Storage_Administration_Guide/s1-disk-storage-parted.html)
Quote
By default, the parted package is included when installing Fedora.

Have you got Gparted installed?
Title: Re: Installing 2nd hard drive in existing linux computer
Post by: emp1953 on January 13, 2022, 04:49:05 pm
Gparted was not part of my Fedora 19 installation either it is not in the repo.
Title: Re: Installing 2nd hard drive in existing linux computer
Post by: emp1953 on January 13, 2022, 07:03:38 pm
My system has an app called "gdisk" when when entered at the cmd line returns "GPT fdisk (gdisk) version 0.8.18
Title: Re: Installing 2nd hard drive in existing linux computer
Post by: emp1953 on January 14, 2022, 05:03:40 am
I got it accomplished using fdisk.  now I'm battling group permissions since the disk was initialized and mounted as root.  Now how do I mark this thread as solved???
Title: Re: Installing 2nd hard drive in existing linux computer
Post by: Keith on January 14, 2022, 11:03:54 am
I'm pleased that you managed to solve this problem. 

To mark your topic as solved just edit the title of your first post on this topic as [SOLVED]. 
Thank you.

Keith
SimplePortal 2.3.3 © 2008-2010, SimplePortal