I am using Linux Instance that has an EBS volume attached to it (mounted to xvda1). which I believe it causing some troubles. usually to detach the volume I go to volume section of the AWS EC2 console select the volume and click Detach. but I am getting an error message

Error detaching volume
vol-0a4107076dcd6895f: Unable to detach root volume 
'vol-0a4107076dcd6895f' from instance 'i-04d5c232841cc2fa1'

when I tried to unmount the volume with commands I get this

b@ip-XX-XX-XX-XX:~$ df -hk
Filesystem     1K-blocks    Used Available Use% Mounted on
udev              499260       0    499260   0% /dev
tmpfs             101452    4320     97132   5% /run
/dev/xvda1      10098468 4869284   5212800  49% /
tmpfs             507248       0    507248   0% /dev/shm
tmpfs               5120       0      5120   0% /run/lock
tmpfs             507248       0    507248   0% /sys/fs/cgroup
tmpfs             101452       0    101452   0% /run/user/1000
b@ip-XX-XX-XX-XX:~$ sudo umount /dev/xvda1
umount: /: target is busy
        (In some cases useful info about processes that
         use the device is found by lsof(8) or fuser(1).)

Please help me to unmount and Detaching AWS EBS drive


Why are you trying to detach root volume from a running system?

That’s not possible for obvious reasons - the OS needs the root filesystem to function properly.

If for some reason you really need to detach the root volume you’ll have to stop the instance first. Don’t terminate it, just stop. Then you’ll be able to detach it but until you attach it back you won’t be able to start the instance.

Hope that helps :)

| improve this answer | |
  • you are right I have tested it with other instances and when I tried to start it again it she me this error (( Error starting instances )) – Sami abdo Sep 29 '18 at 17:25
  • I have made some changes to the landing page through the code and even through the composer are not get reflected updated and it shows the old data as it is, but when we login as a user then we are able to see the new updated contents of the landing page and also able to see the changes. I have disabled the cache plugin, php ini cache is also disabled , the other suggested cache related to httpd config is also disabled, I have restarted the server multiple times after the changes made. I thought there are some sort of settings or connection to AWS EBS drive which cause this troubles – Sami abdo Sep 29 '18 at 17:25
  • I found a solution for this issue it was all because of a plugin, the plugin was not able to delete cache files on this directory /wp-content/cache/ – Sami abdo Oct 1 '18 at 19:33

Use the following commands umount -l /PATH/OF/BUSY-DEVICE umount -f /PATH/OF/BUSY-NFS(NETWORK-FILE-SYSTEM)

By using this commands it will stop the running processes on disk

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.