trying to add a second hard drive

Issues related to hardware problems
mjz
Posts: 60
Joined: 2020/02/13 22:05:02

trying to add a second hard drive

Post by mjz » 2020/02/27 21:54:07

New to this, so I appreciate the help up front.

I have Centos 8 working on a two node server. One server has two hard drives that Centos 8 was installed and the other node had only one drive and Centos was installed. All is good and works. However, on the second node, I wanted to add another drive to take advantage of the extra slot.

I bought a "used" identical drive to the current one. When I added it, the system could not find an operating system. If I remove the new drive, works fine.
Because it is "hot swap-able", I inserted the second drive and did a 'fdisk -l' and could see it - and it has an asterick under boot. I suspect since this is an old drive, it's not "clean".
So, my interpretation is that, on load, the system goes to the new disk for an OS and doesn't find any.

What do you recommend I do? I'd like to format it clean and ideally add it to the first disk as a logical volume (the first node is set up that way). But having a second data disk for backup is good too.

User avatar
TrevorH
Forum Moderator
Posts: 28026
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: trying to add a second hard drive

Post by TrevorH » 2020/02/27 21:59:28

Your first step is to make absolutely sure you know which disk is which. When you insert the new one, the old one may (and sounds like it did) change drive name so what was /dev/sda might become /dev/sdb. If the wrong drive is set to boot first then you can probably change which one boots from within your BIOS setup. Or you could remove the old disk and reverse which slot they're in (bear in mind that every time you physically unplug and replug and move a drive, you stand a chance of breaking it as they are fragile devices).

Using the command hdparm -I /dev/sda will spit out a lot of information and among that you will find the serial number of the drive in question. That will not change so it is a way to tell which drive name is used by which disk.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

mjz
Posts: 60
Joined: 2020/02/13 22:05:02

Re: trying to add a second hard drive

Post by mjz » 2020/02/27 22:21:45

Thank you so much for helping - I am going to do that now first - swap the disks and see if it boots (which I suspect it will).
then I'll come back here for next steps!

mjz
Posts: 60
Joined: 2020/02/13 22:05:02

Re: trying to add a second hard drive

Post by mjz » 2020/02/27 22:29:28

TrevorH wrote:
2020/02/27 21:59:28
Your first step is to make absolutely sure you know which disk is which. When you insert the new one, the old one may (and sounds like it did) change drive name so what was /dev/sda might become /dev/sdb. If the wrong drive is set to boot first then you can probably change which one boots from within your BIOS setup. Or you could remove the old disk and reverse which slot they're in (bear in mind that every time you physically unplug and replug and move a drive, you stand a chance of breaking it as they are fragile devices).

Using the command hdparm -I /dev/sda will spit out a lot of information and among that you will find the serial number of the drive in question. That will not change so it is a way to tell which drive name is used by which disk.
O.k - very good, swapping worked. The OS boots and I have the "new" old drive physically installed. Now I need to know which drive is which, format it and make it available.

Although, I was thinking of just extending the volume to both disks act as one (logical) in some sort of raid set up? In Bios, raid is not enabled like it is on the other node. Perhaps I should enable it? I don't know what that would do since the OS is already configured and data is on the boot disk.

mjz
Posts: 60
Joined: 2020/02/13 22:05:02

Re: trying to add a second hard drive

Post by mjz » 2020/02/27 22:35:36

this is What fdisk -i reports. From what I can tell, sda is my boot drive with two partitions on it and the OS
The second disk is sdb. /dev/sdb1 = ??

Disk /dev/sda: 1.8 TiB, 2000398934016 bytes, 3907029168 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
Disklabel type: dos
Disk identifier: 0x06b59e8d

Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 2099199 2097152 1G 83 Linux
/dev/sda2 2099200 3907028991 3904929792 1.8T 8e Linux LVM


Disk /dev/sdb: 1.8 TiB, 2000398934016 bytes, 3907029168 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
Disklabel type: dos
Disk identifier: 0x2c752e27

Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 2048 3907026943 3907024896 1.8T 7 HPFS/NTFS/exFAT


Disk /dev/mapper/cl-root: 50 GiB, 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/cl-swap: 15.8 GiB, 16932405248 bytes, 33071104 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/cl-home: 1.8 TiB, 1928700362752 bytes, 3766992896 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/loop0: 24.7 MiB, 25915392 bytes, 50616 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/loop1: 44.9 MiB, 47063040 bytes, 91920 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/loop2: 44.6 MiB, 46780416 bytes, 91368 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/loop3: 54.7 MiB, 57294848 bytes, 111904 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/loop4: 160.2 MiB, 167931904 bytes, 327992 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

User avatar
TrevorH
Forum Moderator
Posts: 28026
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: trying to add a second hard drive

Post by TrevorH » 2020/02/28 07:59:53

this is What fdisk -i reports. From what I can tell, sda is my boot drive with two partitions on it and the OS
That's why I told you to run hdparm -I against them to get the serial numbers. It's the way to tell which disk is which and be 100% sure.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

mjz
Posts: 60
Joined: 2020/02/13 22:05:02

Re: trying to add a second hard drive

Post by mjz » 2020/02/28 14:45:22

All good, except ....

I have the new drive installed and the old ntfs that was on it is wiped clean.

