when working with yaml files, indentation is crucial. You can setup vim to make it a little easier, like this:
:set ai ts=2 sw=2 expandtab
The above will set tabstop and shiftwidth to 2 spaces, and make the tab key create spaces instead of tabs. So with this config, you will type 2 spaces, whenever you press tab, just like yaml likes it.
So, you are trying to update your system and get this:
Requesting to save current system state ERROR couldn’t save system state: Minimum free space to take a snapshot and preserve ZFS performance is 20%. Free space on pool “bpool” is xx%
The zfs filesystem is creating a snapshot every time you install a new kernel, this will add up, and suddenly you are not able to update anymore, and you are seeing a lot of error caused by this. If you are unlucky and reboot, it might even brake your system!
Running Ubuntu with zfs will create a pool called bpool as your /boot device. Continuing I will refer to this as bpool.
To get an overview of your zfs pools, use this command: zfspool list
kasper@AsusPro:~$ zpool list NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT bpool 1.88G 1.64G 238M – – 32% 87% 1.00x ONLINE – rpool 114G 26.3G 87.7G – – 7% 23% 1.00x ONLINE–
As you see, my bpool pool is 87% filled up, I have a problem.
To get an overview of snapshots in the bpool pool, use this command: zfs list -t snapshot | grep bpool
Seems like zfs is not doing any housecleaning by itself, we need to help! To remove a snapshot, we need to destroy it. This is done with the destroy option, like this:
sudo zfs destroy /path/to/snapshot
To remove all snashots in the bpool, you can use the following:
for i in $(zfs list -t snapshot | grep bpool | cut -d ” ” -f 1);do sudo zfs destroy $i; done
This will destroy all snapshots and free up your bpool pool.
If you don’t want to remove all snapshots, pipe your snapshots listing into tail or head. You can add a creation column to the list like this:
zfs list -t snapshot -o name,creation -s creation
This will list your snapshots in order of creation date. Use wc -l to count them and use head to get x amount fewer.
zfs list -t snapshot -o name,creation -s creation | wc -l 20 for i in $(zfs list -t snapshot | grep bpool | cut -d ” ” -f 1 | head -15);do sudo zfs destroy $i; done
I did try to format the commands, but as usual Word Press make things so complicated to use, that i had to revert all the special formatting, instead of spending the entire day figuring out why html tags are not respected in “enlighter inline code”
Adding storage to servers is part of every day work. this can be anything from a virtual disk on a virtual machine, to LUN’s presented from some external storage system.
When the new disk has been added, ususally nothing happens. You need to scan for the new disk/disks in order to operate them. Theres a tool called rescan-scsi-bus.sh for doing this specific task, but sometimes you don’t have that, then you need to do it manually, and it’s actually not that difficult.
You then need to echo “- – -” to the scsi system. I have found a lot of different methods to do the same thing, a lot of them telling you to do something like: echo “- – -” >> /sys/class/scsi_host/hostxx/scan where xx can be anything, and sometimes there’s a lot, so typing all the different host numbers is not optimal. Then someone suggests a for loop, like: for i in $(/sys/class/scsi_host/hosts); do echo “- – -” /sys/class/scsi_host/host$i/scan; done
I have tried them all (I think) but in my opinion, the best and easiest solution is the one below, as it is pretty easy to remember:
echo "- - -" | sudo tee /sys/class/scsi_host/host*/scan
List your newly installed disk with lsblk and partition them with fdisk
Using Windows subsystem for Linux (WSL) is so nice, when you are forced to work from an inferior OS, sometimes also referred to as “a gaming console” Especially combined with the Windows Terminal, which I wrote about here: https://www.nordal-lund.dk/?p=592 I’m sure that most Linux/Unix administrators will feel right at home.
Despite all the goodness, there are some minor annoyances preventing me from experiencing a big burst of happiness. One of them are the inability to use ping on a std. WSL Debian as a non-root user. That’s right, you need to do “sudo ping nice.little.address” or you will be denied 🙁
The root cause is the ping utility missing the SUID bit, which it has on the real distro. Luckily there’s an easy fix, add the SUID bit to the ping utility:
Yesterday I had to upgrade a VCSA 6.5 U1b to U2e, but I got stuck in the process because the VCSA manager said this:
Latest updates already installed on vCSA, Nothing to stage/install
Hmm, thats not right… google, google, google Seems that vmware changed the build numbering scheme, and they have an article about my issue: https://kb.vmware.com/s/article/59659 Unfortunately the link to the attachement was dead 🙁 I had to create a case with vmware support to get the shell script. So, to prevent this from happening again, heres the four lines thats in the script:
I have a Raspberry Pi that I’m using in different environments. The easiest way to use the Pi is by just connecting power and network and use SSH, but when theres no screen, it’s not always easy to know the IP address of my Pi.
To make life easier for myself i have put the following lines in a start.sh script and added it to my crontab with the @reboot option. This will make crontab run this script every time the Pi has been rebooted (or shut down)
#!/bin/sh
sleep 30
echo “My IP is: $(ip addr | grep global | awk -F ‘ ‘ ‘{print $2}’)” | mail -s “Raspi reporting in…” someone@somewhere.org
The script will put in a 30 seconds delay to allow the Pi to pickup an address and then mail it for my mail address. Remember to make sure that your Pi is able to send mails, otherwise this will not work.
This will most likely ensure that i will get a mail with the IP address of my Pi, and I am ready to login with SSH.
Want to know which ports are allowed (or open) to use in your organization?
You can check all ports with http://portquiz.net/
In bash somthing like this would help you get going:
for i in `seq 1024 65535`; do if nc -z portquiz.net $i; then echo “Port $i Success”; :; fi done
You will now get a fine list of outgoing ports that are open. Remember that just because some port is open, it doesn’t necessarily mean that it is allowed to use it!
Jeg havde et par ældre ubuntu 7.10 servere, der nu er EOL (End Of Life). Det opdager man ved at den ikke kan finde sit repository når man forsøger at lave en apt-get update, eller det var ihvertfald den måde jeg opdagede det på.
Heldigvis kan man (selvom distributionen er udløbet) få lov at køre en “do-release-upgrade”. Begge mine maskiner hvade dette program installeret i forvejen, jeg kan forestille mig at man ender ud i et godt gammeldags “dependency hell” hvis man skal til at installere manuelt, man kan jo ikke nå sit repository!
Nå, men den ene maskine kørte problemfrit igennem og alt var fryd og gammen. den opgraderer til 8.04LTS som først udløber i 2013 hvis man har server versionen https://wiki.ubuntu.com/Releases så har man da lidt tid at løbe på 🙂
Men det var jo kun den ene, den anden var lidt mere genstridig. Når man kører kommandoen bliver man efter et stykke tid spurgt om man vil fortsætte, eller se detaljer for hvilke pakker der opgraderes, udskiftes og slettes, man skal trykke [yN] for yes eller no eller [d] for detaljer.
Jeg trykker selvfølgelig y da jeg vil fortsætte, men der sker intet, jeg trykker så “n” og den afbryder, jeg starter forfra og det samme gentager sig? Jeg prøver at trykke “d” den viser detaljerne? Hvad sker der, jeg banker hårdt i alle taster og får ramt “j”. Ahr den kører med dansk sprog og der skal trykkes “j” for ja selvom den skriver y. Nu kører den det hele igennem som det skal og begge mine systemer er opdaterede til 8.04 LTS.