trying to add a second hard drive

Issues related to hardware problems
User avatar
TrevorH
Forum Moderator
Posts: 28084
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: trying to add a second hard drive

Post by TrevorH » 2020/02/28 16:11:06

Your new freespace is in the volume group. Now you need to use lvresize -r to add some space to the LV you want it in. I'd recommend not using it all so that you have some left to use for other things in the future.
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 16:14:30

Why does df -h show my "/home" directory to remain at 1.8T and 44% when lsblk shows it to be 3.8T (I added a second 2TB disk). My intention was for the new disk to extend my /home directory to take advantage of the added space.


#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/loop1 161M 161M 0 100% /var/lib/snapd/snap/gnome-3-28-1804/116
/dev/loop3 45M 45M 0 100% /var/lib/snapd/snap/filezilla/17
/dev/loop2 25M 25M 0 100% /var/lib/snapd/snap/snapd/6434
/dev/loop4 55M 55M 0 100% /var/lib/snapd/snap/core18/1668
/dev/loop0 45M 45M 0 100% /var/lib/snapd/snap/gtk-common-themes/1440
/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 16K 3.2G 1% /run/user/1000

[mzeitlin@Server2 ~]$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 44.9M 1 loop /var/lib/snapd/snap/gtk-common-themes/1440
loop1 7:1 0 160.2M 1 loop /var/lib/snapd/snap/gnome-3-28-1804/116
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 54.7M 1 loop /var/lib/snapd/snap/core18/1668
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 16:59:16

well, I'm stumped ...

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

It reports not mounted and yet I can write to it and see files ...
someone please help me see what I am doing wrong.

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

Re: trying to add a second hard drive

Post by mjz » 2020/02/28 17:10:46

O.k. - I think I have it now:

I use fsadm to resize the filesystem: fsadm resize /dev/mapper/cl-home

# df -k
Filesystem 1K-blocks Used Available Use% Mounted on
devtmpfs 16366684 0 16366684 0% /dev
tmpfs 16385300 0 16385300 0% /dev/shm
tmpfs 16385300 9768 16375532 1% /run
tmpfs 16385300 0 16385300 0% /sys/fs/cgroup
/dev/mapper/cl-root 52403200 6463520 45939680 13% /
/dev/loop1 164096 164096 0 100% /var/lib/snapd/snap/gnome-3-28-1804/116
/dev/loop3 45696 45696 0 100% /var/lib/snapd/snap/filezilla/17
/dev/loop2 25344 25344 0 100% /var/lib/snapd/snap/snapd/6434
/dev/loop4 56064 56064 0 100% /var/lib/snapd/snap/core18/1668
/dev/loop0 46080 46080 0 100% /var/lib/snapd/snap/gtk-common-themes/1440
/dev/mapper/cl-home 3836086148 826929256 3009156892 22% /home
/dev/sda1 999320 213524 716984 23% /boot
tmpfs 3277060 1180 3275880 1% /run/user/42
tmpfs 3277060 16 3277044 1% /run/user/1000

Seems I now have a new disk installed, the existing logical volume extended to use that disk and the filesystem extended to use the space.

Post Reply

Return to “CentOS 8 - Hardware Support”