Saturday, June 14, 2025

Formatting Lunix drives, USB external or internal, how to

Replace ? with your the letter that will be assigned when you plug in and power up the drive,  dmesg -T will tell you what letter has been assigned, df which show you what letters are already in use.

1) gdisk -l /dev/sd? (got the right drive??)

2) gdisk /dev/sd?

3) d = delete existing partition

4) n = create new, 8300 for Linux

5) w = write/exit

6) power off, or reread, sometimes maybe??

7) gdisk -l /dev/sd? ; umount  /run/media/charles/EFI

8) mkfs -V -t ext4 /dev/sd?1 = newfs

9) tune2fs -L seagate5 /dev/sd?1

10) tune2fs -m 0 /dev/sd?1

11) vi /etc/fstab, LABEL=seagate5  /seagate5       ext4    defaults 0 0

12) mkdir /seagate5; mount /seagate5 ; df


NOTES and example output:

If you are getting Ring error in your dmesg -T output, bad cable usually what causes that. I've had new USB cables go bad right out of the package, have a few different brands on hand!



narnia<129># gdisk /dev/sdd

GPT fdisk (gdisk) version 1.0.9


Partition table scan:

  MBR: protective

  BSD: not present

  APM: not present

  GPT: present


Found valid GPT with protective MBR; using GPT.


Command (? for help): d

Partition number (1-2): 2

or {+-}size{KMGTP}: 

Partition number (2-128, default 2): 

First sector (34-42970644445, default = 409640) or {+-}size{KMGTP}: 

Last sector (409640-42970644445, default = 42970644439) or {+-}size{KMGTP}: 


Current type is 8300 (Linux filesystem)

Hex code or GUID (L to show codes, Enter = 8300): 

Changed type of partition to 'Linux filesystem'


Command (? for help): w


Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING

PARTITIONS!!


Do you want to proceed? (Y/N): y

OK; writing new GUID partition table (GPT) to /dev/sdd.

The operation has completed succes


gdisk -l /dev/sdd

Number  Start (sector)    End (sector)  Size       Code  Name

   1              40          409639   200.0 MiB   EF00  EFI System Partition

   2          409640     42970644439   20.0 TiB    8300  Linux filesystem

narnia<136># mount  /seagate2025
mount: (hint) your fstab has been modified, but systemd still uses
       the old version; use 'systemctl daemon-reload' to reload.




Thursday, February 16, 2023

NFS won't start, down the rabbit hole we are going




NFS stopped working? 

systemctl start nfs-server.service - hangs and tells you to check journalctl -xe ??

journalctl -xe saying something about a missing drive, even though the drive was never exported?

-- Subject: Unit nfs-server.service has failed

-- Defined-By: systemd

Feb 14 20:31:16 amber systemd[1]: nfs-server.service: Job nfs-server.service/st>

Feb 14 20:31:16 amber systemd[1]: seagate8.mount: Job seagate8.mount/start fail>

Feb 14 20:31:16 amber systemd[1]: dev-disk-by\x2dlabel-seagate8.device: Job dev>

Feb 14 20:31:16 amber systemd[1]: dev-disk-by\x2dlabel-seagate7.device: Job dev>

Feb 14 20:31:16 amber systemd[1]: Timed out waiting for device Expansion_Desk s>

-- Subject: Unit dev-disk-by\x2dlabel-seagate7.device has failed

WAIT! No need to reboot! Hey, this isn't Windows, we can fix it!

And the solution (likely) is: 

systemctl daemon-reexec

OR

systemctl daemon-reload

The the reason NFS won't run (in some cases) has nothing to do with NFS or /etc/exports - it's a problem with systemd. One could consider it a "feature" or a bug. Personally I think systemd is a bug, causes more trouble than it solves. I've seen and fixed this NFS won't start problem several times over the years and finally got around to writing down the solution, as from Google I see a ton of posts with these errors messages and no correct answers. Just a lot of jump through hoops, chase down rabbit holes and check your kernel module FUD.



Sunday, October 30, 2022

2021 ISP speeds

     Server: Winchester Wireless - Winchester, VA (id = 21859)

        ISP: Shentel Communications

    Latency:    13.59 ms   (2.46 ms jitter)

   Download:   101.47 Mbps (data used: 86.0 MB)                               

     Upload:    10.46 Mbps (data used: 9.9 MB)                               

Packet Loss:     0.0%

 Result URL: https://www.speedtest.net/result/c/59e0b2d6-d137-4772-970b-56fda42a92e5

     Server: Shentel - Edinburg, VA (id = 3785)

        ISP: Shentel Communications

    Latency:    11.39 ms   (5.41 ms jitter)

   Download:   261.87 Mbps (data used: 424.2 MB)                               

     Upload:    10.48 Mbps (data used: 10.3 MB)                               

Packet Loss:    13.3%

 Result URL: https://www.speedtest.net/result/c/4f7dadd6-1d85-42e0-8a5e-2de736347db9

locnar<1098>% date

Fri 19 May 16:56:48 PDT 2023