This is how the volumes look: sdb1 is the new hard drive. What I want to do is extend the sda2 cl-home volume /home file system across to the other disk:

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 54.7M 1 loop /var/lib/snapd/snap/core18/1668
loop1 7:1 0 140.7M 1 loop /var/lib/snapd/snap/gnome-3-26-1604/98
loop2 7:2 0 24.7M 1 loop /var/lib/snapd/snap/snapd/6434
loop3 7:3 0 44.6M 1 loop /var/lib/snapd/snap/filezilla/17
loop4 7:4 0 24.7M 1 loop /var/lib/snapd/snap/snapd/6240
loop5 7:5 0 44.9M 1 loop /var/lib/snapd/snap/gtk-common-themes/1440
loop6 7:6 0 91.4M 1 loop /var/lib/snapd/snap/core/8689
loop7 7:7 0 160.2M 1 loop /var/lib/snapd/snap/gnome-3-28-1804/116
loop8 7:8 0 19.4M 1 loop /var/lib/snapd/snap/qalculate/180
sda 8:0 0 931.5G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 930.5G 0 part
├─cl-root 253:0 0 50G 0 lvm /
├─cl-swap 253:1 0 7.9G 0 lvm [SWAP]
└─cl-home 253:2 0 1.8T 0 lvm /home
sdb 8:16 0 931.5G 0 disk
└─sdb1 8:17 0 931.5G 0 part
└─cl-home 253:2 0 1.8T 0 lvm /home

#lvresize -l +100%free /dev/cl/home
Size of logical volume cl/home changed from 1.75 TiB (459838 extents) to 3.57 TiB (936769 extents).
Logical volume cl/home successfully resized.


#grep home /etc/mtab
/dev/mapper/cl-home /home xfs rw,relatime,attr2,inode64,noquota 0 0
xrdp-chansrv /home/data/thinclient_drives fuse.xrdp-chansrv rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 0 0

but then ran into this problem when I tried to extend the filesystem:

# xfs_growfs /dev/mapper/cl-home
xfs_growfs: /dev/mapper/cl-home is not a mounted XFS filesystem

mjz
Posts: 60
Joined: 2020/02/13 22:05:02

Re: trying to add a second hard drive

Post by mjz » 2020/02/28 15:10:07

I did a follow up lsblk - and now have cl-home showing full size across both disks. I believe I am done - yes? I now have my original /home directory and filesystem extending across both disks for a total size of 3.6 TB. What I wanted to do was mirror the operating system over to the second drive for added resiliency.

# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 44.6M 1 loop /var/lib/snapd/snap/filezilla/17
loop1 7:1 0 160.2M 1 loop /var/lib/snapd/snap/gnome-3-28-1804/116
loop2 7:2 0 54.7M 1 loop /var/lib/snapd/snap/core18/1668
loop3 7:3 0 24.7M 1 loop /var/lib/snapd/snap/snapd/6434
loop4 7:4 0 44.9M 1 loop /var/lib/snapd/snap/gtk-common-themes/1440
sda 8:0 0 1.8T 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 1.8T 0 part
├─cl-root 253:0 0 50G 0 lvm /
├─cl-swap 253:1 0 15.8G 0 lvm [SWAP]
└─cl-home 253:2 0 3.6T 0 lvm /home
sdb 8:16 0 1.8T 0 disk
└─sdb1 8:17 0 1.8T 0 part
└─cl-home 253:2 0 3.6T 0 lvm /home

mjz
Posts: 60
Joined: 2020/02/13 22:05:02

Re: trying to add a second hard drive

Post by mjz » 2020/02/28 15:12:05

My /home directory showed 44% filled before I added the second disk. After installing it and extending the home volume, it still shows 44%. I thought it would be cut in half roughly to coincide with the volume expansion. Perhaps I still need to do something to extend the file system?

df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 16G 0 16G 0% /dev
tmpfs 16G 0 16G 0% /dev/shm
tmpfs 16G 9.6M 16G 1% /run
tmpfs 16G 0 16G 0% /sys/fs/cgroup
/dev/mapper/cl-root 50G 6.2G 44G 13% /
/dev/loop2 55M 55M 0 100% /var/lib/snapd/snap/core18/1668
/dev/loop0 45M 45M 0 100% /var/lib/snapd/snap/filezilla/17
/dev/loop1 161M 161M 0 100% /var/lib/snapd/snap/gnome-3-28-1804/116
/dev/loop4 45M 45M 0 100% /var/lib/snapd/snap/gtk-common-themes/1440
/dev/loop3 25M 25M 0 100% /var/lib/snapd/snap/snapd/6434
/dev/mapper/cl-home 1.8T 776G 1020G 44% /home
/dev/sda1 976M 209M 701M 23% /boot
tmpfs 3.2G 1.2M 3.2G 1% /run/user/42
tmpfs 3.2G 20K 3.2G 1% /run/user/1000

mjz
Posts: 60
Joined: 2020/02/13 22:05:02

Re: trying to add a second hard drive

Post by mjz » 2020/02/28 15:13:22

TrevorH wrote:
2020/02/28 07:59:53
this is What fdisk -i reports. From what I can tell, sda is my boot drive with two partitions on it and the OS
That's why I told you to run hdparm -I against them to get the serial numbers. It's the way to tell which disk is which and be 100% sure.
I did, I should have mentioned that - that is why I became convinced I had the correct drive - THANK YOU!

Post Reply

Return to “CentOS 8 - Hardware Support”