MySql -u root -p
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPass');
Tuesday, 16 June 2015
Monday, 15 June 2015
How to use Screen. A tool to keep stuff running from a terminal
Screen:
Ctrl + A + C (Creates new screen windows)
Ctrl + A + N (next screen windows)
Ctrl + A + N (previous screen windows)
Ctrl + A + D (Drops you in to your shell, the screen windows can be re-attached later)
Screen -ls (Shows your screen windows)
Screen -r session name (Re-attach's your screen windows)
Screen Command Task's
Ctrl+a c Create new window
Ctrl+a k Kill the current window / session
Ctrl+a w List all windows
Ctrl+a 0-9 Go to a window numbered 0 9, use Ctrl+a w to see number
Ctrl+a Ctrl+a Toggle / switch between the current and previous window
Ctrl+a S Split terminal horizontally into regions and press Ctrl+a c to create new window there
Ctrl+a :resize Resize region
Ctrl+a :fit Fit screen size to new terminal size. You can also hit Ctrl+a F for the the same task
Ctrl+a :remove Remove / delete region. You can also hit Ctrl+a X for the same taks
Ctrl+a tab Move to next region
Ctrl+a D (Shift-d) Power detach and logout
Ctrl+a d Detach but keep shell window open
Ctrl-a Ctrl-\ Quit screen
Ctrl-a ? Display help screen i.e. display a list of commands
Ctrl + A + C (Creates new screen windows)
Ctrl + A + N (next screen windows)
Ctrl + A + N (previous screen windows)
Ctrl + A + D (Drops you in to your shell, the screen windows can be re-attached later)
Screen -ls (Shows your screen windows)
Screen -r session name (Re-attach's your screen windows)
Screen Command Task's
Ctrl+a c Create new window
Ctrl+a k Kill the current window / session
Ctrl+a w List all windows
Ctrl+a 0-9 Go to a window numbered 0 9, use Ctrl+a w to see number
Ctrl+a Ctrl+a Toggle / switch between the current and previous window
Ctrl+a S Split terminal horizontally into regions and press Ctrl+a c to create new window there
Ctrl+a :resize Resize region
Ctrl+a :fit Fit screen size to new terminal size. You can also hit Ctrl+a F for the the same task
Ctrl+a :remove Remove / delete region. You can also hit Ctrl+a X for the same taks
Ctrl+a tab Move to next region
Ctrl+a D (Shift-d) Power detach and logout
Ctrl+a d Detach but keep shell window open
Ctrl-a Ctrl-\ Quit screen
Ctrl-a ? Display help screen i.e. display a list of commands
How to remove encryption from a ZFS volume "while keeping the data"
This guide describes how to remove ZFS encryption with out loosing data.
I successfully removed the geli encryption from a live ZFS pool in FreeNAS 9.1.1 with the following steps:
0. Make sure you either have a separate backup of your data, or are willing to take the risk of losing everything. Second, please do not blindly follow these instructions if you do not know what you are doing. Third, the procedure works on one disk at a time. So if you run a RAIDZ2, you should be sufficiently safe. I would not dare to do this with data I need on a RAID1 or mirror. Nuff said ... let's start.
1. Scrub your pool to make sure all disks are in good condition.
2. Get the IDs of your zpool's devices:
[root@freenas-pmh] ~# zpool status
pool: zfs
state: ONLINE
config:
NAME STATE READ WRITE CKSUM
zfs ONLINE 0 0 0
raidz2-0 ONLINE 0 0 0
gptid/b4a21304-8ec4-11e2-a224-28924a2bff32.eli ONLINE 0 0 0
gptid/b4f40dbd-8ec4-11e2-a224-28924a2bff32.eli ONLINE 0 0 0
gptid/b5527faa-8ec4-11e2-a224-28924a2bff32.eli ONLINE 0 0 0
gptid/b5ae2aed-8ec4-11e2-a224-28924a2bff32.eli ONLINE 0 0 0
errors: No known data errors
3. Start with the first disk - take offline and remove geli:
[root@freenas-pmh] ~# zpool offline zfs gptid/b5ae2aed-8ec4-11e2-a224-28924a2bff32.eli
[root@freenas-pmh] ~# geli detach gptid/b5ae2aed-8ec4-11e2-a224-28924a2bff32.eli
[root@freenas-pmh] ~# zpool status
pool: zfs
state: DEGRADED
status: One or more devices has been taken offline by the administrator.
Sufficient replicas exist for the pool to continue functioning in a
degraded state.
action: Online the device using 'zpool online' or replace the device with
'zpool replace'.
config:
NAME STATE READ WRITE CKSUM
zfs DEGRADED 0 0 0
raidz2-0 DEGRADED 0 0 0
gptid/b4a21304-8ec4-11e2-a224-28924a2bff32.eli ONLINE 0 0 0
gptid/b4f40dbd-8ec4-11e2-a224-28924a2bff32.eli ONLINE 0 0 0
gptid/b5527faa-8ec4-11e2-a224-28924a2bff32.eli ONLINE 0 0 0
5939868321408276145 OFFLINE 0 0 0 was /dev/gptid/b5ae2aed-8ec4-11e2-a224-28924a2bff32.eli
errors: No known data errors
4. Replace formerly encrypted device with unencrypted one:
[root@freenas-pmh] ~# zpool replace zfs 5939868321408276145 gptid/b5ae2aed-8ec4-11e2-a224-28924a2bff32
[root@freenas-pmh] ~# zpool status
...
replacing-3 OFFLINE 0 0 0
5939868321408276145 OFFLINE 0 0 0 was /dev/gptid/b5ae2aed-8ec4-11e2-a224-28924a2bff32.eli
gptid/b5ae2aed-8ec4-11e2-a224-28924a2bff32 ONLINE 0 0 0 (resilvering)
5. Remove information about encryption from FreeNAS' config database
I'm not quite sure if this is strictly necessary. I did it, and it definitely did not hurt. FreeNAS keeps track of which devices are encrypted. So I wanted to make sure it treats the disks correctly.
[root@freenas-pmh] ~# /usr/local/bin/sqlite3 /data/freenas-v1.db "delete from storage_encrypteddisk where encrypted_provider = 'gptid/b5ae2aed-8ec4-11e2-a224-28924a2bff32';"
6. Wait for the resilvering to finish
7. Repeat 2. - 6. for each remaining disk. In the end your pool should look like this:
[root@freenas-pmh] ~# zpool status
pool: zfs
state: ONLINE
...
config:
NAME STATE READ WRITE CKSUM
zfs ONLINE 0 0 0
raidz2-0 ONLINE 0 0 0
gptid/b4a21304-8ec4-11e2-a224-28924a2bff32 ONLINE 0 0 0
gptid/b4f40dbd-8ec4-11e2-a224-28924a2bff32 ONLINE 0 0 0
gptid/b5527faa-8ec4-11e2-a224-28924a2bff32 ONLINE 0 0 0
gptid/b5ae2aed-8ec4-11e2-a224-28924a2bff32 ONLINE 0 0 0
errors: No known data errors
Note the absence of ".eli" from the device IDs. Check, if there are any entries left in the config database for encrypted disks:
[root@freenas-pmh] ~# /usr/local/bin/sqlite3 /data/freenas-v1.db "select * from storage_encrypteddisk;"
8. Stop all sharing services depending on the ZFS volume
9. Detach volume from the GUI - double check not to mark disks as new (i.e. erase them)
10. Reboot
11. Auto-import volume, restart sharing services
12. Done
I successfully removed the geli encryption from a live ZFS pool in FreeNAS 9.1.1 with the following steps:
0. Make sure you either have a separate backup of your data, or are willing to take the risk of losing everything. Second, please do not blindly follow these instructions if you do not know what you are doing. Third, the procedure works on one disk at a time. So if you run a RAIDZ2, you should be sufficiently safe. I would not dare to do this with data I need on a RAID1 or mirror. Nuff said ... let's start.
1. Scrub your pool to make sure all disks are in good condition.
2. Get the IDs of your zpool's devices:
[root@freenas-pmh] ~# zpool status
pool: zfs
state: ONLINE
config:
NAME STATE READ WRITE CKSUM
zfs ONLINE 0 0 0
raidz2-0 ONLINE 0 0 0
gptid/b4a21304-8ec4-11e2-a224-28924a2bff32.eli ONLINE 0 0 0
gptid/b4f40dbd-8ec4-11e2-a224-28924a2bff32.eli ONLINE 0 0 0
gptid/b5527faa-8ec4-11e2-a224-28924a2bff32.eli ONLINE 0 0 0
gptid/b5ae2aed-8ec4-11e2-a224-28924a2bff32.eli ONLINE 0 0 0
errors: No known data errors
3. Start with the first disk - take offline and remove geli:
[root@freenas-pmh] ~# zpool offline zfs gptid/b5ae2aed-8ec4-11e2-a224-28924a2bff32.eli
[root@freenas-pmh] ~# geli detach gptid/b5ae2aed-8ec4-11e2-a224-28924a2bff32.eli
[root@freenas-pmh] ~# zpool status
pool: zfs
state: DEGRADED
status: One or more devices has been taken offline by the administrator.
Sufficient replicas exist for the pool to continue functioning in a
degraded state.
action: Online the device using 'zpool online' or replace the device with
'zpool replace'.
config:
NAME STATE READ WRITE CKSUM
zfs DEGRADED 0 0 0
raidz2-0 DEGRADED 0 0 0
gptid/b4a21304-8ec4-11e2-a224-28924a2bff32.eli ONLINE 0 0 0
gptid/b4f40dbd-8ec4-11e2-a224-28924a2bff32.eli ONLINE 0 0 0
gptid/b5527faa-8ec4-11e2-a224-28924a2bff32.eli ONLINE 0 0 0
5939868321408276145 OFFLINE 0 0 0 was /dev/gptid/b5ae2aed-8ec4-11e2-a224-28924a2bff32.eli
errors: No known data errors
4. Replace formerly encrypted device with unencrypted one:
[root@freenas-pmh] ~# zpool replace zfs 5939868321408276145 gptid/b5ae2aed-8ec4-11e2-a224-28924a2bff32
[root@freenas-pmh] ~# zpool status
...
replacing-3 OFFLINE 0 0 0
5939868321408276145 OFFLINE 0 0 0 was /dev/gptid/b5ae2aed-8ec4-11e2-a224-28924a2bff32.eli
gptid/b5ae2aed-8ec4-11e2-a224-28924a2bff32 ONLINE 0 0 0 (resilvering)
5. Remove information about encryption from FreeNAS' config database
I'm not quite sure if this is strictly necessary. I did it, and it definitely did not hurt. FreeNAS keeps track of which devices are encrypted. So I wanted to make sure it treats the disks correctly.
[root@freenas-pmh] ~# /usr/local/bin/sqlite3 /data/freenas-v1.db "delete from storage_encrypteddisk where encrypted_provider = 'gptid/b5ae2aed-8ec4-11e2-a224-28924a2bff32';"
6. Wait for the resilvering to finish
7. Repeat 2. - 6. for each remaining disk. In the end your pool should look like this:
[root@freenas-pmh] ~# zpool status
pool: zfs
state: ONLINE
...
config:
NAME STATE READ WRITE CKSUM
zfs ONLINE 0 0 0
raidz2-0 ONLINE 0 0 0
gptid/b4a21304-8ec4-11e2-a224-28924a2bff32 ONLINE 0 0 0
gptid/b4f40dbd-8ec4-11e2-a224-28924a2bff32 ONLINE 0 0 0
gptid/b5527faa-8ec4-11e2-a224-28924a2bff32 ONLINE 0 0 0
gptid/b5ae2aed-8ec4-11e2-a224-28924a2bff32 ONLINE 0 0 0
errors: No known data errors
Note the absence of ".eli" from the device IDs. Check, if there are any entries left in the config database for encrypted disks:
[root@freenas-pmh] ~# /usr/local/bin/sqlite3 /data/freenas-v1.db "select * from storage_encrypteddisk;"
8. Stop all sharing services depending on the ZFS volume
9. Detach volume from the GUI - double check not to mark disks as new (i.e. erase them)
10. Reboot
11. Auto-import volume, restart sharing services
12. Done
How to use FreeBSD as a desktop operating system with GUI
IX Systems have made a version of FreeBSD called PcBSD and can be found here:
http://www.pcbsd.org/
How to upgrade from PKG to Pkg2NG
Run the following command as root
"pkg upgrade"
When done run "pkg2ng"
If you want to be sure that it is updated, then you can run the following command to check:
cat /etc/make.conf
Then you can update your ports
portsnap fetch extract
To keep ports updated
portsnap update
Thats it your done.!
"pkg upgrade"
When done run "pkg2ng"
If you want to be sure that it is updated, then you can run the following command to check:
cat /etc/make.conf
Then you can update your ports
portsnap fetch extract
To keep ports updated
portsnap update
Thats it your done.!
Subscribe to:
Posts (Atom)