2022

 Server: Lumos Fiber - Waynesboro, VA (id = 7085)

        ISP: Shentel Communications

    Latency:    16.88 ms   (3.79 ms jitter)

   Download:   159.52 Mbps (data used: 164.9 MB)                               

     Upload:    10.22 Mbps (data used: 9.7 MB)   






 

1  gateway2 (89.7.1.30)  0.200 ms  0.217 ms  0.192 ms
 2  10.228.32.1 (10.228.32.1)  11.670 ms  21.255 ms  21.303 ms
 3  10.17.0.205 (10.17.0.205)  21.666 ms  21.858 ms  21.909 ms
 4  10.25.0.109 (10.25.0.109)  23.564 ms  23.621 ms  23.598 ms
 5  204.111.0.65 (204.111.0.65)  23.034 ms  22.949 ms  30.933 ms
 6  * * *
 7  108.170.240.97 (108.170.240.97)  29.647 ms  16.025 ms 209.85.252.18 (209.85.252.18)  15.405 ms
 8  108.170.246.49 (108.170.246.49)  24.230 ms 108.170.240.112 (108.170.240.112)  23.915 ms 108.170.246.49 (108.170.246.49)  24.058 ms
 9  * * 216.239.42.137 (216.239.42.137)  24.570 ms
10  108.170.225.156 (108.170.225.156)  29.315 ms 142.251.66.21 (142.251.66.21)  28.831 ms *
11  142.250.57.144 (142.250.57.144)  29.263 ms 142.251.69.63 (142.251.69.63)  39.602 ms 142.251.49.86 (142.251.49.86)  24.270 ms
12  108.170.248.33 (108.170.248.33)  24.154 ms  24.180 ms 108.170.248.97 (108.170.248.97)  31.631 ms
13  216.239.40.167 (216.239.40.167)  22.523 ms 216.239.40.187 (216.239.40.187)  29.248 ms 216.239.40.167 (216.239.40.167)  28.411 ms
14  lga34s38-in-f4.1e100.net (142.251.40.196)  28.576 ms  29.010 ms  29.115 ms




Thursday, August 27, 2020

GeForce GT 710 graphics card and Fedora Linux

 It works. Plug and play.

Where this get interesting is after installing the Nvidia drivers, which you don't need as the Nouveau drivers that come with Linux work just fine. I had a go with Nvidia drivers and this fanless $35 card to see if there would be any difference in picture quality over the build in graphics card on my ThinkCentre M93p running Fedora 32. Doesn't seem to be any difference as far as I can tell. Except for the one film I have in x265.10bit.HDR format, playback is choppy. I noted Kodi says the GT710 does not support the x265 codex, so no hardware excelleration. However, when I switched to the Nvidia drivers, playback of my x265 4K file is smooth.

Here's where the fun started. With the Nvidia drivers installed, the card wasn't getting the same EDID info from my Athem AVM 60 media center as I did with the Nouveau drivers. When I switched to the Nvidia drivers, Pulseaudio  (pavucontrol) showed the HDMI audio profiles as unplugged unavailible, so no sound. Even with Pulseaudio disabled, Kodi would see 4 HDMI profiles, but no sound.

edid-decode /sys/class/drm/card0-HDMI-A-1/edid

EDID and xorg.conf files


 


Monday, August 17, 2020

Welcome to Linux emergency mode! Enter control-d to continue

 


If you're stuck in this "emergency mode" boot cycle, and/or the system just hangs on boot, a common reason is a mistake in /etc/fstab. Recently I removed a drive but forgot to delete the entry in fstab, and it bit me on reboot. Just boot rescue mode, mount the / file system and edit the fstab.


Tuesday, July 28, 2020

Scanning on Linux will drive you Xsane!





xsane is an excellent tool for scanning on Linux, I've used it for 25 years, since I worked with the developer to resolve some issues running it under Solaris long ago. Until my recent upgrade to Fedora 31, everything worked fine with Xsane, with my old Epson USB scanner and then my Brother network scanner.  All of a sudden, xsane was giving "segmentation fault, core dumped" on start up, but only on 1 of the computers running Fedora 31, my main desktop.  On the others it worked fine. Here's the problem I found:

locnar<885>% gdb xsane
(gdb) run
Starting program: /usr/bin/xsane
Thread 1 "xsane" received signal SIGSEGV, Segmentation fault.
0x00007fffee9c07c0 in sanei_scsi_close ()
   from /usr/lib64/sane/libsane-epkowa.so.1

This ibsane-epkowa.so.1 was installed by the iscan package. Once I removed it, the trouble disappeared. I reinstalled xsane and sane-backends, followed by running linux-brprinter-installer-2.2.2-1 and I was back to scanning!

One issue I ran into with linux-brprinter-installer was it tried to install .deb packages and I need the .rpm packages on Fedora. This was because it tests to see if you have /bin/dpkg, which I did along with alien, so it thought I was on the wrong OS.


Learning Linux


The first to understand about Linux is it's not based on Windows, it's not another version of Windows, it's not "like" Windows, it didn't come after Windows, it's not a "free version" of Windows.  These are just common misconceptions repeated by Windows users that don't understand Linux.

Linux is based on the much older computer operating system called Unix.  Unix was around decades before MSDOS or Windows. Windows is derived from MSDOS, which is based on CP/M.

