Old disk disappear after additional new one on Linux FS

I want to increase the size of /testmount from 20GB to 320GB.

  1. before
 
[root@testserver testmount]# df -h
Filesystem                                                                                  Size  Used Avail Use% Mounted on
...
/dev/sda3                                                                                    15G   10G  3.0G  74% /
/dev/sda1                                                                                   936M  191M  739M  20% /boot
/dev/sda2                                                                                    20G   15G  2.1G  93% /testmount
/dev/sda6                                                                                   6.8G   36M  6.5G   1% /tmp
...
 
  1. Steps done to After partitioning /dev/sdb with 1 partition sdb1 with size of 300GB. i ran the below commands.
[root@testserver testmount]# mkfs -t ext4 /dev/sdb1

[root@testserver testmount]# mount /dev/sdb1 /testmount
  1. After steps
 
[root@testserver testmount]# df -h
Filesystem                                                                                  Size  Used Avail Use% Mounted on
...
/dev/sda3                                                                                    16G   11G  4.0G  74% /
/dev/sda1                                                                                   976M  181M  729M  20% /boot
/dev/sdb1                                                                                   296G   65M  281G   1% /testmount                 <<<<<<< sda2 disappeared from /testmount 
/dev/sda6                                                                                   5.8G   36M  5.5G   1% /tmp
..
 

Why am I not able to see /dev/sda2 here?

What step am i missing? I am total newbie on Linux system admin matters. I looked at few tutorials, but didn't get the answer.

Looks like that you've mounted the new disk on /testmount and 'covered' the old disk mounted there.

You can only mount one disk on a single mountpoint.

If you umount sdb1 the old disk should reappear.

[Perhaps create a brand new mountpoint and mount sdb1 on that so you can see both at the same time.]
e.g.

# mkdir /newmount
# mount /dev/sdb1 /newmount
1 Like

As I understood you, you like to combine 2 parts of 2 different disks into one partition/filesystem. You can do that(e. g. by using lvm). But if you do, know that one of those 2 disks fail, the data are completely lost for that filesystem - and you should better have good and recently done backups. In my opinion that's not worth it just to be able to directly use that 20 GB of the first disk.

I would recommend you to just make a filesystem on the new disk with 300 GB and copy the old data to the new filesystem.

Then you may use the space on the other disk for other purposes.

1 Like

Thanks!