linux:scribble
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
linux:scribble [2017/05/16 13:34] – add tricks for Jenkins stybla | linux:scribble [2021/07/01 07:42] – add Move LVM on LUKS to new HDD stybla | ||
---|---|---|---|
Line 110: | Line 110: | ||
data[1] = number >> 0; | data[1] = number >> 0; | ||
</ | </ | ||
+ | |||
+ | ===== Exercises ====== | ||
+ | |||
+ | [[https:// | ||
Line 269: | Line 273: | ||
multilibs from time to time), so that might be the issue behind error above. But libvirt | multilibs from time to time), so that might be the issue behind error above. But libvirt | ||
is long gone, replaced and forgotten now. | is long gone, replaced and forgotten now. | ||
+ | |||
+ | ===== Move LVM on LUKS to new HDD ===== | ||
+ | |||
+ | Unfortunately, | ||
+ | |||
+ | > Ideally, you initialize the new LUKS partition as a LVM PV, add it to your volume group with: | ||
+ | |||
+ | < | ||
+ | |||
+ | > Then use the LVM pvmove command to migrate your data to it like so: | ||
+ | |||
+ | < | ||
+ | |||
+ | > When the data migration is done, be sure to remove the old LUKS partition from the volume group with: | ||
+ | |||
+ | < | ||
+ | |||
+ | > This can all be done with the system online, although it is marginally safer and probably significantly faster to do it from a LiveCD like SystemRescueCD. Also, if you have a new enough version of LVM, you probably want to use the --atomic option for pvmove, that will ensure that you don't end up with some LV's on the new device and some on the old device if the pvmove command fails. | ||
+ | |||
+ | I wish I've documented all the steps I took to move LUKS between HDDs since it might come handy. Also, it's not the first time I did that. Damn! | ||
===== loop-AES ===== | ===== loop-AES ===== | ||
Line 301: | Line 325: | ||
Funny thing is, it seems much harder to resize encrypted partition via cryptsetup/ | Funny thing is, it seems much harder to resize encrypted partition via cryptsetup/ | ||
+ | |||
+ | ===== MySQL ===== | ||
+ | |||
+ | ==== Convert database to UTF-8 encoding ==== | ||
+ | |||
+ | Originally found at [[https:// | ||
+ | |||
+ | Run mysql and check the encoding: | ||
+ | |||
+ | < | ||
+ | SELECT default_character_set_name FROM information_schema.SCHEMATA S WHERE schema_name = " | ||
+ | SELECT CCSA.character_set_name FROM information_schema.`TABLES` T, | ||
+ | </ | ||
+ | |||
+ | Change encoding of tables: | ||
+ | |||
+ | < | ||
+ | cat > ~/.my.cnf <<EOF | ||
+ | [client] | ||
+ | user=USER | ||
+ | password=PASSWORD | ||
+ | EOF | ||
+ | mysql --database=DBNAME -B -N -e "SHOW TABLES" | ||
+ | </ | ||
+ | |||
+ | Change encoding of DB itself: | ||
+ | < | ||
+ | ALTER DATABASE DBNAME CHARACTER SET utf8 COLLATE utf8_general_ci; | ||
+ | </ | ||
+ | |||
+ | Remove '' | ||
+ | |||
===== OpenOffice/ | ===== OpenOffice/ |
linux/scribble.txt · Last modified: 2022/07/06 17:27 by stybla