The second thing to understand about Linux is you don't need to "learn" Linux.  No one needs to learn an operating system today.  All you need to know is how to open the web browser and maybe how to copy pictures/music/video to/from the computer.  That's it!  Using a web browser, Gmail, Google Docs is just the same expirence on Linux as it is on Windows. The operating system is just there to enable you to run the web browser, anything beyond that is for computer hobbiests.

What you do need to know is how to get Linux, and it's improtant to understand Linux is FREE.  There's no cost, support is free, all the software that runs on Linux is free too!

Switching from Windows to Linux is much like switching from driving on left side of the road to driving on the right. If you've never driven before, it's easy to learn to drive on the right. However if you started with driving on the left, it's very hard to unlearn what you already know. Most "power users" of Windows are very unhappy with a move to Linux and generally revert to Windows in a very short time for this reason.

To makes things simple

Two main distros

Monday, May 20, 2019

Linux, Android phone, pictures sync


How do I move files, pictures, backups from my phone to my desktop? Actually it's very easy, and there's no need to install ADB, root your phone, connect USB cables, pop out SD cards, deal with FuseBlock filesystems or have to follow the arcane steps I see posted on other sites. It all can be done faster and better via Wifi with simple high level apps.

First, start with a Samsung account. Your phone, calendar, apps, etc get backed up to Samsung's cloud, 15GB for free. You can even store photos there and then view/download to your desktop. Lots of other features, like find your phone and view last calls.
Log onto https://findmymobile.samsung.com and/or support.samsungcloud.com.

Google Drive - shares files easily between phone and desktop, even share your photos with family and friends.

Google Keep - great app, I use it everyday. Lets you take notes on either desktop or mobile and they appear automatically on both, great for shopping lists, you can even share notes with other Google Keep users.

KDEConnect - very rich full featured app that integrates phone and desktop, lets you send and respond to SMS, see incoming phone calls on your desktop, use your phone as a desktop mouse, send files, browse files system and more. Another great app that I've used for years. Except for the problem of it not working. I get a few days or weeks out of it and then it unpairs and I have to go through a bunch of pair steps again, currently even though it's paired I can't send pictures to my desktop. Tried of dealing with, stopped using it.

Syncthing - My new favorite thing, rsync made easy. I've configured it to automatically transfer pics I take on my phone to my desktop. It doesn't have all the features of KDEConnect, but really all I care about, or anyone does, is getting pictures off my phone. Just one small problem, it doesn't support SD cards, where most people store their pictures. This makes it a practically useless app. However, there's a (arcane) workaround. All you need to do is manually create a file called ".stfolder" on the SD card in the photos directory. This can be easily done with ES File Explorer, or pop out the SD card and mount it on your desktop. The only problem is finding the right path on the phone, in my case I created this file "/storage/3138-3961/DCIM/Camera/.stfolder" and now all my photos sync from the SD Card to my Linux desktop.
Check out http://127.0.0.1:8384 after you install the Syncthing RPM.

AndFTP - Uses SSH to send files from your phone to your desktop, always works, great fall back if nothing else works.

So between Samsung cloud backups and Syncthing photo transfers, it's very easy now to get things off my Android phone.

Thursday, April 11, 2019

Linux and the hard drive, LVM, SSD, USB, capacity, speed and lifespan

Mass External Storage


