Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

2013/12/06

Grow root partition and filesystem in Ubuntu and Linux Mint

Here are the steps to grow the root filesystem on an existing system that does NOT use LVM:
  1. First, use LVM; it makes resizing filesystems nearly trivial, robust, without any real downsides.  Just another way that Ubuntu is not enterprise-worthy.  But, we don’t have LVM on these systems’s as they are….
  2. Second, before doing any operations on your partitions, always perform and test a backup (to a separate system!) of your data. You may make your system unbootable and/or nuke all of your data!
  3. The system I performed these steps on was partitioned thus:
    1. /dev/sda – 7GB – /
    2. /dev/sda2 – remainder – Extended partition
    3. /dev/sda5 – swap – partition within the extended partition.
  4. So, to grow “/”, we will become root, delete the swap partition and the extended partition, grow /, and then re-create the swap partition.  Adjust the steps below according to the partition numbers and layout of your particular system:
    1. Disable swap:
      1. swapoff /dev/sda5
    2. Delete and re-create partitions as appropriate.
      1. fdisk /dev/sda
      2. print out partition information (p)
      3. Delete partition 5 (d – 5)
      4. Delete partition 2 (d – 2)
      5. Delete partition 1 (d)
      6. Create partition 1 (n – p – 1)
        1. It must start on the exact same sector as before (as seen in the print command)
        2. It must end on a sector higher than it did before.  Num_GB*1024*1024*2 = ending sector
      7. Create partition 2 (n – p – 2)
      8. Change partition 2 to type “Linux Swap” (t – 2 – 82 )
      9. Activate partition 1 to make it bootable (a - 1)
      10. Double-check everything.
      11. Exit (w)
    3. recreate the swap partition, using a label:
      1. mkswap -L swap /dev/sda2
    4. add a label to the root filesystem
      1. e2label /dev/sda1  /   (in centos, it’s e4label)
    5. Fix up /etc/fstab
      1. Fix the “swap” line to use LABEL=swap instead of UUID=
      2. Fix the “/” line to use LABEL=/ instead of UUID=
    6. swapon /dev/sda2
    7. Fix up /boot/grub/grub.cfg
      1. Either: Find the “linux” line for the menu option you will boot, change UUID= to LABEL=/
      2. Or: update-grub
    8. Re-create the initrd
      1. update-initramfs -u -k 3.2.0-38-generic
    9. Reboot the VM. *Cross your fingers!* This is your moment of truth.
    10. Grow the root filesystem
      1. resize2fs /dev/sda1  (resize4fs on CentOS, I believe).
    11. If it didn't boot, then that's what you get for biting off more than you could chew, and for choosing a distro that doesn't leverage LVM.  Boot off your Ubuntu/Mint install disk, and copy off your data to a USB disk, and start over. (...but you DID back up your data anyway, right?)

2013/02/07

Tweaks for Linux Mint

These were started with Linux Mint 14.1 Cinnamon

Menu bar shows up on the wrong screen:

Do this to find out the name of the displays:
sudo xrand -q
Do this to make the menu show up on one display or the other, for example:
sudo xrand --output VGA1 --primary

Sound doesn't come out through the correct device (speaker, headphone, etc.):

run these:
sudo apt-get install alsa-base alsa-utils pavucontrol pavumeter paman
alsamixer
...then in alsamixer, select the desired output "card", then ensure that "automute" is set to disabled or some other device.


I want to watch Netflix on Mint:

Run these commands:
sudo apt-add-repository ppa:ehoover/compholio
sudo apt-get install netflix-desktop


Display locks up with my NVidia card:

During install, select "compatibility mode".

After install, before logging in, select session type "Cinnamon 2D", then
sudo apt-get install nvidia-current nvidia-settings
sudo reboot

2010/07/04

Ubuntu tweaks

I'll try to update this to keep track of the tweaks I find necessary for ubuntu to work well.

Install System-wide Pulseaudio Equalizer:
sudo add-apt-repository ppa:psyke83/ppa
sudo apt-get update
sudo apt-get install pulseaudio-equalizer

Install Pulseaudio tools and alsaplayer plugin, etc:
sudo apt-get install libasound2-plugins "pulseaudio-*" paman padevchooser paprefs pavucontrol pavumeter

Multimedia Playing
sudo apt-get install totem vnc ubuntu-restricted-extras
sudo apt-get install libdvdread4 && sudo /usr/share/doc/libdvdread4/install-css.sh


Send email from cli with attachments
sudo apt-get install mutt
echo "see attached" | mutt -s "file attached" -a Documents/somefile.xls -- jdoe@somewhere.com

Network Troubleshooting Tools
sudo apt-get install iputils-tracepath nmap aircrack-ng

Remote Systems Administration
sudo apt-get install gtkvnc rdesktop tsclient