Tele2 is an European connectivity provider at a very low price. Let’s say that the service is proportional to the price.
I know it’s difficult to keep something up 24/7, but it’s their due anyway. As I happily learned, Tele2 stops outgoing port 25 to prevent some spam problems (not enough resources to put some server which picks random mails in transit and check if they’re spam or not?), and this already made me angry. but, anyway.
At irregular intervals, a new IP address is given to users. Tipically, giving some disservice in doing so (I don’t know if the disservice provokes a re-connection trial and thus a new address, or vice versa, but none of the options are very nice). Last time, this cause some problem, and no internet was reacheable from this host after the first hop (the one after the peer). I tried a couple of reconnections, at the third trial it all started working again. The point is: I’m usually not where the server is located, and since I can’t hope to make my mother learn the misteries of terminal and the like, I’m better dealing with the situation.
So, I had to write some scripts which do the stuff on my behalf. Since I can’t give 100% guilt to Tele2 (it could also be that I have very strangely bugged modem drivers, even if it sounds strange to me that the two events - “flawless” address change, for once, and connection drops, were simultaneous), I suppose that both a reconnection trial (poff/pon couple) is to be tried, and reboot if nothing else works. Reboot is not that bad: the host is unreacheable anyway in this case. So, in attachment, you find a cron script and the defaults file which I wrote to check everything’s alright. It checks connection is up, gateway is reacheable and dns servers are too (in turns, with tele2 connection I’ve had each of this problem occouring separately from the others - connection down; connection up and gateway unreacheable; connection up, gateway reacheable but dns unreacheable…). Hope this way downtimes are reduced to the bare minimum!
Posted by mattia as boot, cron, dns, smtp, tele2 at 5:41 PM CEST
No Comments »
New Ubuntu version, Feisty Fawn, and I decide to upgrade. A little problem: my /boot is too little. I won’t tell you how little I did it because I’m not that proud of my choice, now. Anyway, I have a 4-disk system managed by LVM, with a single XFS partition over it. luckily, one of them was spare (I planned to put windows on it, then I didn’t need it and was yet free), because XFS can only be grown, never shrinked (funny choice, by the way). So, I had to create a new boot partition, migrate the contents there, and make the old boot partition join the LVM. Since this involved something delicate (yes, that plain, old boot partition) I did things with care. Not enough, since I forgot one thing and had to put the server up again making things locally. Anyway, if you’re brave, you can technically make all that I talked about with your system online and running. How? This is the roadmap:
- partition the new disk. I made a 400 megs boot partition (/dev/sda1) and left the rest for the LVM (/dev/sda2)
- By the way, two other disks (/dev/sdc and /dev/sdd) were one-partition and completely to the power of LVM (so, /dev/sdc1 and /dev/sdc2), whereas another one had the 1G swap (/dev/sdb1), old boot (/dev/sdb2) and one more PV for LVM (/dev/sdb3). So LVM had /dev/sdb3, /dev/sdc1, /dev/sdd1
- Now, mkfs.ext3 the boot partition, mount it, copy the old boot, umount old boot (I remember something like logd or the like was using it: simply shut down the daemon), mount new boot in its place.
- Dear Mr. Grub, which fucked me. REMEMBER to change all the “root” referrings in /boot/grub/menu.lst to reflect the position of the new boot partition. My old value was (hd1,1) because it was /dev/sdb2, but now, with /dev/sda1, everything becaom (hd0,0). Now, you can run grub-install /dev/sda (first disk of the system, bet it is always the best MBR) and grub update the MBR so to point to the new /boot position (in fact it queries the system to look in which device /boot is mounted and work accordingly).
- Add the old /boot and new spare space in the disk to LVM (that is: make /dev/sda2 and /dev/sdb2 useable with pvcreate, then add them to the VG with vgextend, and at last increase the LV which you prefer with physical extents using lvresize - don’t bet on my memory being so good, check this). Now your LV is bigger, and run: xfs_growfs /. This will enlarge in a moment and painlessly your root partition.
- If you did everything good, you should be already ok. Try reboot to check. Now, in my case it stopped because I forgot the menu.lst update (me stupid), but otherwise everything should work correctly. Again, reboot isn’t strictly necessary, it’s just to check everything’s right now (and it is much better than noticing it when some REAL problem force you to reboot)
So, here’s the end, and after that I could update to Feisty with its funny I-do-it-all-myself update manager. End of the Dilbertian Space.
Posted by mattia as boot, lvm, xfs at 10:30 PM CEST
No Comments »