For mass external storage I use Seagate Expansion USB3 drives, I have 2 5TB and 4 8TB drives.  I thought they were the same drive except for capacity but I'm here waiting for 2.2TB of data to write to the 5TB drive, and 16 hours later, it's still not finished.  Yesterday day I was able to fill the 8TB drive with 5TB data in a few hours (I didn't time it).  Near as I can tell, the 5TB drive has the "Seagate 5TB BarraCuda 5400 RPM 128MB Cache" inside and the 8TB has the "Seagate Barracuda 7200 RPM 256MB Cache" inside.  I'm guessing platter density is where most of the speed boost is coming from, heads are writting 2x more per pass, and the higher RPM and larger cache helps, but this 5x faster write speed on the 8TB drive is just amazing!

At $140 for 8TB, I don't see any other choice for cheap external storage, at that price I can buy three 8TB drives for the cost of one 14TB drive.  And I don't see any other choice for the next 5-10 years, the new drive head tech is coming later in 2019 with 20TB drives, but I expect it to be $1,000+, I doubt we'll see those 20TB drives hit the sub $200 price point in less than 5 years.

2020 - now the best value is the Seagate Expansion 10TB on Amazon, for around $180. (In 2021 I shelled out $270 for the 14TB) And when they say 10TB they mean 9TB, formatted:

 Number  Start (sector)    End (sector)  Size       Code  Name
   1              40     19532873693   9.1 TiB     8300  Linux filesystem

 lsusb -t - will tell you what speed (USB) the drive is attached at, sometimes if you had a USB 2 (480M) device plugged to that USB port you may not get USB 3 speed (5000M) until you reboot.

amber<534>%  lsusb -t
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M
    |__ Port 1: Dev 2, If 0, Class=Mass Storage, Driver=uas, 5000M
    |__ Port 3: Dev 3, If 0, Class=Mass Storage, Driver=uas, 5000M
    |__ Port 4: Dev 5, If 0, Class=Mass Storage, Driver=uas, 5000M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 480M
    |__ Port 2: Dev 3, If 0, Class=Mass Storage, Driver=uas, 480M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/3p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/8p, 480M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/3p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/6p, 480M




For backup of the most critical backups, like photographs, I'm using MDisc BD, said to last 1,000 years.

When will my internal SSD die?


smartctl --all /dev/sda tells me my Samsung EVO 850 has 32541 Power_On_Hours, nearly 4 years, and Total_LBAs_Written is 60265626638, 28.06 TB.  Only 33 Power-On cycles.  Should I worry?  No one knows for sure about SSD lifespan, with tests and opinions varying, except that the first generation SSDs died young and the next gen like the Samsung EVO's seems to live forever.  I don't expect any problems, I have a EVO 840 that's 6 years old and no sign of problems.  If and when I replace the EVO 850 likely I would go with the Seagate 2TB FireCuda, it's the best of the SSD+HD world.
In 2022 - NVMe pretty much owns the internal drive space, 2T for $200, and incredibly fast.

Formatting steps:

dmesg = drive letter "?" (or from mount, did it automount??)
0) umount !! ; dmesg -T
1) gdisk -l /dev/sdb (got the right drive???)
2) gdisk /dev/sdb
3) d = delete existing partion
4) n = create new, 8300 for Linux
5) w = write/exit
6) power off, or reread??
7) gdisk -l /dev/sdb ; umount  /run/media/charles/EFI
8) mkfs -V -t ext4 /dev/sdb1 = newfs
9) tune2fs -L seagate5 /dev/sdb1
10) tune2fs -m 0 /dev/sdb1
11) vi /etc/fstab, LABEL=seagate5  /seagate5       ext4    defaults 0 0 (use tabs!!)
12) mkdir /seagate5; mount /seagate5 ; df

Note - there are differences between umount and eject that can bite you!
May need a reboot to reset the USB port speed, if you had an optical in that port.
for i in 1 2 3; do hdparm -tT /dev/sdb; done
If dmesg is showing "Ring error" that may mean bad cable.

Mounting by label / file system busy error

Say you pull a drive from another system, in the old days one could mount the drive simply as /dev/sdb1. But if it's a LVM partition it's a bit more complicated and you likely will get the "file system busy" error when you try to mount it. Simple solution is to attach the drive via a USB enclosure and "ls /dev/mapper". Likely you'll see your drive there as the label it's know by and you can then mount that label:

locnar<76># ls /dev/mapper
control                       fedora_localhost--live-swap@  fedora_miner-swap@
fedora_localhost--live-home@  fedora_miner-home@
fedora_localhost--live-root@  fedora_miner-root@

add this line to fstab:
/dev/mapper/fedora_miner-home /mnt/d2    ext4    defaults 1 1              

mkdir /mnt/d2; mount /mnt/d2

External USB case, pop in 2.5 or 3.5 drives






Monday, November 26, 2018

Linux and mouse buttons, assigning functions, VNC cut and paste







In most distros you can assign menu functions to mouse buttons via system settings.

What I'm wanting to do is make the left mouse button select and the right button paste.  Here's how:

 xmodmap ~/.xmodmap

and in the .xmodmap we have:

!
! Swap Caps_Lock and Control_L
!
keycode 109 = Multi_key
remove Lock = Caps_Lock
remove Control = Control_L
keysym Control_L = Caps_Lock
keysym Caps_Lock = Control_L
add Lock = Caps_Lock
add Control = Control_L
!
! mouse control
!
pointer = 1 3 2 4 5

The above first swaps the control and caps lock key, I grew up with Sun keyboards and that's the way it should be, next the "pointer" statement swaps the right and middle buttons for paste.

VNC cut and paste fun.  Most forums advise running vncconfig to resolve you cut and paste issues, however if you're running a Linux KDE desktop and multiple VNC viewer windows like I do, having vncconfig running on anywhere screws cut and paste up.  I found killing off vncconfig makes cut and paste between all windows work just fine.

Or not!  Further investigation seems to indicate KDE Klipper is the problem.  Having KDE running inside a VNC session seems to cause issues with cut and paste, killing Klipper seems to have fixed the problem.



Sunday, June 17, 2018

Linux - no sound after upgrade


The old 2 headed display
On Fedora 25;

Few days ago I upgraded my kernel, easy process, but my second monitor stopped working.  I didn't care much and wasn't going to spend any time fixing it since I was going to order a single larger monitor anyway, so I went back to the older kernel.  When I hooked up the new monitor and booted the new kernel I noticed sound wasn't working.  Long Google hunt later, with no correct answers found, I noticed for the fully working kernel I had a second packaged called  "kernel-modules-extra".

Sure enough, installing "kernel-modules-extra" with a version number which matched the new kernel fixed the sound problem, and likely would have fixed the the second monitor problem too.

You can test for this problem using "aplay -a", if you get a "no sound cards found" message then likely you have a kernel/driver issue which may be solved by installing the correct version of the "kernel-modules-extra" package.

