Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mount already mounted or busy

I have an Amazon EC2 instance (Ubuntu 12.04) to which I have attached two 250 GB volumes. Inadvertently, the volumes got unmounted. When I tried mounting them again, with the following command,

sudo mount /dev/xvdg /data

this is the error I get :

mount: /dev/xvdg already mounted or /data busy

Then, I tried un-mounting it as follows : umount /dev/xvdg but it tells me that the volume is not mounted.

umount: /dev/xvdg is not mounted (according to mtab)

I tried lsof to check for any locks but there weren't any.

The lsblk output is as below :

enter image description here

Any help will be appreciated. What do I need to do to mount the volumes back without losing the data on them?

like image 472
Yahya Avatar asked Nov 08 '22 06:11

Yahya


1 Answers

Ok, figured it out. Thanks @Petesh and @mootmoot for pushing me in the right direction. I was trying to mount single volumes instead of a RAID 0 array. The /dev/md127 device was running so I stopped it first with the following command :

sudo mdadm --stop /dev/md127

Then I assembled the RAID 0 array :

sudo mdadm --assemble --uuid <RAID array UUID here> /dev/md0

Once the /dev/md0 array became active, I mounted it on /data.

like image 64
Yahya Avatar answered Nov 10 '22 21:11

Yahya