Sunday, June 29, 2008
Saturday, June 14, 2008
How to move the /home directory to a separate partition (ie - a separate hard drive)
When ubuntu installs, the home directory is created on the same partition as the os. However, it would be nice to move the home directory to its own partition so that the os can be reinstalled/upgraded without affecting user files. Here's how I did it.
1) Create a new partition (see previous post about how to format and mount a second hard drive)
2) Mount new partition using mount (mount to anywhere except /home)
3) Copy user directories in /home to new partition
4) Delete everything in /home (but keep the actual /home directory)
5) Edit /etc/fstab to have new partition mount to /home
(note that you may have to update the UUID of the new partition in /etc/fstab, see previous post about adding an entry to /etc/fstab)
(another note, if the mount fails, when you try to login, you will get an error that says that the user directory cannot be found)
1) Create a new partition (see previous post about how to format and mount a second hard drive)
2) Mount new partition using mount (mount to anywhere except /home)
3) Copy user directories in /home to new partition
4) Delete everything in /home (but keep the actual /home directory)
5) Edit /etc/fstab to have new partition mount to /home
(note that you may have to update the UUID of the new partition in /etc/fstab, see previous post about adding an entry to /etc/fstab)
(another note, if the mount fails, when you try to login, you will get an error that says that the user directory cannot be found)
Saturday, June 7, 2008
How to share files (installing samba)
Sharing files and folders in ubuntu over a network is extremely easy. Simply right click on any folder and choose "Sharing Options". When the Folder Sharing windows comes up, simply select the "Share this folder" option. If samba is not installed, you will be prompted with a message that says "You need to install the Windows networks sharing service in order to share your folders". Choose "Install service" option and samba will be installed automatically (it seems like the packages that get installed are samba and samba-common).
That's it! Just reboot and everything should work. Note that if you don't reboot, you'll get the following error message:
'net usershare' returned error 255: net usershare add: cannot convert name "Everyone" to a SID. The connection was refused. Maybe smbd is not running.
That's it! Just reboot and everything should work. Note that if you don't reboot, you'll get the following error message:
'net usershare' returned error 255: net usershare add: cannot convert name "Everyone" to a SID. The connection was refused. Maybe smbd is not running.
How to monitor CPU temperature in linux
I followed the instructions found here:
http://www.xawk.com/ubuntu-cpu-temperature.html
I installed the lm-sensors package using the command:
sudo apt-get install lm-sensors
I then ran the sensors-detect executable:
sudo sensors-detect
I used all the default answers to the questions (typically, yes) except for the last one where it asked if I wanted to modify /etc/modules (no was the default but I entered yes). The following lines were added to /etc/modules:
# Chip drivers
w83627ehf
coretemp
I then rebooted and tried to install X Sensors but it kept saying that coretemp and w83627ehf were not supported by xsensors.
So next I turned to sensors-applet:
sudo apt-get install sensors-applet
I also installed hddtemp:
sudo apt-get install hddtemp
to get hard drive temperatures (choose yes when it asks if you want to run a daemon).
To run the applet, right click on any panel and choose "Add to Panel" and then add the "Hardware Sensors Monitor". Right click on the applet and select Preferences -> Sensors to choose what information is displayed.
http://www.xawk.com/ubuntu-cpu-temperature.html
I installed the lm-sensors package using the command:
sudo apt-get install lm-sensors
I then ran the sensors-detect executable:
sudo sensors-detect
I used all the default answers to the questions (typically, yes) except for the last one where it asked if I wanted to modify /etc/modules (no was the default but I entered yes). The following lines were added to /etc/modules:
# Chip drivers
w83627ehf
coretemp
I then rebooted and tried to install X Sensors but it kept saying that coretemp and w83627ehf were not supported by xsensors.
So next I turned to sensors-applet:
sudo apt-get install sensors-applet
I also installed hddtemp:
sudo apt-get install hddtemp
to get hard drive temperatures (choose yes when it asks if you want to run a daemon).
To run the applet, right click on any panel and choose "Add to Panel" and then add the "Hardware Sensors Monitor". Right click on the applet and select Preferences -> Sensors to choose what information is displayed.
Friday, June 6, 2008
Getting DVDs to play in linux
After some brief research, I decided to use the Ogle DVD player because it supports menus.
I installed ogle and ogle-gui using apt-get:
sudo apt-get install ogle
sudo apt-get install ogle-gui
I installed libdvdcss2 from Medibuntu, following instructions from here:
https://help.ubuntu.com/community/Medibuntu
First I added the Medibuntu packages to my package manager:
Then I installed libdvdcss2 using apt-get:
sudo apt-get install libdvdcss2
And it worked! (after a reboot)
MPlayer also works for playing DVDs (after installing libdvdcss2) but doesnt support menus.
Note that before installing libdvdcss2, I was getting the following error when trying to play DVDs with Ogle:
libdvdread: Can't open file VIDEO_TS.IFO.
ERROR[ogle_nav]: faild to read VIDEO_TS.IFO
DVDSetDVDRoot:: Root not set
This error was fixed after I installed libdvdcss2
I installed ogle and ogle-gui using apt-get:
sudo apt-get install ogle
sudo apt-get install ogle-gui
I installed libdvdcss2 from Medibuntu, following instructions from here:
https://help.ubuntu.com/community/Medibuntu
First I added the Medibuntu packages to my package manager:
sudo wget http://www.medibuntu.org/sources.list.d/hardy.list -O /etc/apt/sources.list.d/medibuntu.list
sudo apt-get update && sudo apt-get install medibuntu-keyring && sudo apt-get update
Then I installed libdvdcss2 using apt-get:
sudo apt-get install libdvdcss2
And it worked! (after a reboot)
MPlayer also works for playing DVDs (after installing libdvdcss2) but doesnt support menus.
Note that before installing libdvdcss2, I was getting the following error when trying to play DVDs with Ogle:
libdvdread: Can't open file VIDEO_TS.IFO.
ERROR[ogle_nav]: faild to read VIDEO_TS.IFO
DVDSetDVDRoot:: Root not set
This error was fixed after I installed libdvdcss2
Wednesday, June 4, 2008
Changing the ownership of a directory or file
use the chown command: chown username dirname
Owner of a directory can be queried using ls -l (3rd column)
chgrp changes the group of a directory. Group name is the 4th column in the results of ls -l
Owner of a directory can be queried using ls -l (3rd column)
chgrp changes the group of a directory. Group name is the 4th column in the results of ls -l
Tuesday, June 3, 2008
Formatting a hard drive in linux
I got 2 hard drives for my system. Seagate 7200.10 Barracudas, 250gb each. The first one was formatted and the partitions were created (ext3 file system) during the ubuntu install. However, I couldn't figure out how to format the second one.
After a bit of searching, I found a couple of ways to do it. The first is to use fdisk and mkfs: http://www.ehow.com/how_1000631_hard-drive-linux.html
The second is to use gparted. I chose to use gparted because it has a gui. I first selected the drive I wanted (/dev/sdb) and created a disklabel (I used the "msdos" table type). I then created a primary partition (ext3 filesystem) by choosing Partition -> New from the menus.
After hitting "Apply", the partition was created in a few seconds. Pretty easy.
Next I edited /etc/fstab to get the drive to automatically mount on startup. I added the following line to my fstab file:
UUID=41a557bc-3f4f-4cc9-8edf-c32672529897 /stuff ext3 relatime,errors=remount-ro 0 1
where the relatime,errors=remount-ro options are the same as my main drive.
I chose to mount by UUID instead of device name in case I wind up swapping the drives around. In order for the mount by UUID to work, I first had to add a symbolic link in /dev/disk/by-uuid/ for the partition I just created.
I found the UUID of the partition using the vol_id command:
sudo vol_id /dev/sdb1
I then created the symbolic link in /dev/disk/by-uuid/ using the ln command:
sudo ln -s ../../sdb1 41a557bc-3f4f-4cc9-8edf-c32672529897
where sdb1 is the partition I just created and 41a557bc-3f4f-4cc9-8edf-c32672529897 is the UUID returned by vol_id
After a bit of searching, I found a couple of ways to do it. The first is to use fdisk and mkfs: http://www.ehow.com/how_1000631_hard-drive-linux.html
The second is to use gparted. I chose to use gparted because it has a gui. I first selected the drive I wanted (/dev/sdb) and created a disklabel (I used the "msdos" table type). I then created a primary partition (ext3 filesystem) by choosing Partition -> New from the menus.
After hitting "Apply", the partition was created in a few seconds. Pretty easy.
Next I edited /etc/fstab to get the drive to automatically mount on startup. I added the following line to my fstab file:
UUID=41a557bc-3f4f-4cc9-8edf-c32672529897 /stuff ext3 relatime,errors=remount-ro 0 1
where the relatime,errors=remount-ro options are the same as my main drive.
I chose to mount by UUID instead of device name in case I wind up swapping the drives around. In order for the mount by UUID to work, I first had to add a symbolic link in /dev/disk/by-uuid/ for the partition I just created.
I found the UUID of the partition using the vol_id command:
sudo vol_id /dev/sdb1
I then created the symbolic link in /dev/disk/by-uuid/ using the ln command:
sudo ln -s ../../sdb1 41a557bc-3f4f-4cc9-8edf-c32672529897
where sdb1 is the partition I just created and 41a557bc-3f4f-4cc9-8edf-c32672529897 is the UUID returned by vol_id
Which version of linux?
My system has an Intel Core 2 Quad Q6600 processor and an Asus P5E-VM HDMI mainboard. This board uses the Intel G35 chipset and I'm using the integrated video. This machine will be used as a media server in my house.
I decided to use Ubuntu on my system. I didn't really spend too much time deliberating. I chose ubuntu because it seems to be the easiest to use for a linux noob like me. I'm using the 64 bit desktop edition of version 8.04 (Hardy Heron).
I decided to use Ubuntu on my system. I didn't really spend too much time deliberating. I chose ubuntu because it seems to be the easiest to use for a linux noob like me. I'm using the 64 bit desktop edition of version 8.04 (Hardy Heron).
First Post
I'm currently building a new computer system and, for the first time, I will be using only linux as the operating system. The purpose of this blog is to document this process. I am a complete linux noob, so the problems I run into may seem obvious to many, but hopefully others that find themselves in a similar situation can benefit from my experiences.
Subscribe to:
Posts (Atom)