0

I was trying to expand my Azure VM's OS disk and I've unmounted /dev/sda1 which is OS partition in order to do the steps mentioned here: https://docs.microsoft.com/en-us/azure/virtual-machines/linux/expand-disks

But sudo unmount /dev/sda1 didn't do the job as it said "umount: /: target is busy". So I've unmounted the disk with the sudo umount -l /dev/sda1 command. Since then I can't even do sudo in terminal and df -H is not working anymore. It throws "df: cannot read table of mounted file systems: No such file or directory".

When I type sudo, it says "sudo: effective uid is not 0, is /usr/bin/sudo on a file system with the 'nosuid' option set or an NFS file system without root privileges?"

How can I fix this issue please help. Thanks in advance.

dorukoski
  • 138

1 Answers1

2

K - this is an incomplete answer because I'm a little lazy:

Ubuntu is a disk-based OS - there is some device in your system, which contains the OS, and the commands that the OS is able to run. In your system, the OS is part of the directory space know as / or root. It's generally a good guess that root is part of the partition /dev/sda1, although it can be in other places.

When you ran sudo umount -l /dev/sda1 you disconnected the root directories. Linux now does not know how to run commands like df, and it does not have any place to look up these instructions. In windows terms, you disconnected the 'C' drive while your computer was running.

There is probably no damage but I think at the least you will need to reboot the virtual machine.

Following getting control of your machine, please review questions like How do I resize root partition

mook765
  • 15,925
Charles Green
  • 21,339