locnar<132>% rpm -qa | grep -i kernel

kernel-headers-4.9.6-200.fc25.x86_64
kernel-core-4.13.16-100.fc25.x86_64
kernel-core-4.9.6-200.fc25.x86_64
kernel-core-4.1.13-100.fc21.x86_64
kernel-modules-4.13.16-100.fc25.x86_64
kernel-modules-extra-4.9.6-200.fc25.x86_64
kernel-4.1.13-100.fc21.x86_64
kernel-modules-extra-4.13.16-100.fc25.x86_64
kernel-4.9.6-200.fc25.x86_64
abrt-addon-kerneloops-2.9.0-1.fc25.x86_64
kernel-modules-extra-4.1.13-100.fc21.x86_64
kernel-modules-4.1.13-100.fc21.x86_64
kernel-debug-devel-4.9.6-200.fc25.x86_64
kernel-modules-4.9.6-200.fc25.x86_64
libreport-plugin-kerneloops-2.8.0-1.fc25.x86_64



The new 4k curved display

Thursday, December 28, 2017

Audio/Video Tools - ripping SACD, DVD-Audio and Blu-ray


So you're running Kodi and want to have all your SACD and DVD-Audio music online?

DVD Audio Extractor is the tool for the job, it'll pull the audio out of DVDA discs and save as MLP or convert to FLAC, it'll even pull tags for most discs.  Works with any DVD drive.  Use the GUI or there's a command line tool dvdae.



My LA Woman DVD-Audio


SACD is a harder one to deal with.  The discs won't read in regular DVD drives, so you need to either get the one special PS3 that will run Linux and read SACDs, or recent news says it can be done by connecting to a port on the newer Oppo players (model Oppo 105D is reported to work).  Otherwise, go fish on bittorrent for the ISOs.

Once you have the SACD ISO files, sacd_extract will turn them into .dsf files that Kodi will play.
Look about for sacd_extract-0.3.8-1.144.x86_64.rpm or source, I started off building from source but found a SUSE Linux RPM that works fine on Fedora.  Example command line:

sacd_extract -m -s -i BatOutOfHell.iso

And chmod a+x on the directory it creates, otherwise my Kodi players with NFS access can't play the files!  On some recent conversions to .dsf (the -s option) I've been getting a loud POP at the end of each song, so I switched to using the -p flag (Philips .dff format) instead of the -s and the problem has gone away.  I don't know if it's a problem with the disc, Kodi or sacd_extract but I've not had it happen before.

My Bat Out Of Hell SACD

Blu-Ray - to move your discs online the best tool I've used is makemkv, it'll open any type of DVD or Blu-Ray disc and extract the content unchanged to .mkv files.  That right, it doesn't "reencode" or compress anything.  If you want to compress or convert to another format, use a tool for that, Handbrake or just ffmpeg.  There's a lot of bugs and problems with Handbrake, I'd not use it for extracting.  Example command line:

ffmpeg -i mpeg2movie.mkv -c:v libx264 -crf 17 mpeg4movie.mkv





If you get an error like below, it means your blu-ray drive doesn't understand the new key/disc that just came out and has therefore bricked itself.  That's right, it won't even read the old discs it use to.
The only fix I know of it to upgrade to a newer release of makemkv, which somehow "unbricks" the blu-ray drive and your problem is solved.

"Tip for everyone, MakeMKV displays the AACS version of the disc before you open the disc. Don't try to open the disc if the disc is higher than the current version that is supported by MakeMKV, which is v63."

Probably best to get the flatpak distro now and run:

flatpak run com.makemkv.MakeMKV

Can't read AACS VID from disc - most likely current AACS host certificate is revoked by your drive

See MKB for the story.


Saturday, September 23, 2017

Android best apps and tips


Android and Linux desktop integration




Want to get SMS message and be able to reply to them from your desktop?

How about drag and drop pictures from your phone to desktop with a USB cable?

Install kde-connect (yum install -y kde-connect) on your Linux desk/laptop!  And the KDE Connect app from Playstore. With this app it's easy to move files back and forth between your phone and desktop.

Or it should be, after upgrading to Fedora 29 kdeconnect stopped working.  It pairs fine, however I can't send files to my desktop anymore, after beating Google and all the settings to death I found the best advice was to use the "andftp" Android app with ssh, it works better than kdeconnect does for file sharing from your phone to your desktop.

Another way to do it is via USB cable and the simple-mtpfs Linux RPM.

Another way is Cloud sharing, get a free Gdrive account.

And of course, since we're talking Android here, you can always pop the SD card out of the phone and mount it your desktop/laptop.  I find this is the best way when you're transferring a lot of media files.


NFS on Android?  Forget it, unless you root the device.  However Kodi on Android can access your NFS server just fine.  And KDE Connect can send files back and forth, so that's what you have to live with.


gmail can't establish a reliable connection to the server - You may get this error if your device battery goes completely dead, like you left it in a drawer for several months without charging.  Then you find you can't login to Gmail or Playstore.  The fix that works for me is simply setting the date/time on the device to be current.  It's some kind of "out of range date" bug thing.

Battery

Gause meter

