I recently had a strange error while trying to partition removable usb drives. lsblk correctly reported the drive configuration. However when I tried to dd an image to the drive dd error'd, reporting the (8GB) drive as being just 2GB. gdisk reported the same result, as did KDE partitionmanager. However, I could write zeros to the drive partitions, eg /dev/sdb1. I tried another drive with exactly the same result. I ran partprobe which had no result. I also received an error at some point stating that /dev/disk/by-label/sdb did not exist. I rebooted and the error disappeared, so no harm. I was wondering if anybody knows what might have happened, and how to recover from the error without rebooting?.
Asked
Active
Viewed 51 times
1 Answers
0
Often the kernel {is not/cannot be} updated, when the partition table of a drive is modified.
Sometimes it helps to run
sudo partprobe(to fix such issues without rebooting).
I too have noticed that
lsblkis often better than other tools to report the correct data about drives.As you noticed already, rebooting is a good method to get the data about partition tables correct.
But sometimes it is a good idea to avoid rebooting, as illustrated by the following link,
sudodus
- 47,684