2

I have an install of Ubuntu 20.04 VM in VMware. I have expanded the HD from 40 GB to 60 GB. I would like to get the system to recognize the additional space without a reboot. I tried running:

echo 1 > /sys/block/sda/device/rescan

which results in a permission denied. Tried it with sudo, same results.

I would like to not have to reboot the server for it to see the new space.What command or format would accomplish this task?

1 Answers1

1

You can't use redirection with sudo - this is a known limitation.

Instead, pass the entire command (including redirection) to a subshell.

sudo bash -c 'echo 1 > /sys/block/sda/device/rescan'

Or use tee to do the redirection:

echo 1 | sudo tee /sys/block/sda/device/rescan
Artur Meinild
  • 31,035