Monday, July 17, 2017

Remove or change a "." extension from files

There's quite a lot of convoluted advice out there on how to do this, cut the ".mp3" or other dot something extension from files, using tricky loops and funny shells.  For years I did convoluted things with sed and for loops, but recently I've switched to the simple and versatile /bin/rename command.

My example files:

locnar<117>% touch Snoop1.H264.mkv Snoop2.H264.mkv title00.mkv

locnar<118>% ls
Snoop1.H264.mkv  Snoop2.H264.mkv  title00.mkv

locnar<119>% rename ".mkv" "" *

locnar<120>% ls
Snoop1.H264  Snoop2.H264  title00

Done!



Thursday, March 16, 2017

Linux log




After fiddling about a bit this morning I was able to join a WebEx meeting
using Chrome. Type in the URL bar:

chrome://apps/

And click on the Cisco WebEx app.

If it's not there click on Web Store then select "App" on the left button
and search for "WebEx".  Install the app. (the APP, not the extension!!)

Another way I commonly use WebEx is from my Android phone and tablet.



https://www.theregister.co.uk/2017/03/21/dns_records_more_revealing_than_you_think_says_german_boffin/

uas_eh_abort_handler = many drive problems, issue went away when I swapped cables.

This happen with a brand new cable.  Over many years as a sys admin I've seen the bad SCSI (now USB) cable issue pop up again and again, with no rhyme or reason.  Known good cables fail out of the blue.  New out of the bag cables are bad.  Lesson learned, always have spare cables on hand, not just as many as you need, always buy extras, from different sources, and keep them handy.

openSUSE Tumbleweed RPMs install on Fedora 25, who knew!?!?!

There's lots of advice out there as to how to change your default boot kernel, and none of it works. At least not on Fedora 25.  What does work is install "grub-customizer" and use that to change the boot order.  No need to "update MBR", I didn't and the order stuck.

There is an issue with kernel 4.13.16-100, doesn't see my second monitor like 4.9.6-200 does.  So I'm just staying with 4.9.6-200 until I do the F25 to F27 upgrade, then I'll dig into the hows/whys if my second monitor isn't seen.

yum updateinfo list - very useful command, had not used before, try and see.

Today's PSA:

[568049.151349] IPv6: ADDRCONF(NETDEV_UP): wlp2s0: link is not ready
[568364.120021] IPv6: ADDRCONF(NETDEV_UP): wlp2s0: link is not ready
[568679.139156] IPv6: ADDRCONF(NETDEV_UP): wlp2s0: link is not ready

