Linux

Mounting LVM Disks in Ubuntu

I always thought LVM (Linux’s Logical Volume Manager) was kind of neat for the flexibility it gives you in adding and removing disks and resizing volumes such. However, in practice, I find it’s usually more trouble than it’s worth. It adds a layer of complexity between me and my data. Often I need to mount a disk configured with LVM on another Linux machine or in an Ubuntu live CD environment. Out of the box the logical volumes aren’t recognized, so I can’t mount them.
Read more

How to sudoedit non-interactively

Okay, this one’s a bit esoteric, but I think it’s pretty cool. How do you use ‘sudoedit’ non-interactively such as from a script? Just a brief background about sudo: sudo is an authentication mechanism in Unix & Linux that allows unprivileged users to run specific commands (as defined by the system administrator) with root privileges without having the root password. This has several advantages over logging in as root: Users can have specific, limited set of root privileges without having the entire set of root privileges. Users use their own password, so the root password doesn’t have to be shared. If a user’s sudo privileges are revoked, the root password doesn’t have to be reset. Each use of sudo is audited per user, so that each time sudo privileges are invoked, there is an event in the system logs that identifies the specific user and the command they ran. Sudoedit is a command that is related to sudo. It lets users edit files that normally only root can edit, such as system configuration files. However instead of using “sudo” followed by the editing command, the user runs “sudoedit filename” and sudo invokes the user’s default editor, letting them edit the file.
Read more