0

I have an AWS EC2 instance and I tried to attach and mount couple of EBS volumes on it. Somehow mount command was taking very long time so I deleted those volumes using AWS console.

Now problem is that I cannot see those volumes using df -h command but those volumes can be seen from lsblk command. So how do I make these two things consistent? and why mount command takes infinite time? This EBS volume is of just 75 GB size.

Output from both the commands look like below:

ubuntu@ip-10-140-14-85:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda1      7.8G  4.6G  2.8G  62% /
none            4.0K     0  4.0K   0% /sys/fs/cgroup
udev             17G   12K   17G   1% /dev
tmpfs           3.4G  288K  3.4G   1% /run
none            5.0M     0  5.0M   0% /run/lock
none             17G     0   17G   0% /run/shm
none            100M     0  100M   0% /run/user
/dev/xvdb       827G   19G  767G   3% /mnt

ubuntu@ip-10-140-14-85:~$ lsblk
NAME  MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
xvdb  202:16   0   840G  0 disk /mnt
xvda1 202:1    0     8G  0 disk /
xvdg1 202:97   0    75G  0 disk
xvdp1 202:241  0   250G  0 disk
xvdp2 202:242  0   250G  0 disk
Shekhar
  • 107
  • 2
  • 5

1 Answers1

2

Now problem is that I cannot see those volumes using df -h command but those volumes can be seen from lsblk command.

Why is that a problem?

These commands show different things in the first place.

  • df displays you filesystem status, which means it'll only list mounted devices (it has nothing to show for unmounted ones – but, on the other hand, it also shows device-less mounts).

  • On the other hand, lsblk lists all block devices it can see. (The name is "list block" afterall.)

    If lsblk shows a device, that means the device is still in /dev – the kernel still sees it as attached. Notice that lsblk even determined its size.

So in your case, either the kernel is having troubles (take a look at dmesg), or AWS is having troubles and didn't detach the volumes (perhaps it stopped halfway when trying to attach them, too?).

user1686
  • 10,162
  • 1
  • 26
  • 42