Unreadable time stamps on your dmesg (Captain's log) output?

This is what we call "Unix Stardates", or seconds since the kernel started. There's an easy solution,
use "dmesg -T" to produces a coherent time/date format:

[Fri Mar 23 14:33:20 2018] IPv6: ADDRCONF(NETDEV_UP): wlp2s0: link is not ready
[Fri Mar 23 14:38:35 2018] IPv6: ADDRCONF(NETDEV_UP): wlp2s0: link is not ready
[Fri Mar 23 14:43:50 2018] IPv6: ADDRCONF(NETDEV_UP): wlp2s0: link is not ready

Not to be confused with "Unix Time" (seconds since 1 January 1970), which is really a Doctor Who thing.

Mounting Nero! This maybe a disc image with .nrg or .cdi, the file comand shows:

locnar<80># file Image1.cdi
Image1.cdi: Nero CD image at 0x4B000 UDF filesystem data (version 1.5) '071215_0244'

Mount as shown below:

mount -o "loop,offset=307200" imagename.nrg /mount-point
mount -o "loop,offset=307200" Image1.cdi /mnt/sysimage







Tuesday, January 31, 2017

Fedora 21 to Fedora 25, 30, 31, 32, 33, 44 upgrade, the saga continues




Major changes happened with KDE between F21 and F22, and my .kde configs didn't work, so I stayed on F21 for a long time.  Also I was bit by the enforcement of UID must be greater than 1000 policy, if UID is under 1000 you can't login.  Took ages to figure out what was going on with this. /etc/sddm.conf has a bug.  It seems the format changed, and when you do an upgrade it saves your old sddm.conf and renames the newer version to sddm.conf.rpmnew.  How nice.  Except, the old sddm.conf file doesn't seem to work right with the new sddm.  Manually editing sddm.conf.rpmnew and adding the one whole option I wanted (allow UIDs under 1000 to login via the GUI) then mv sddm.conf.rpmnew to sddm.conf fixed the problem.  This is of course KDE 5 on Fedora 25.

Another KDE change that was a time waster to figure out, no longer can you just copy .kde to move your GUI setup to a new system, you need to copy .local and .config as well, exactly which files in those directories KDE uses I've yet to figure out.

Fedora 34! Major changes! Btrfs with compression is default. PipeWire replaces PulseAudio. Wayland replaces X11. "Things happen" with the NVIDIA driver.

Fedora 44 - root is gone! Or, disabled by default.

DON'T Upgrade?!? But I have to!!!

ALL of this sound like a headache? Happy with the version you're on? But need that one thing that's only available in a later release? Don't upgrade (or at least delay it) by launching a new release as a VM! Or, a flatpack 
youtube-dl comes to mind.....

Three easy commands for the upgrade:

dnf upgrade --refresh
dnf install dnf-plugin-system-upgrade
dnf system-upgrade download --refresh --releasever=35 --allowerasing -y
dnf system-upgrade reboot

(Below is only a problem if you try to skip ahead a few version, like F21 to F25)

And again, bit by the invalid keys issues!  Had to grab the keys and put them into /etc/pki/rpm-gpg/ by hand, then run the dnf system-upgrade again.  Also had to add the --allowerasing due to a problem with a couple of RPMs.

Get the F25 keys here, 4 in total, free, nonfree, primary, secondary:

https://rpmfusion.org/keys
https://getfedora.org/keys/

RPM-GPG-KEY-fedora-25-primary
RPM-GPG-KEY-fedora-25-secondary
RPM-GPG-KEY-rpmfusion-free-fedora-25-primary
RPM-GPG-KEY-rpmfusion-nonfree-fedora-25-primary

Add links and stir:

cd /etc/pki/rpm-gpg/
ln -s RPM-GPG-KEY-fedora-25-primary RPM-GPG-KEY-fedora-25
ln -s RPM-GPG-KEY-fedora-25-primary RPM-GPG-KEY-fedora-25-x86_64
ln -s RPM-GPG-KEY-rpmfusion-free-fedora-25-primary RPM-GPG-KEY-rpmfusion-free-fedora-25
ln -s RPM-GPG-KEY-rpmfusion-nonfree-fedora-25-primary RPM-GPG-KEY-rpmfusion-nonfree-fedora-25



Final step:
dnf system-upgrade reboot

And we're done!  Besides the key thing, Fedora Linux upgrades are pretty smooth, a few commands, one reboot and you're there, no need to wipe the disks, insert dvds, backup/restore, none of that stuff.  All data files, home dirs, network configs are preserved threw each version upgrade.  There's probably a GUI button to do as well.
Best to be on a wired connection though, as the upgrade pulls in about 3,000 packages, at least a GB of data.

Well, almost, have just done another F21 to F25 upgrade, I had to throw in a --exclude=packagename
to get by a problem.  That happens when you install weird repos with oddball packages like I do.

Now I'm up to F31, 5000+ packages to download!

My Acer Aspire i7-8700/ NVMe desktop took less than 10 minutes to upgrade from F30 to F31!

As of F37 you can still choose X11 or Wayland at login, at least with KDE. I've had strangeness running Kodi under Wayland. 

In a hurry? Upgrades taking too long? Think about removing large non-essential packages first, like LibreOffice, GIMP and friends. If you're 5 releases behind you're going to end up downloading and reinstalling those big packages 5 times. More efficient to remove and reinstall one time, after you're up and running in multiuser. One solution could be for DNF to have 2 classes of packages, OS and User. The User package upgrade could happen after the OS upgrade completes and you're rebooted and running in multiuser mode. 

USB stick boot fun, issues, gotchas


If you need to instal a new system, always use a USB stick, not the SD slot, not a SD card in a reader.

Avoid the "liveusb-creator" GUI's and use the DD command. 

Step 1, down some Fedora release as a .iso.  Plug in your USB stick, use dmesg to see what drive letter the computer assigned to the USB stick.  Use DD to write the .iso to the stick, as root or sudo.

Keep in mind, if you pick the wrong drive letter you may wipe out your internal drive!!!  The below output tells us the Samsung USB stick got drive letter B, as in /dev/sdb.

oralab<19>% dmesg

[ 3609.068811] scsi host6: usb-storage 4-2:1.0
[ 3610.403164] scsi 6:0:0:0: Direct-Access     Samsung  Flash Drive FIT  1100 PQ: 0 ANSI: 6
[ 3610.404016] sd 6:0:0:0: Attached scsi generic sg1 type 0
[ 3610.405254] sd 6:0:0:0: [sdb] 250626566 512-byte logical blocks: (128 GB/120 GiB)
[ 3610.405373] sd 6:0:0:0: [sdb] Write Protect is off
[ 3610.405376] sd 6:0:0:0: [sdb] Mode Sense: 43 00 00 00
[ 3610.405503] sd 6:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 3610.405506] sd 6:0:0:0: [sdb] Optimal transfer size 0 bytes < PAGE_SIZE (4096 bytes)
[ 3610.407571]  sdb: sdb1 sdb2 sdb3
[ 3610.408389] sd 6:0:0:0: [sdb] Attached SCSI removable disk

Take a look at df -k, make doubly certain you understand what your live file systems are!

Next step:

oralab<33># dd if=Fedora-KDE-Live-x86_64-29-1.2.iso of=/dev/sdb bs=8M status=progress oflag=direct

This may take some time, like 5 minutes for a USB2 stick, and 1 minute for a USB3 stick, and look for the "SS" letters on the computer USB port, those are your USB3 ports. Btw I'm using tcsh shell.

dd: failed to open '/dev/sdb': No medium found
Note - there are differences between umount and eject that can bite you! umount from the command line, don't use the GUI!

