This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
admin:procedures [2019/07/05 15:36] peppe [Table] |
admin:procedures [2022/11/09 09:45] (current) peppe |
||
---|---|---|---|
Line 10: | Line 10: | ||
=== uranus === | === uranus === | ||
# accmake.sh < | # accmake.sh < | ||
+ | Δημιουργία e-mail .forward για προπτυχιακούς 2019-20 και μετά. | ||
=== gaia === | === gaia === | ||
Line 15: | Line 16: | ||
# newaliases | # newaliases | ||
# setstats_student.sh < | # setstats_student.sh < | ||
+ | # webmail_welcome.sh < | ||
=== titan-new (10.7.4.44) === | === titan-new (10.7.4.44) === | ||
Line 41: | Line 43: | ||
---- | ---- | ||
+ | ==== Τροποποίηση ==== | ||
+ | |||
+ | === uranus === | ||
+ | # user home rename | ||
+ | # emailforward-single.sh < | ||
+ | |||
+ | === gaia === | ||
+ | # vi / | ||
+ | # newaliases | ||
+ | # mv / | ||
+ | # forward_mbox.sh < | ||
+ | |||
+ | === titan-new (10.7.4.44) === | ||
+ | # pkusers --delete < | ||
+ | # ./ | ||
+ | |||
+ | === scylla === | ||
+ | # cd /var/yp | ||
+ | # vi master.passwd (μετονομασία χρήστη/ | ||
+ | # make | ||
+ | |||
+ | ---- | ||
+ | ==== Μαζική δημιουργία ==== | ||
+ | |||
+ | === e-mail forwarding @uoi.gr === | ||
+ | Τοποθέτηση readonly .forward σε κάθε λογαριασμό με προώθηση στο cs{0x5AM}@uoi.gr | ||
+ | |||
+ | for acc in cse9[0-9]*; do echo " | ||
+ | |||
+ | ---- | ||
==== Αντίγραφο ασφαλείας ==== | ==== Αντίγραφο ασφαλείας ==== | ||
Line 53: | Line 85: | ||
+ | ---- | ||
==== Πρόβλημα "error in service module" | ==== Πρόβλημα "error in service module" | ||
# sh / | # sh / | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Λογαριασμοί μεταπτυχιακών ==== | ||
+ | |||
+ | Για μεταγραφή σε λατινικούς χαρακτήρες: | ||
+ | [[http:// | ||
+ | |||
+ | Αποθήκευση της λίστας σε αρχείο names.txt\\ | ||
+ | Για παραγωγή usernames: | ||
+ | $ awk ' | ||
+ | |||
+ | Παραγωγή αποκόμματος master.passwd.\\ | ||
+ | uid = πρώτο User ID που θα χρησιμοποιηθεί\\ | ||
+ | 20210922 = ημερομηνία\\ | ||
+ | 21 = ακαδημαϊκό έτος εισαγωγής (π.χ. 21 σημαίνει 2021-22)\\ | ||
+ | $ awk -F' | ||
+ | |||
+ | Εισαγωγή σε scylla:/ | ||
+ | \\ | ||
+ | Δημιουργία homedirs, uranus: | ||
+ | # awk ' | ||
+ | Δημιουργία λίστας για gaia:/ | ||
+ | $ awk ' | ||
+ | Δημιουργία εντολής για e-mail quotas (copy & paste σε gaia): | ||
+ | $ awk ' | ||
+ | Δημιουργία εντολής για print quotas (copy & paste σε titan-new): | ||
+ | $ awk ' | ||
Line 133: | Line 193: | ||
- | ===== HP StorageWorks MSL2024 Tape Library ===== | + | ===== DRBL - clonezilla server |
- | + | ||
- | LTO 3 drive, 400/ | + | |
- | 24 tapes changer | + | |
- | + | ||
- | ==== Reset admin password ==== | + | |
- | + | ||
- | Default service password: 42311324 | + | |
- | + | ||
- | new pass: 00000000 | + | |
- | + | ||
- | ==== List SCSI devices ==== | + | |
- | + | ||
- | # lsscsi | + | |
- | [0: | + | |
- | [2: | + | |
- | [3: | + | |
- | [4: | + | |
- | [5: | + | |
- | [7: | + | |
- | [7: | + | |
- | + | ||
- | ==== Commands | + | |
- | + | ||
- | tape drive control via mt | + | |
- | tape changer control via mtx | + | |
- | + | ||
- | load tape | + | |
- | # mtx -f /dev/sg2 load <tape #> | + | |
- | + | ||
- | unload tape (to previous slot) | + | |
- | # mtx -f /dev/sg2 unload | + | |
- | + | ||
- | check inventory | + | |
- | # mtx -f /dev/sg2 status | + | |
- | + | ||
- | rewind tape | + | |
- | # mt -f /dev/nst0 rewind | + | |
- | + | ||
- | dump/ | + | |
- | mtx uses raw SCSI device /dev/sg2 | + | |
- | + | ||
- | write from local file | + | |
- | # dd if=root.fs of=/ | + | |
- | + | ||
- | ==== Media usage ==== | + | |
- | {{tablelayout? | + | |
- | ^ Tape # ^ Media loads ^ | + | |
- | | 1 | | | + | |
- | | 2 | | | + | |
- | | 3 | | | + | |
- | | 4 | | | + | |
- | | 5 | | | + | |
- | | 6 | | | + | |
- | | 7 | | | + | |
- | | 8 | | | + | |
- | | 9 | 116 | | + | |
- | | 10 | 102 | | + | |
- | | 11 | 72 | | + | |
- | | 12 | | | + | |
- | | 13 | | | + | |
- | | 14 | | | + | |
- | | 15 | | | + | |
- | | 16 | | | + | |
- | | 17 | | | + | |
- | | 18 | | | + | |
- | | 19 | | | + | |
- | | 20 | | | + | |
- | | 21 | | | + | |
- | | 22 | | | + | |
- | | 23 | | | + | |
- | | 24 | Cleaning | + | |
- | + | ||
- | ==== Variable block size ==== | + | |
- | + | ||
- | [[https:// | + | |
- | + | ||
- | Ok, I think I've worked this out. | + | |
- | TL;DR | + | |
- | + | ||
- | Use dd with a large block size to read from the tape instead: | + | |
- | + | ||
- | dd if=/ | + | |
- | + | ||
- | Background | + | |
- | + | ||
- | When you write to tapes, the data is written in units called blocks. These are like sectors on a hard disk. Where hard disk blocks were fixed at 512-bytes for many years and only recently moved to 4096-byte blocks, tape blocks can be set to any size you like. | + | |
- | + | ||
- | The block size you wish to use is set with the setblk subcommand in mt-st: | + | |
- | + | ||
- | mt-st -f /dev/nst0 setblk 512 # Use 512-byte blocks | + | |
- | mt-st -f /dev/nst0 setblk 64k # Use 65536-byte blocks | + | |
- | + | ||
- | When you issue a read operation to the drive, it will return data in block-sized chunks. You can't read half a block - the smallest amount of data you can read from a tape is one block, which of course could be any number of actual bytes depending on what the block size is. | + | |
- | + | ||
- | This means if the program you are using supplies a 16kB memory buffer, you will be able to read up to 32 blocks at a time from the tape with 512-byte blocks as these fit exactly in the 16kB buffer. However you will not be able to read anything from the tape with 64kB blocks, because you can't fit even one of them into the 16kB buffer, and remember you can't read anything less than one whole block at a time. | + | |
- | + | ||
- | Should you attempt to do this, by using a buffer that's too small for one block, the driver (in this case the st SCSI tape driver) will return a memory allocation error code to advise you that your read buffer is too small to hold even a single block. | + | |
- | To further complicate matters, some tape drives (apparently the LTO ones I am using) also support variable-sized blocks. This means the block size is determined by the size of each write operation and each block can be a different size to the last. | + | Προσθήκη νέου μηχανήματος |
- | This mode is set with a block size of zero: | + | ==== drbl ==== |
- | mt-st -f /dev/nst0 setblk 0 | + | Add details in /etc/dhcp/ |
+ | | ||
- | This is also the default option as - presumably, I am guessing here - it wastes less space with an incorrectly configured program. If, for example, you had set 4k blocks but your program only wrote data in units of 512 bytes at a time, there is a risk that each 512-byte chunk of data would take up 4k on the tape. | + | run / |
- | Cause | + | |
- | If you now put everything together, you will realise that a tape can hypothetically have a 512-byte block followed by a 64kB block. If the program is reading the tape with a 16kB buffer, it will successfully read the first block, but then when it tries to read more, it won't be able to fit the following 64kB block in its buffer so the driver will return an error. | + | boot pass: pxelinux |
- | This explains why I was getting Cannot allocate memory errors most of the time, and occasionally I was able to get tar to extract the first few files but then I got the error again. I had not set the block size with mt-st so it had defaulted to variable-sized blocks when the tape was written, and now tar was using too small a buffer to read in some of those blocks. | + | ==== dcs ==== |
- | tar has a couple of options for setting its own internal block sizes, namely --blocking-factor, | + | Change system functionality. Examples in ~/bin |
- | Because I wrote to the tape through the mbuffer program to reduce tape shoe-shining, the block size in the tar archive no longer matched the block size on the tape. This meant --blocking-factor had little effect | + | unicast: |
- | Solution | + | drbl-ocs -b -g auto -e1 auto -e2 -x -r -icds -j2 -p reboot -l en_US.UTF-8 startdisk restore ubuntu22.04-hp705ws01-2022-09-28-07-img sda |
- | The solution is to use another program to read from the tape - one that can have the read buffer size set to a value large enough to hold the biggest block we are likely to see. | + | multicast: |
+ | drbl-ocs -b -g auto -e1 auto -e2 -x -r -icds -j2 -p reboot --clients-to-wait 13 --max-time-to-wait 300 -l en_US.UTF-8 startdisk multicast_restore ubuntu1804LTS-golden-2020-02-11-08-img sda | ||
+ | |||
+ | ===== Labs installation ===== | ||
- | dd works for this, and in a pinch this works: | + | ==== Convert boot from UEFI to legacy (Για ubuntu 18.04 LTS μόνο) ==== |
- | dd if=/dev/nst0 bs=256k | tar tvf - | + | - Boot ubuntu live USB\\ |
+ | - Change flag of EFI partition to bios_grub (gparted -> /dev/sda1 -> manage flags -> bios_grub)\\ | ||
+ | # mount /dev/sda2 /mnt | ||
+ | remove EFI entry: | ||
+ | # vi / | ||
- | You may need to increase 256k if your tape has larger blocks on it, but this worked for me. 1M also works fine so it doesn' | + | # mount -o bind /proc /mnt/proc |
+ | # mount -o bind /dev /mnt/dev | ||
+ | # mount -o bind /sys /mnt/sys | ||
+ | # chroot /mnt | ||
+ | # grub-install /dev/sda | ||