Press "Enter" to skip to content

Category: Guides

How to recover sudo on Ubuntu – The importance of arguing

I made a little mistake the other night while fiddling with my laptop. In an alcohol infused rush to mount an NFS share I missed an argument while modifying groups. I was adding myself to a group that facilitates R/W access on my NFS accessed RAID. DO NOT RUN THIS user@machine$ sudo usermod USER -G GROUP Where USER and GROUP are the relevant ones for the system. The problem with this is that withou “-aG” this subsitutes GROUP as the sole group for the user. The effect of this on an Ubuntu system with only one user is that you’ve now just removed the ability to act as root, while simultaneously breaking access to anything your user needs from other groups (this will affect applications and files). My additional complication here is an encrypted disk. Fortunately, a fix quickly came to mind. Boot a live disk (Ubuntu MATE 18.04 in this case) Mount the encrypted drive, made…

Leave a Comment

Shrink a Qemu KVM virtual disk

Shrinking a virtual disk isn’t something that comes up often. Usually you tend to grow your virtual machines. I, however came across the requirement on my home workstation to shrink a Qemu virtual disk running Windows 10 as I wanted to enhance backup/deployment of the OS itself and externalise the games/other software therein. If you’re running a home system with contention for SSD space then you might have a similar issue. Information wasn’t readily available though I did find a very helpful response on Server Fault that gave me the basis for my method. You may want to cross reference that for further information. If you already have an adequate amount of unallocated storage on your disk, skip to step 3. If you do not have storage unallocated to partitions on the virtual disk, you’ll need to shrink your partition/s. In Windows you can do this in Disk Management, even for an online…

Leave a Comment