The Official *nix Thread

Inane baanter or words of wisdom - you decide...
Post Reply
User avatar
JQW
Baaaaa!
Baaaaa!
Posts: 1186
Joined: Thu Feb 22, 2007 12:23 pm 0
Location: Ripon, where nothing ever happens.

Re: The Official *nix Thread

Post by JQW »

What does 'apt-get dist-upgrade' say?

Running 'apt-get upgrade' will only replace existing packages, so if any of the packages awaiting an upgrade have dependancies on other packages that are not currently installed, they will be ignored. Using 'apt-get dist-upgrade' will pull in the new dependant packages too, but will still fail if there's versioning issues.

In this case the linux-image and linux-image-server packges probably have dependancies on a kernel image version different to the current one. As for the openssh packages, there's probably a dependancy on a new library.
User avatar
Kemper_Boyd
Sheepie Whore
Sheepie Whore
Posts: 11967
Joined: Wed Jul 31, 2002 9:15 pm 0

Re: The Official *nix Thread

Post by Kemper_Boyd »

That sounds about right to me. There were some similar images kept back a few
months ago with Ubuntu Server and as far as I can recall it was to avoid forcing
kernel changes. I don't think there's anything to worry about, it's simply good
manners on the part of the repository managers.
User avatar
dom
Baaaaa!
Baaaaa!
Posts: 1370
Joined: Wed Feb 09, 2005 1:17 pm 0
Location: Edinburgh, UK and level 691859
Contact:

Re: The Official *nix Thread

Post by dom »

I think I see what you mean, thanks folks.

# apt-get dist-upgrade says, amongst other things:

Code: Select all

The following NEW packages will be installed
  linux-image-2.6.24-19-server linux-ubuntu-modules-2.6.24-19-server openssh-blacklist
The following packages will be upgraded:
  libc6 libc6-dev libc6-i686 linux-image-server linux-server openssh-client openssh-server tzdata
8 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
So I guess I should dist-upgrade as opposed to just upgrade.

I originally thought that dist-upgrade would install the latest release if the system wasn't already running it, but I understand it won't change the current release level unless you change the sources used (i.e. performing a "s/gutsy/hardy/g" on /etc/apt/sources.lst under Ubuntu).

The way Ubuntu handles the distibution level appears to be different from the classic Debian method of having "stable", "unstable" or "testing" in that it uses a named release, "gutsy", "hardy" etc. I understand Ubuntu has introduced an apt-get additional command "do-release-upgrade" which handles this automagically but for my server, which I want to always have the latest version of packages such as openssh, I imagine I should just use "dist-upgrade".

I feel like I'm missing an important part of the documentation, as the stuff I've read so far appears to only handle the basic level of package installation or require the GUI. Is this sort of thing explained in a "I've been using UNIX for years but am new to Ubuntu" fashion?

cheers
OMG (or oligodendrocyte myelin glycoprotein) is a molecule found in your central nervous system.
User avatar
Dungeon-Dave
Baaaaaa!
Baaaaaa!
Posts: 3925
Joined: Thu Aug 04, 2005 12:01 pm 0
Location: UK
Contact:

Re: The Official *nix Thread

Post by Dungeon-Dave »

dom wrote:Is this sort of thing explained in a "I've been using UNIX for years but am new to Ubuntu" fashion?
If so, direct me to a similar guide, will you? I could do with familiarising myself with some of the debian/lesbian/ubunion oddities (from a DeadRat POV, obviously).
User avatar
stealthbanana
Baaaaaa!
Baaaaaa!
Posts: 2805
Joined: Wed Nov 09, 2005 11:59 pm 0
Location: Over Here.

Re: The Official *nix Thread

Post by stealthbanana »

The packages that are kept back are ones that require additional packages that are not included in an simple update / upgrade. These extra dependencies are not installed so cannot be updated, you will have to install them. If you do apt-get install <kept-back-package> it will tell you that it needs to install extra stuff and do so for you. It's quite logical when you think about it.
Not long now before lollipop men are called Darren
User avatar
dom
Baaaaa!
Baaaaa!
Posts: 1370
Joined: Wed Feb 09, 2005 1:17 pm 0
Location: Edinburgh, UK and level 691859
Contact:

