Wednesday 12 October 2016

profile-sync-daemon on Fedora 24

Background

PSD is designed to manage browser profile(s) in tmpfs and to periodically sync back to the physical disc, thereby reducing writes to SSDs. This is useful where there is ample spare RAM on the system.

Installing profile-sync-daemon

profile-sync-daemon was not available in Fedora repositories at the time. To build and install it

Download the source from https://github.com/graysky2/profile-sync-daemon

[mochapenguin@dv6tqe psd]su -
[root@dv6tqe psd]# git clone https://github.com/graysky2/profile-sync-daemon.git
[root@dv6tqe psd]# cd profile-sync-daemon/
[root@dv6tqe profile-sync-daemon]# make
Setting version
[root@dv6tqe profile-sync-daemon]# make install
Installing main script...
install -p -d "/usr/bin"
install -p -m755 common/profile-sync-daemon "/usr/bin/profile-sync-daemon"
install -p -m755 common/psd-overlay-helper "/usr/bin/psd-overlay-helper"
ln -s profile-sync-daemon "/usr/bin/psd"
install -p -d "/usr/share/zsh/site-functions"
install -p -m644 common/zsh-completion "//usr/share/zsh/site-functions/_psd"
install -p -d "/usr/share/psd/browsers"
install -p -m644 common/psd.conf "/usr/share/psd/psd.conf"
cp common/browsers/* "/usr/share/psd/browsers"
Installing manpage...
install -p -d "/usr/share/man/man1"
install -p -m644 doc/psd.1 "/usr/share/man/man1/psd.1"
install -p -m644 doc/psd-overlay-helper.1 "/usr/share/man/man1/psd-overlay-helper.1"
gzip -9 "/usr/share/man/man1/psd.1"
gzip -9 "/usr/share/man/man1/psd-overlay-helper.1"
ln -s psd.1.gz "/usr/share/man/man1/profile-sync-daemon.1.gz"
Installing systemd files...
install -p -d "/usr/lib/systemd/user"
install -p -m644 init/psd.service "/usr/lib/systemd/user/psd.service"
install -p -m644 init/psd-resync.service "/usr/lib/systemd/user/psd-resync.service"
install -p -m644 init/psd-resync.timer "/usr/lib/systemd/user/psd-resync.timer"    
    

First run

When profile-sync-daemon is run for the first time, it outputs the following:

[mochapenguin@dv6tqe ~]$ psd p
First time running psd so please edit /home/mochapenguin/.config/psd/psd.conf to your liking and run again.

[mochapenguin@dv6tqe ~]$ psd p
Profile-sync-daemon v6.25 on Fedora 24 (Workstation Edition)

 Systemd service is currently active.
 Systemd resync-timer is currently active.
 Overlayfs v23 is currently active.

Psd will manage the following per /home/mochapenguin/.config/psd/psd.conf:

 browser/psname:  firefox/firefox
 owner/group id:  mochapenguin/1000
 sync target:     /home/mochapenguin/.mozilla/firefox/fu8u7xk0.default
 tmpfs dir:       /run/user/1000/mochapenguin-firefox-fu8u7xk0.default
 profile size:    14M
 overlayfs size:  
 recovery dirs:   none

 browser/psname:  google-chrome/chrome
 owner/group id:  mochapenguin/1000
 sync target:     /home/mochapenguin/.config/google-chrome
 tmpfs dir:       /run/user/1000/mochapenguin-google-chrome
 profile size:    5.8M
 overlayfs size:  
 recovery dirs:   none

Usage

More information on profile-sync-daemon usage can be found on Arch Linux Profile Sync Daemon page

Sunday 11 September 2016

Fedora 24 on HP dv6tqe

Power saving

See my posts on power management:



Power Management with Fedora 24 - Preparation

I dabbled with Power Management on my HP dv6tqe laptop. Here's what I have been learning.

Preparing to monitor. Install the required monitors/sensors.

Install lm_sensors

lm_sensors installation

[mochapenguin@dv6tqe ~]$ sudo dnf install lm_sensors
Last metadata expiration check: 2:27:57 ago on Sun Sep 11 01:35:12 2016.
Dependencies resolved.
================================================================================
 Package                Arch          Version               Repository     Size
================================================================================
Installing:
 lm_sensors             x86_64        3.4.0-4.fc24          fedora        145 k
 lm_sensors-libs        x86_64        3.4.0-4.fc24          fedora         46 k

Transaction Summary
================================================================================
Install  2 Packages

Total download size: 191 k
Installed size: 483 k
Is this ok [y/N]: y
Downloading Packages:
(1/2): lm_sensors-libs-3.4.0-4.fc24.x86_64.rpm  407 kB/s |  46 kB     00:00    
(2/2): lm_sensors-3.4.0-4.fc24.x86_64.rpm       988 kB/s | 145 kB     00:00    
--------------------------------------------------------------------------------
Total                                           122 kB/s | 191 kB     00:01     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Installing  : lm_sensors-libs-3.4.0-4.fc24.x86_64                         1/2 
  Installing  : lm_sensors-3.4.0-4.fc24.x86_64                              2/2 
  Verifying   : lm_sensors-3.4.0-4.fc24.x86_64                              1/2 
  Verifying   : lm_sensors-libs-3.4.0-4.fc24.x86_64                         2/2 

Installed:
  lm_sensors.x86_64 3.4.0-4.fc24       lm_sensors-libs.x86_64 3.4.0-4.fc24      

Complete!
---

Run sensors-detect to prepare a configuration for your system.

[mochapenguin@dv6tqe ~]$ sudo sensors-detect
# sensors-detect revision 6284 (2015-05-31 14:00:33 +0200)
# System: Hewlett-Packard HP Pavilion dv6 Notebook PC [058D100000244720001620100] (laptop)
# Board: Hewlett-Packard 1657
# Kernel: 4.7.2-201.fc24.x86_64 x86_64
# Processor: Intel(R) Core(TM) i7-2630QM CPU @ 2.00GHz (6/42/7)

This program will help you determine which kernel modules you need
to load to use lm_sensors most effectively. It is generally safe
and recommended to accept the default answers to all questions,
unless you know what you're doing.

Some south bridges, CPUs or memory controllers contain embedded sensors.
Do you want to scan for them? This is totally safe. (YES/no): 
Silicon Integrated Systems SIS5595...                       No
VIA VT82C686 Integrated Sensors...                          No
VIA VT8231 Integrated Sensors...                            No
AMD K8 thermal sensors...                                   No
AMD Family 10h thermal sensors...                           No
AMD Family 11h thermal sensors...                           No
AMD Family 12h and 14h thermal sensors...                   No
AMD Family 15h thermal sensors...                           No
AMD Family 16h thermal sensors...                           No
AMD Family 15h power sensors...                             No
AMD Family 16h power sensors...                             No
Intel digital thermal sensor...                             Success!
    (driver `coretemp')
Intel AMB FB-DIMM thermal sensor...                         No
Intel 5500/5520/X58 thermal sensor...                       No
VIA C7 thermal sensor...                                    No
VIA Nano thermal sensor...                                  No

Some Super I/O chips contain embedded sensors. We have to write to
standard I/O ports to probe them. This is usually safe.
Do you want to scan for Super I/O sensors? (YES/no): 
Probing for Super-I/O at 0x2e/0x2f
Trying family `National Semiconductor/ITE'...               No
Trying family `SMSC'...                                     No
Trying family `VIA/Winbond/Nuvoton/Fintek'...               No
Trying family `ITE'...                                      No
Probing for Super-I/O at 0x4e/0x4f
Trying family `National Semiconductor/ITE'...               Yes
Found `ITE IT8518E Super IO'                                
    (no support yet)

Some hardware monitoring chips are accessible through the ISA I/O ports.
We have to write to arbitrary I/O ports to probe them. This is usually
safe though. Yes, you do have ISA I/O ports even if you do not have any
ISA slots! Do you want to scan the ISA I/O ports? (YES/no): 
Probing for `National Semiconductor LM78' at 0x290...       No
Probing for `National Semiconductor LM79' at 0x290...       No
Probing for `Winbond W83781D' at 0x290...                   No
Probing for `Winbond W83782D' at 0x290...                   No

Lastly, we can probe the I2C/SMBus adapters for connected hardware
monitoring devices. This is the most risky part, and while it works
reasonably well on most systems, it has been reported to cause trouble
on some systems.
Do you want to probe the I2C/SMBus adapters now? (YES/no): 
Using driver `i2c-i801' for device 0000:00:1f.3: Intel Cougar Point (PCH)
Module i2c-dev loaded successfully.

Next adapter: i915 gmbus ssc (i2c-0)
Do you want to scan it? (yes/NO/selectively): 
Next adapter: i915 gmbus vga (i2c-1)
Do you want to scan it? (yes/NO/selectively): yes

Next adapter: i915 gmbus panel (i2c-2)
Do you want to scan it? (yes/NO/selectively): yes

Next adapter: i915 gmbus dpc (i2c-3)
Do you want to scan it? (yes/NO/selectively): yes

Next adapter: i915 gmbus dpb (i2c-4)
Do you want to scan it? (yes/NO/selectively): yes

Next adapter: i915 gmbus dpd (i2c-5)
Do you want to scan it? (yes/NO/selectively): yes

Next adapter: DPDDC-B (i2c-6)
Do you want to scan it? (yes/NO/selectively): yes

Next adapter: Radeon i2c bit bus 0x90 (i2c-7)
Do you want to scan it? (yes/NO/selectively): yes

Next adapter: Radeon i2c bit bus 0x91 (i2c-8)
Do you want to scan it? (yes/NO/selectively): yes

Next adapter: Radeon i2c bit bus 0x92 (i2c-9)
Do you want to scan it? (yes/NO/selectively): yes

Next adapter: Radeon i2c bit bus 0x93 (i2c-10)
Do you want to scan it? (yes/NO/selectively): yes

Next adapter: Radeon i2c bit bus 0x94 (i2c-11)
Do you want to scan it? (yes/NO/selectively): yes

Next adapter: Radeon i2c bit bus 0x95 (i2c-12)
Do you want to scan it? (yes/NO/selectively): yes

Next adapter: Radeon i2c bit bus 0x96 (i2c-13)
Do you want to scan it? (yes/NO/selectively): yes

Next adapter: Radeon i2c bit bus 0x97 (i2c-14)
Do you want to scan it? (yes/NO/selectively): yes

Next adapter: SMBus I801 adapter at 6040 (i2c-15)
Do you want to scan it? (YES/no/selectively): YES
Client found at address 0x50
Probing for `Analog Devices ADM1033'...                     No
Probing for `Analog Devices ADM1034'...                     No
Probing for `SPD EEPROM'...                                 Yes
    (confidence 8, not a hardware monitoring chip)
Probing for `EDID EEPROM'...                                No
Client found at address 0x52
Probing for `Analog Devices ADM1033'...                     No
Probing for `Analog Devices ADM1034'...                     No
Probing for `SPD EEPROM'...                                 Yes
    (confidence 8, not a hardware monitoring chip)


Now follows a summary of the probes I have just done.
Just press ENTER to continue: 

Driver `coretemp':
  * Chip `Intel digital thermal sensor' (confidence: 9)

Do you want to overwrite /etc/sysconfig/lm_sensors? (YES/no): YES
Unloading i2c-dev... OK
---

Install hddtemp

[mochapenguin@dv6tqe ~]$ sudo dnf install hddtemp
[sudo] password for mochapenguin: 
Last metadata expiration check: 2:52:34 ago on Sun Sep 11 01:35:12 2016.
Dependencies resolved.
================================================================================
 Package        Arch          Version                       Repository     Size
================================================================================
Installing:
 hddtemp        x86_64        0.3-0.35.beta15.fc24          fedora         60 k

Transaction Summary
================================================================================
Install  1 Package

Total download size: 60 k
Installed size: 134 k
Is this ok [y/N]: y
Downloading Packages:
hddtemp-0.3-0.35.beta15.fc24.x86_64.rpm         355 kB/s |  60 kB     00:00    
--------------------------------------------------------------------------------
Total                                            43 kB/s |  60 kB     00:01     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Installing  : hddtemp-0.3-0.35.beta15.fc24.x86_64                         1/1 
  Verifying   : hddtemp-0.3-0.35.beta15.fc24.x86_64                         1/1 

Installed:
  hddtemp.x86_64 0.3-0.35.beta15.fc24                                           

Complete!

Check out the sensors

[mochapenguin@dv6tqe ~]$ sensors
acpitz-virtual-0
Adapter: Virtual device
temp1:        +47.0°C  (crit = +99.0°C)

radeon-pci-0100
Adapter: PCI adapter
temp1:            N/A  (crit = +120.0°C, hyst = +90.0°C)

coretemp-isa-0000
Adapter: ISA adapter
Physical id 0:  +47.0°C  (high = +86.0°C, crit = +100.0°C)
Core 0:         +47.0°C  (high = +86.0°C, crit = +100.0°C)
Core 1:         +47.0°C  (high = +86.0°C, crit = +100.0°C)
Core 2:         +46.0°C  (high = +86.0°C, crit = +100.0°C)
Core 3:         +44.0°C  (high = +86.0°C, crit = +100.0°C)

Tuesday 26 July 2016

Installing apps on Fedora 24

Telegram

Download Telegram for Linux. The downloaded file was tsetup.version.number.tar.xz

I am following the approach of installing additional software in the /opt folder. Untar it to /opt.

tar zxf tsetup.version.tar.xz -C /opt

The files are unzipped to /opt/Telegram and the file to execute is /opt/Telegram/Telegram

Typically, the permissions would be as below:

[mochapenguin@dv6tqe ~]$ ls -las /opt total 20 4 drwxr-xr-x. 5 root root 4096 Jul 26 15:16 . 4 dr-xr-xr-x. 18 root root 4096 Jul 25 11:12 .. 4 drwxr-xr-x. 3 root root 4096 Jul 24 21:04 google 4 drwxr-xr-x. 4 root root 4096 Jul 25 20:18 Simplenote-linux-x64-102 4 drwxrwxr-x. 2 root root 4096 Jul 25 20:14 Telegram

Create a desktop launcher file as specified below:

~/Desktop/Telegram.desktop
#!/usr/bin/env xdg-open [Desktop Entry] Type=Application Encoding=UTF-8 Name=Telegram Comment=Telegram Messenger Exec=/opt/Telegram/Telegram Icon=/home/mochapenguin/.TelegramDesktop/tdata/ticons/icomute_22_0.png Terminal=false

Saturday 18 June 2016

Inateck 2.5 Inch USB 3.0 Hard Drive Enclosure External SATA HDD and SSD Case - Optimized for 9.5mm 7mm 2.5" SSD, Tool Free (FE2002)

Purchased another USB 3.0 hard disk enclosure [Inateck 2.5 Inch USB 3.0 Hard Drive Enclosure External SATA HDD and SSD Case - Optimized for 9.5mm 7mm 2.5" SSD, Tool Free (FE2002)]

dmesg
[18230.601026] usb 1-7: new high-speed USB device number 2 using ehci-pci [18230.718914] usb 1-7: New USB device found, idVendor=174c, idProduct=55aa [18230.718921] usb 1-7: New USB device strings: Mfr=2, Product=3, SerialNumber=1 [18230.718926] usb 1-7: Product: ASM1153E [18230.718930] usb 1-7: Manufacturer: Inateck [18230.718934] usb 1-7: SerialNumber: 123456789111 [18230.830322] usbcore: registered new interface driver usb-storage [18230.838751] scsi host4: uas [18230.839585] usbcore: registered new interface driver uas [18230.840569] scsi 4:0:0:0: Direct-Access Inateck ASM1153E 0 PQ: 0 ANSI: 6 [18230.842579] sd 4:0:0:0: Attached scsi generic sg2 type 0 [18230.843552] sd 4:0:0:0: [sdb] Spinning up disk... [18231.844019] ..ready [18232.848344] sd 4:0:0:0: [sdb] 976773168 512-byte logical blocks: (500 GB/465 GiB) [18232.848351] sd 4:0:0:0: [sdb] 4096-byte physical blocks [18232.850332] sd 4:0:0:0: [sdb] Write Protect is off [18232.850340] sd 4:0:0:0: [sdb] Mode Sense: 43 00 00 00 [18232.851660] sd 4:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [18232.921374] sdb: sdb1 [18232.924707] sd 4:0:0:0: [sdb] Attached SCSI disk

Shall be updating more details about the product as I get used to it. Watch this space!

Tuesday 14 June 2016

Spinido Hard Disk Enclosure Support UASP SATA III USB 3.0/2.0 enclosure

Purchased a USB 3.0 hard disk enclosure [Spinido Hard Disk Enclosure Support UASP SATA III USB 3.0/2.0 Aluminum External Tool-free Box & Mobile Device Optimized For 2.5 Inch SSD and HDD(Black)]

[ 65.772392] usb 2-2: new SuperSpeed USB device number 2 using xhci_hcd [ 65.787752] usb 2-2: New USB device found, idVendor=152d, idProduct=8561 [ 65.787762] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 65.787767] usb 2-2: Product: USB3.0 External HDD [ 65.787772] usb 2-2: Manufacturer: Jmicron [ 65.787776] usb 2-2: SerialNumber: 612C20000 [ 65.846564] usbcore: registered new interface driver usb-storage [ 65.855134] scsi host6: uas [ 65.855278] usbcore: registered new interface driver uas [ 65.855841] scsi 6:0:0:0: Direct-Access TOSHIBA MK2561GSYN 8105 PQ: 0 ANSI: 6 [ 65.856996] sd 6:0:0:0: Attached scsi generic sg2 type 0 [ 65.857158] sd 6:0:0:0: [sdb] Spinning up disk... [ 66.857823] ..ready [ 67.858945] sd 6:0:0:0: [sdb] 488397168 512-byte logical blocks: (250 GB/232 GiB) [ 67.858955] sd 6:0:0:0: [sdb] 4096-byte physical blocks [ 67.859848] sd 6:0:0:0: [sdb] Write Protect is off [ 67.859862] sd 6:0:0:0: [sdb] Mode Sense: 53 00 00 08 [ 67.860277] sd 6:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [ 67.957150] sdb: sdb1 sdb2 sdb3 < sdb5 sdb6 sdb7 sdb8 sdb9 > [ 67.961100] sd 6:0:0:0: [sdb] Attached SCSI disk [ 68.692869] EXT4-fs (sdb5): mounted filesystem with ordered data mode. Opts: (null) [ 68.798436] EXT4-fs (sdb7): mounted filesystem with ordered data mode. Opts: (null) [ 68.857341] EXT4-fs (sdb8): mounted filesystem with ordered data mode. Opts: (null)

Shall be updating more details about the product as I get used to it. Watch this space!

Monday 13 June 2016

ORICO 2588US3 Portable USB 2.5 3.0 SATA external HDD enclosure

Probably does not support UASP. Found no mention of that on the product description. The system reports it as:

idVendor 0x357d Sharkoon idProduct 0x7788 QuickPort XT

Linux starts using the uas driver, but the drive goes offline after a short period of idle without informing the system. Not sure whether this is a linux driver issue or about the device supporting UASP. Very annoying.

ORICO 2588US3 Portable USB 2.5 3.0 SATA external HDD enclosure

[ 9448.672288] usb 2-2: new SuperSpeed USB device number 2 using xhci_hcd [ 9448.684149] usb 2-2: New USB device found, idVendor=357d, idProduct=7788 [ 9448.684154] usb 2-2: New USB device strings: Mfr=10, Product=11, SerialNumber=3 [ 9448.684156] usb 2-2: Product: USB to ATA/ATAPI Bridge [ 9448.684158] usb 2-2: Manufacturer: JMicron [ 9448.684159] usb 2-2: SerialNumber: 000012345678 [ 9448.699991] usbcore: registered new interface driver usb-storage [ 9448.703525] scsi host4: uas [ 9448.704366] usbcore: registered new interface driver uas [ 9448.705036] scsi 4:0:0:0: Direct-Access TOSHIBA MQ01XXXNNN 0100 PQ: 0 ANSI: 6 [ 9448.707804] sd 4:0:0:0: Attached scsi generic sg1 type 0 [ 9448.708435] sd 4:0:0:0: [sdb] 976773168 512-byte logical blocks: (500 GB/466 GiB) [ 9448.708437] sd 4:0:0:0: [sdb] 4096-byte physical blocks [ 9448.711541] sd 4:0:0:0: [sdb] Write Protect is off [ 9448.711544] sd 4:0:0:0: [sdb] Mode Sense: 67 00 10 08 [ 9448.712759] sd 4:0:0:0: [sdb] Write cache: enabled, read cache: enabled, supports DPO and FUA [ 9448.788026] sdb: sdb1 [ 9448.794082] sd 4:0:0:0: [sdb] Attached SCSI disk [ 9449.625260] EXT4-fs (sdb1): recovery complete [ 9449.625390] EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts: (null)

A way forward is to register a quirk with Linux to tell it to use the usb-storage driver instead.

/etc/modprobe.d/uas.conf

options usb-storage quirks=357d:7788:u

followed by rebuilding the initramfs

sudo dracut -f

rebooted and plugged in the USB3 drive. So far it's working fine.

From dmesg:

[43697.312058] usb 2-2: new SuperSpeed USB device number 2 using xhci_hcd [43697.327316] usb 2-2: New USB device found, idVendor=357d, idProduct=7788 [43697.327324] usb 2-2: New USB device strings: Mfr=10, Product=11, SerialNumber=3 [43697.327328] usb 2-2: Product: USB to ATA/ATAPI Bridge [43697.327331] usb 2-2: Manufacturer: JMicron [43697.327334] usb 2-2: SerialNumber: 000012345678 [43697.373991] usb 2-2: UAS is blacklisted for this device, using usb-storage instead [43697.374005] usb-storage 2-2:1.0: USB Mass Storage device detected [43697.374341] usb-storage 2-2:1.0: Quirks match for vid 357d pid 7788: 800000 [43697.374405] scsi host6: usb-storage 2-2:1.0 [43697.374598] usbcore: registered new interface driver usb-storage [43697.379279] usbcore: registered new interface driver uas [43698.374486] scsi 6:0:0:0: Direct-Access TOSHIBA MQ01XXXNNN 0100 PQ: 0 ANSI: 6 [43698.375209] sd 6:0:0:0: Attached scsi generic sg2 type 0 [43698.375435] sd 6:0:0:0: [sdb] 976773168 512-byte logical blocks: (500 GB/465 GiB) [43698.375927] sd 6:0:0:0: [sdb] Write Protect is off [43698.375934] sd 6:0:0:0: [sdb] Mode Sense: 67 00 10 08 [43698.376575] sd 6:0:0:0: [sdb] Write cache: enabled, read cache: enabled, supports DPO and FUA [43698.468754] sdb: sdb1 [43698.470369] sd 6:0:0:0: [sdb] Attached SCSI disk [43722.817407] EXT4-fs (dm-1): mounted filesystem with ordered data mode. Opts: (null)

Saturday 28 May 2016

Install Epson driver for XP-335 on Fedora 23

Starting point is usually the Epson Drivers and Software download page

Took me here http://support.epson.net/linux/en/imagescanv3.php?version=1.1.6

Download and extract: imagescan-bundle-fedora-23-1.1.6.x64.rpm.tar.gz

[mochapenguin@tp300la imagescan-bundle-fedora-23-1.1.6.x64.rpm]$ su -c './install.sh' Password: Last metadata expiration check: 0:13:39 ago on Sat May 28 17:03:43 2016. Dependencies resolved. ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: GraphicsMagick-c++ x86_64 1.3.23-1.fc23 updates 110 k boost-filesystem x86_64 1.58.0-11.fc23 updates 75 k imagescan x86_64 3.16.0-1epson4fedora23 @commandline 1.5 M imagescan-plugin-networkscan x86_64 1.1.0-1epson4fedora23 @commandline 33 k imagescan-plugin-ocr-engine x86_64 1.0.0-1epson4fedora23 @commandline 8.6 M Transaction Summary ================================================================================ Install 5 Packages Total size: 10 M Total download size: 184 k Installed size: 21 M Downloading Packages: (1/2): GraphicsMagick-c++-1.3.23-1.fc23.x86_64. 147 kB/s | 110 kB 00:00 (2/2): boost-filesystem-1.58.0-11.fc23.x86_64.r 96 kB/s | 75 kB 00:00 -------------------------------------------------------------------------------- Total 42 kB/s | 184 kB 00:04 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Installing : boost-filesystem-1.58.0-11.fc23.x86_64 1/5 Installing : GraphicsMagick-c++-1.3.23-1.fc23.x86_64 2/5 Installing : imagescan-3.16.0-1epson4fedora23.x86_64 3/5 Installing : imagescan-plugin-ocr-engine-1.0.0-1epson4fedora23.x86_64 4/5 Installing : imagescan-plugin-networkscan-1.1.0-1epson4fedora23.x86_64 5/5 Verifying : imagescan-plugin-ocr-engine-1.0.0-1epson4fedora23.x86_64 1/5 Verifying : imagescan-plugin-networkscan-1.1.0-1epson4fedora23.x86_64 2/5 Verifying : imagescan-3.16.0-1epson4fedora23.x86_64 3/5 Verifying : GraphicsMagick-c++-1.3.23-1.fc23.x86_64 4/5 Verifying : boost-filesystem-1.58.0-11.fc23.x86_64 5/5 Installed: GraphicsMagick-c++.x86_64 1.3.23-1.fc23 boost-filesystem.x86_64 1.58.0-11.fc23 imagescan.x86_64 3.16.0-1epson4fedora23 imagescan-plugin-networkscan.x86_64 1.1.0-1epson4fedora23 imagescan-plugin-ocr-engine.x86_64 1.0.0-1epson4fedora23 Complete!

Thursday 5 May 2016

grub rescue after fixing partition order

Windows 10 (from Windows 7) upgrade on my HP dv6tqe left it with partition table entries not in the disk order. Windows 10 itself took out ~800 MB from the end of the C drive to create a new Windows RE partition.

When I used fdisk (dv6tqe has MBR) to lisk partitions [fdisk -lu] the output showed included the following:

Partition table entries are not in disk order. 

Although it wasn't causing any problems, I decided to tidy it up.

Fix partition table entry order using fdisk (on MBR discs)
sudo fdisk /dev/sda
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): x (extra functionality)
f (for fix partition order)
r (return to main menu)
w (write table to disk and exit)

After this on rebooting grub threw me to the rescue prompt.

Code
error: file '/grub2/i386-pc/normal.mod' not found. Entering rescue mode .... grub rescue >

Because the partition table order had changed, grub could no longer locate the /boot partition

commands typed at grub rescue
# List partitions
grub rescue> ls
(hd0,msdos1)(hd0,msdos2)...
# After a bit of trial and error the following command listed out the contents of the grub folder, thus identifying the correct partition to use
grub rescue> ls (hd0,msdos5)/grub
# to view the existing values
grub rescue> set 

Next, set the partition for grub to use.

Code
set prefix=(hd0,msdos5)/grub set root=(hd0,msdos5) insmod normal normal

This should bring up the familiar grub menu. Boot into Linux and fix the grub installation as below.

Code
grub2-install /dev/sda grub2-install /dev/sda

References



https://www.howtoforge.com/tutorial/repair-linux-boot-with-grub-rescue/ 

Thursday 28 April 2016

SSD optimisations on ASUS TP300LA running Fedora 23

Please leave a comment if you spot anything that is wrong (share if you know more than what I have discovered; or better still, warn me if I am doing something stupid etc. etc.)

References

Enable TRIM Support

First and foremost, ensure your SSD supports TRIM. Some SSDs have issues with their TRIM implementations. Researching that is also crucial. For example issues with continuous TRIM are discussed at Continuous TRIM by mount flag.
Does your SSD support trim? [Sandisk SDSSDHII-960G-G25 960GB Ultra II]
[mochapenguin@tp300la ~]$ su -c 'hdparm -I /dev/sda' | grep TRIM
Password:
* Data Set Management TRIM supported (limit 16 blocks)
* Deterministic read ZEROs after TRIM

Enabled TRIM support following the Phoronix article on Tweaking Your Fedora Installation For Maximum Productivity & Features
Enable fstrim.timer service
sudo systemctl enable fstrim.timer sudo systemctl start fstrim.timer

Edit /etc/crypttab and add discard
/etc/crypttab
luks-x-b3b728ea5e7c UUID=x-b3b728ea5e7c  none    luks,discard fc23home            UUID=x-deaft04500f2  none    luks,discard

Update initramfs
sudo dracut -f

Reboot. And verify.
Test if TRIM is working
[mochapenguin@tp300la ~]$ sudo fstrim -v /
[sudo] password for mochapenguin:
/: 686.4 GiB (736991698944 bytes) trimmed

Profile-Sync-Daemon

PSD is designed to manage browser profile(s) in tmpfs and to periodically sync back to the physical disc, thereby reducing writes to SSDs. This is useful where there is ample spare RAM on the system.

Browsers store their profile and cache in various locations as described below:

Firefox

cache
/home/mochapenguin/.cache/mozilla/firefox/<profile-id>.default
profile
/home/mochapenguin/.mozilla/firefox/<profile-id>.default

I took the approach of moving the cache folder into the profile folder (so PSD can sync it to tempfs) and create a symlink (so the browser works on as before).

Created a folder named cache within the profile folder, moved the cache folder contents there and created a symlink to it.

create symlink from Code
ln -s /home/mochapenguin/.mozilla/firefox/<profile-id>.default/cache /home/mochapenguin/.cache/mozilla/firefox/<profile-id>.default

Google Chrome

cache
/home/mochapenguin/.cache/google-chrome
profile
/home/mochapenguin/.config/google-chrome

Created a folder named CacheFedoraUser within the profile folder, moved the cache folder contents there and created a symlink to it.
create symlink from Code
ln -s /home/mochapenguin/.config/google-chrome/CacheFedoraUser /home/mochapenguin/.cache/google-chrome

Midori

cache
/home/mochapenguin/.cache/midori
profile
/home/mochapenguin/.config/midori

Created a folder named cache within the profile folder, moved the contents of the cache folder there and created a symlink to it.

create symlink
ln -s /home/mochapenguin/.config/midori/cache /home/mochapenguin/.cache/midori
profile-sync-daemon parse
[mochapenguin@tp300la ~]$ psd p
Profile-sync-daemon v5.68 on Fedora 23 (Workstation Edition)
 Systemd service is currently active.  Systemd resync service is currently active.  Overlayfs v23 is currently active.
Psd will manage the following per /run/psd.conf settings:

 browser/psname:  firefox/firefox
 owner/group id:  mochapenguin/1000
 sync target:     /home/mochapenguin/.mozilla/firefox/am4vgccx.default
 tmpfs dir:       /tmp/mochapenguin-firefox-am4vgccx.default
 profile size:    104M
 overlayfs size:  0
 recovery dirs:   none

 browser/psname:  google-chrome/chrome
 owner/group id:  mochapenguin/1000
 sync target:     /home/mochapenguin/.config/google-chrome
 tmpfs dir:       /tmp/mochapenguin-google-chrome
 profile size:    83M
 overlayfs size:  62M
 recovery dirs:   none

 browser/psname:  midori/midori
 owner/group id:  mochapenguin/1000
 sync target:     /home/mochapenguin/.config/midori
 tmpfs dir:       /tmp/mochapenguin-midori
 profile size:    1.4M
 overlayfs size:  0
 recovery dirs:   none

Enable overlayfs

Decided to use the overlayfs for the profile sync. This may be optional but I understand it helps making the sync efficient.

load up the overlay module manually (first time)
sudo modprobe overlay

Load up the overlay module as above, enable overlay in psd.conf and restart the service. The output of the profile-sync-daemon parse command should now show "Overlayfs v23 is active".
Added the below file to get the overlayfs module to be loaded on boot from this finding on FedoraForum.

/etc/modules-load.d/overlayfs.conf
overlay

Wednesday 27 April 2016

WIP - ASUS TP300LA - Windows 10 + Fedora 23 - dual boot

Work in Progress

Purchased an ASUS TP300LA notebook last Christmas. Documenting my journey here. Please leave a comment if you spot anything that is wrong (share if you know more than what I have discovered; or better still, warn me if I am doing something stupid etc. etc.)

Most important - recovery drive

It came with Windows 8.1. I make sure I create a recovery drive so that I can recover the system if I mess things up. Made a USB Recovery Drive (TODO - USB size).

SSD

It had a 500GB HDD built in. I was keen on replacing that with an SSD. Got a 960GB SanDisk Ultra II SSD. Swapped the drives and used the recovery drive to restore the system.

At that point in time it had partitions sda1 (305MB RE), sda2 (100MB EFI), sda3 (128MB MS reserved), sda4 (C drive), and sda5 (ASUS recovery drive).

Windows 10

Then upgraded to Windows 10. This created a 450MB partition (Windows 10 boot, I believe) at the end of the C drive partition.

I wanted to move all boot partitions etc before the partition for the C drive, reduce the C drive partition and blitz the ASUS recovery drive - thereby creating room for a Fedora install.

Using GParted, I moved the 450MB partition before the C drive partition. Reduced the C drive to under 100GB. That left under half the C drive free for installing software if I decided to use Windows 10 (unlikely to be very much). ASUS recovery partition was deleted (since we have a Recovery USB Drive now anyway).

Fedora 23 Workstation install

Installed Fedora 23 x64 Workstation. 

The plan is to have an encrypted swap, /home and /tmp for security. 

During installation, selected Custom Partitioning. Defined the partition manually. ~ 500MB for /boot, LUKS encrypted 6GB (same size as the RAM) for swap, 100GB at the end of the drive for /home (LUKS encrypted) and the remaining in between for /

Below screenshot shots how things looked.



Encrypting /home

Boot up to the Fedora Login prompt. Press CTRL + ALT + F2 to bring up the console. Log in as root. Following commands are used to make a copy of /home

Code
[root] mkdir homebackup [root] cp -a /home/* homebackup/ # Make a new dm-crypt device cryptsetup --verify-passphrase -v luksFormat /dev/sda9 # cryptsetup luksOpen /dev/sda9 fc23home # verify cryptsetup luksDump /dev/sda9 # mkfs.ext4 /dev/mapper/fc23home # remove lost+found rm -rf /home/* # cp -a homebackup/* /home
Code
/etc/crypttab /etc/fstab
Now I have a dual boot Windows 10 + Fedora 23 Workstation on my ASUS TP300LA.

Good things noticed:
  • Hibernation works great 

Tuesday 26 April 2016

Fedora 23 - User interface customisations

Customisations applied on my Fedora 23 machine

Custom Shortcuts

If you are used to Windoze shortcuts and want to use the same, this is what you can do:

Go to Settings (drop down menu from the top right corner > spanner + screwdriver icon





Click on the Keyboard icon. Then the Shortcuts tab.
 
Select Custom Shortcuts, Click on the + button and define the shortcuts





1. Terminal - Super + T





Define the shortcut and click the Add button
 




Click on the text Disabled to define a new accelerator key combination.
 








Name: 




NameCommandShortcut
Terminal
gnome-terminal
Win + T
Firefox
firefoxWin + F
Nautilus
nautilusWin + E