locnar<38># dd if=Fedora-KDE-Live-x86_64-31-1.9.iso  of=/dev/sdb bs=8M status=progress oflag=direct
221+1 records in
221+1 records out
1854996480 bytes (1.9 GB, 1.7 GiB) copied, 22.5527 s, 82.3 MB/s


oralab<33># eject /dev/sdb

Next comes the fun part, Legacy vs UEFI boot.  You *may* need to get into the BIOS (hold down F12 or enter key or del while powering up) and change the boot options, possibly set USB device to boot first, maybe change the security tab UEFI options, it depends on the machine, how old it is, what BIOS rev it has.  Also turn on virtualization support when you're in the BIOS.

Put the USB stick in (hopefully) a USB3 port and power on. Fedora releases generally make you click on the Install Disk item and select the drive to use, and/or reclaim space. Very likely you'll need to DOUBLE CLICK the drive icon and get a highlight check on the drive. This drive selection step confuses a lot of users. 

Final step, reboot from the Fedora Live menu, DON'T just the turn the computer off and on again! 


Fedora 29 Linux on Acer Aspire TC-885-UR17 Desktop with NVME, hold down Delete key while booting, BIOS/peripheral setting and change the SSD/NVME to ahci, by default a lot of laptops now have them set in RAID which doesn't work right in Linux.

Just installed an Acer Aspire TC-1660-UA92, the only hard part was finding the ahci setting in the BIOS/boot menu.

terminate called after throwing an instance of 'libdnf::ModulePackageContainer::EnableMultipleStreamsException'
Cannot enable multiple streams for module

What this goop means is something to do with  "dnf module", this is the fix:

dnf module reset gimp
dnf module reset maven

The above was seen when going from F30 to F31.

  dnf system-upgrade download --refresh --releasever=35 --allowerasing -y --nogpgcheck --exclude=clang12-libs-12.0.1-3.fc35
 dnf system-upgrade download --refresh --releasever=36 --allowerasing -y --exclude="compat-ffmpeg4*"
yum erase libavutil56-1:4.4.4-1.fc37 

New installs, first command:


sudo systemctl start sshd
sudo systemctl enable sshd

flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo


Sunday, December 4, 2016

Combining audio with different sample and bit rates with a video track


There's lots of way to go about changing sample rates, bit rates, merging files, and most result in noise.  There likely is a way to do it all in one sox command line, if one has a lifetime to play with sox flags, and most wav merge tools I tried produced static, but conversion to a Matroska container just worked.   The below steps are simple, and they provide the wanted result.

Audio from one source (Cannon SX260HS camera, in file 16-edgeofsteel.wav ) is at 16bit 48khz and audio from another source (Zoom H4N, in file 16-edgeofsteel2.wav) is at 24bit 96khz.  Video track is 1080p from the Cannon SX260HS (in file edgeofsteel.mov).

1) Up sample 16-edgeofsteel2.wav from 48k to 96k using sox:

sox 16-edgeofsteel2.wav 16-edgeofsteel-96.wav rate 96000

2) Put both .wav files into to a .mkv container using ffmpeg:

ffmpeg -i 16-edgeofsteel.wav  -acodec aac -strict -2 -b:a 500k 16-edgeofsteel3.mkv

ffmpeg -i 16-edgeofsteel-96.wav -acodec aac -strict -2 -b:a 500k 16-edgeofsteel4.mkv

3) Merge the .mkv files using mkvmerge:

mkvmerge -o 16-edgeofsteel-final.mkv 16-edgeofsteel3.mkv +16-edgeofsteel4.mkv

4) Combine the audio and video tracks into one file:

ffmpeg -i 16-edgeofsteel-final.mkv -i edgeofsteel.mov -acodec copy -vcodec copy 16-edgeofsteel.mkv -y

Here the results below, the transition is at 4:20:



  • --------

    Some more tricks, I mixed a track from a CD in with a live clip and kept the last 29 seconds of the live sound:

    1) Put final 29 seconds from video into aac file:

    ffmpeg -i 20140503_195452.mp4 -ss 00:04:40 -t 00:05:09 -acodec copy wolf2.aac -y

    2) Convert to FLAC:

    ffmpeg -i wolf2.aac -f flac wolf2.flac

    3) Cut 4:40 out of the studio track:

    ffmpeg -i 11.Wolf_and_Dog.flac -ss 00:00:01 -t 00:04:41 -acodec copy wolf.flac -y
    4) Convert to 48k so it matches the sample rate of the video:

    sox wolf.flac wolf48.flac rate 48000
    5) Combine the two audio tracks:

    sox wolf48.flac wolf2.flac wolftotal.flac

    6) Combine the video and complete audio track:

    ffmpeg -i wolftotal.flac -i 20140503_195452.mp4 -acodec copy -vcodec copy wolf.mkv -y

    Results below, sound transition at 4:40


    ReVamp - Wolf and Dog Live Slim's San Francisco


    Replacing audio on a video:

    ffmpeg -i 01_Sonata_Arctica_-_Wolf_And_Raven_2001.VOB -i 16_-_Wolf___Raven__Remake_2008_.flac -vcodec copy -acodec copy -map 0:v -map 1:a -strict -2 output.mp4