Re: The Official *nix Thread

Post by dom »

I agree it's logical, I just wasn't expecting that "dist-upgrade" would install the latest versions of packages within the same release of the OS, I thought it was for switching to the latest distribution/release of the OS.
OMG (or oligodendrocyte myelin glycoprotein) is a molecule found in your central nervous system.
User avatar
RageMatrix
Baaaaaaa!
Baaaaaaa!
Posts: 5515
Joined: Fri May 10, 2002 12:52 pm 0
XBL Gamertag: Jon256
Location: East Sussex

Re: The Official *nix Thread

Post by RageMatrix »

Y' know - I'm just loving runnng my own server at home. I'be got a bunch of cool services running and the whole thing seems pretty secure. But I want to install more webapps. No reason. And I figured I can't keep asking you guys whats cool - so where is the best place to look? SourceForge?

Thanks :)
XBox Gamertag: Jon256
Wii Code: 4849 1090 9042 6725
"Wrapped in metal, wrapped in ivy"
The Official UNIX/Linux Thread
User avatar
Dungeon-Dave
Baaaaaa!
Baaaaaa!
Posts: 3925
Joined: Thu Aug 04, 2005 12:01 pm 0
Location: UK
Contact:

Re: The Official *nix Thread

Post by Dungeon-Dave »

RageMatrix wrote:And I figured I can't keep asking you guys whats cool - so where is the best place to look? SourceForge?
Sourceforge, freshmeat, any online *nix forums, various *nix* usenet feeds. Google sometimes throws out something interesting (usually linked to a forum somewhere).

Don't feel you're taxing anyone's time by asking here[1] - answers to your questions will benefit others also. I've found out about apps/services etc via forums like these.

If you wanna fart around with a coupla other utils, look at phpsysinfo, and configuring "sensors" to interrogate system health (mobo temp, fan speed, voltage fluctuations etc). This info can also be recorded and displayed using mrtg or cacti, so historical info and trends can be analysed - I've noticed a drop in system temp since blowing out dust from ORAC.

If your router talks SYSLOG, look at configuring syslogd on the boxen and having it log reports from your router. If mrtg/cacti etc is running, you can display pretty traffic graphs measuring port-based traffic, types of connections, et al.

I lost many a minute twatting around with this stuff... one thing led to the next and to the next ....

[1] okay, so I'm speaking for myself. But those uninterested have stayed out, and those interested have responded with some useful info so far.
User avatar
RageMatrix
Baaaaaaa!
Baaaaaaa!
Posts: 5515
Joined: Fri May 10, 2002 12:52 pm 0
XBL Gamertag: Jon256
Location: East Sussex

Re: The Official *nix Thread

Post by RageMatrix »

Well, I've installed Nagios - because well I can do it in my sleep at work - but it doesn't seem to work right on my server (the machine insists its down as the check_ping / check-host-alive doesn't work regardless of the fact that /bin/ping works just fine. All the other plugins works okay. Odd.

Are you saying you can add plugins to phpsysinfo (which I've installed)? I always liked the fact you could write your own plugins in Perl for Nagios :) Or are we talking hardware, because I've never been much for electronics.

Still need to install the fail2bin thing but I'm going to poke around SourceForge and the rest mentioned for fun stuff. I might install a BZFlag server or something too.

Mental note: must throw in a cheap 256MB ram stick - thing is starting to flag a little with only 256B ram currently :)
XBox Gamertag: Jon256
Wii Code: 4849 1090 9042 6725
"Wrapped in metal, wrapped in ivy"
The Official UNIX/Linux Thread
User avatar
Dungeon-Dave
Baaaaaa!
Baaaaaa!
Posts: 3925
Joined: Thu Aug 04, 2005 12:01 pm 0
Location: UK
Contact:

Re: The Official *nix Thread

Post by Dungeon-Dave »

RageMatrix wrote:Are you saying you can add plugins to phpsysinfo (which I've installed)?
No, the config file has some settings to interrogate other aspects of system health and one of them is using lm_sensors to read motherboard info (voltage, temperature, fan speed etc). Since this info is obtainable via commands (and snmpd queries in some places) it's a simple matter to also graph the info in mrtg/cacti (and nagios too, I'd imagine).

Try typing "sensors" at a command prompt, see what it shows.
User avatar
RageMatrix
Baaaaaaa!
Baaaaaaa!
Posts: 5515
Joined: Fri May 10, 2002 12:52 pm 0
XBL Gamertag: Jon256
Location: East Sussex

Re: The Official *nix Thread

Post by RageMatrix »

Cool, thanks.

Now I'm trying to tackle LVM, as I need more disk space on my server.

I'm running out of disk space on my server, so was going to add a new IDE hard disk. Presumably, each drive like hard disks are listed under the virtual filesystem under /dev. I only have one hard disk in there at the moment and I bascally want to add a new hard disk and only append the new space to /home. However, under /dev where I was expecting just one entry for /dev/sda1, I get sda, sda1 and sda2 which look like SATA drives (which I don't understand, I'm pretty sure the only one is IDE). These entries are highlighted in yellow and if I do a "ls -la" I get things like: -

cdrom (in blue) -> sr0 (in yellow)
cdrw (in blue) -> sr0 (in yellow)
floppy (in blue) -> fd0 (in yellow)

How will I know if I've added a new hard disk and how can I identify the devices above in any certainty?

As far as I can tell, the procedure for adding a new disk is: -

1. Add new physical drive (data and power cable)
2. Check to see if the new device appears under /dev (this is one bit I'm unclear about).
3. fdisk the new disk using "fdisk /dev/sda2" or whatever (thats what I need to know too, I guess).
4. Format the Linux partition using "mkfs -t ext3 /dev/sda2".
5. Scan for Linux LVM file-systems which the "vgcreate <groupname> /dev/partition1...or something". Don't understand this bit either really.
6. Create volumes to a specific set with the "pvcreate /dev/partition1" command.
7. Now I should be able to create a logical volume (presumably something like VolGroup01 like I can see under /dev now). Apparently, I should use "lvcreate -L xyM -n <volume> <group>" where xy is the size of the group and <group> is the volume group name (something like VolGroup02?) and <volume> is the name returned from the previous step.
8. Finally, format the logical volume (VolGroup02) with "mkfs -t ext3 /dev/sda2" (again? - didn't I do that already above - wrong order?)

Now, can I mount the new drive and append the space with something like "mount /dev/hda2 /home" and if so, how can I make this automatic?

Anything I've got wrong above? Oh, and sorry for all the questions! I can't put any of this into practice quite this minute, as I don't have a spare IDE HDD yet.
XBox Gamertag: Jon256
Wii Code: 4849 1090 9042 6725
"Wrapped in metal, wrapped in ivy"
The Official UNIX/Linux Thread
User avatar
Dungeon-Dave
Baaaaaa!
Baaaaaa!
Posts: 3925
Joined: Thu Aug 04, 2005 12:01 pm 0
Location: UK
Contact:

Re: The Official *nix Thread

Post by Dungeon-Dave »

RageMatrix wrote:Cool, thanks.

Now I'm trying to tackle LVM, as I need more disk space on my server.
LVM won't give you more disk space - it just allows you to dynamically expand/move data around - but you're going down the right route, anyhow.
RageMatrix wrote:Anything I've got wrong above?
Yes, but that's why you posted here. And you'll be pleased to know what you got wrong is only minor.

Firstly, let's take disk device files. Your first device will be /dev/sda, second /dev/sdb, third /dev/sdc etc (used to be /dev/hd[a-z] for PATA, /dev/sd[a-z] for SATA/SCSI but now they're all /dev/sd*).

The trailing number is the partition number, so /dev/sda1 is the first partition on the first disk, /dev/sdb3 third partition on the second disk, etc. To see ALL partitions, just try: fdisk -l

Now, let's do your other steps:

2. "kudzu" will show new hardware. "dmesg" should show it's been picked up. "fdisk -l" ought to list it as a disk devoid of partitions.

3. fdisk /dev/sdc (or whatever the new disk is) and create one HUGE partition using the entire disk. Then use option "t" to change the partition type from 83 to 8e - this flags it up as being available for LVM.

4. Don't "format" a disk under linux - using LVM, you create a filesystem on a logical volume. Once you exit fdisk, use: pvcreate /dev/sdc1 (or whatever the path is).

5 & 6 are the wrong way around. You create PVs, bind them together into VGs which are then sliced up into LVs, each LV being "formatted" to put a filesystem on it.
5. Scan for physical volumes: pvscan. It should show up, unassigned.
6. Create a new volume group: vgcreate jonvg /dev/sdc1. The name of the volume group can be anything - but since it creates files in /dev, the convention is to give it a "vg" prefix or suffix. "filmsvg", "vgpron", "warezVG" are all perfectly good names. Honest.

6a: use "pvscan" and see that the PV is now in use. Use "vgscan" to search and display volume groups. Use "pvdisplay" to show information about your volume group, "pvdisplay -v jonvg" for detailed (verbose) information.

7. Create a logical volume with: lvcreate -L5G -nfilmslv jonvg - creates /dev/jonvg/filmslv as a 5-gig LV.

7a. lvscan, etc. You can figure this one by now, although a verbose listing of the JONVG will now show FILMSLV also.

8. mkfs.ext3 /dev/jonvg/filmslv to make a filesystem

9. mount /dev/jonvg/filmslv /home/films

10. add it to /etc/fstab so it comes online at reboot.

11. (later date) expand the LV with: lvextend -L+2G /dev/jonlv/filmlv and resize2fs.

Hope that helps! If you want a more detailed guide, give me a prod.
Last edited by Dungeon-Dave on Sun Oct 19, 2008 6:26 pm 0, edited 1 time in total.
User avatar
RageMatrix
Baaaaaaa!
Baaaaaaa!
Posts: 5515
Joined: Fri May 10, 2002 12:52 pm 0
XBL Gamertag: Jon256
Location: East Sussex

Re: The Official *nix Thread

Post by RageMatrix »

Thanks Dave. As always, you're a star. I don't have a second drive yet, but if I get into difficulties I'll let you know. Your post looks pretty comprehensive, though. Thanks again. Now I just need to wait until payday for a drive :D
XBox Gamertag: Jon256
Wii Code: 4849 1090 9042 6725
"Wrapped in metal, wrapped in ivy"
The Official UNIX/Linux Thread
User avatar
xav
Baaaaaa!
Baaaaaa!
Posts: 2455
Joined: Thu Jun 06, 2002 5:32 pm 0
Location: Bucks, UK
Contact:

Re: The Official *nix Thread

Post by xav »

Just so you know, you don't need to go down the LVM route just to add another drive to hold your /home directory. You may still want to use LVM anyway, but it's not essential for this purpose. The basic steps are something like this:

1) Install drive, check it gets recognised via dmesg, then partition and format it
2) Manually mount it to a temporary directory somewhere
3) Copy everything in /home onto it
4) Edit your /etc/fstab to add an entry for the new partition so that it gets automatically mounted at /home on boot
5) Reboot
Co-creator of The Greys, Monsters, Inked & Elvie webcomics
• Web Site • Twitter • Patreon •
User avatar
RageMatrix
Baaaaaaa!
Baaaaaaa!
Posts: 5515
Joined: Fri May 10, 2002 12:52 pm 0
XBL Gamertag: Jon256
Location: East Sussex

Re: The Official *nix Thread

Post by RageMatrix »

Thanks! I'll probably try both approaches just so I know how to do both ways, but I need a new drive first :)
XBox Gamertag: Jon256
Wii Code: 4849 1090 9042 6725
"Wrapped in metal, wrapped in ivy"
The Official UNIX/Linux Thread
Post Reply