Thursday, July 20, 2023

CH340 setup on RPI 4 with Ubuntu 64bit

 CH340 setup on RPI 4 with Ubuntu 64bit 


based on : 

Remove the Brile for the blind - it will mess up work with COM port and CH340.
sudo apt remove -y brltty
(source https://askubuntu.com/questions/1403705/dev-ttyusb0-not-present-in-ubuntu-22-04)


source: https://learn.sparkfun.com/tutorials/how-to-install-ch340-drivers/all


  • cd into the directory where the files are saved
  • make clean
  • make
  • sudo make load
  • sudo rmmod ch341 to uninstall the broken driver
  • lsmod | grep ch34 to list what modules are currently installed
  • Plug and unplug your CH340 device again on the USB port
  • dmesg
    • Expected output (should show "ch34x" now):
[  xxx] ch34x ttyUSB0: ch34x converter now disconnected from ttyUSB0
[  xxx] ch34x 3-2:1.0: device disconnected

Depending on your root permissions, you may need to configure the serial port with the following two commands. Make sure to adjust the $username with respect to the user ID that is currently logged in.

sudo usermod -a -G dialout $username 
sudo chmod a+rw /dev/ttyUSB0

Wednesday, July 19, 2023

cloning bootable SSD / HDD / NVME

 cloning bootable SSD / HDD / NVME  

* target disk - make it GPT 

* tool used AoMei Partition Assistan 10.1.0

* the system clone wizard does not work !


Use bootable USB tool to clone 4 usual windows 10 / 11 partitions one by one 

this way the partitions will keep it content type and status 

then 

* open command prompt 


diskpart the target disk

list volumes 

IMPORTANT - not partitions but volumes 

select volume X

 assign letter=N:

exit 

>N:

check the letter that the target system disk has  assuming C: but if D: does not matter

>bcdboot C:\windows /s N: /f UEFI


reboot 


* On Boot will give a boot options menu. 

* Usually first will work but - try other.

* when booted ok 

* run msconfig as Administrator 

* -> boot tab - delete the not working boot options. 

reboot


DONE


=====

when moving from MBR to GPT drive 

need to create a EFI partition - this one is exactly what works and takes few minutes https://www.tenforums.com/installation-upgrade/52837-moving-recreating-efi-partition.html#post698559

Can be done from any WinPE not only Windows install media

- Boot the computer using the Windows 7/8/8.1/10 installation media.
- On the first screen, press SHIFT+F10 to bring up the command prompt.
- Run the following commands at the command prompt.

diskpart
list disk
select disk # Note: Select the disk where you want to add the EFI System partition.
list partition
select partition # Note: Select the Windows OS partition (# number) or your data partition.
shrink desired=100
create partition efi size=100
format quick fs=fat32
assign letter=s

list partition
list volume Note: Note the volume letter where the Windows OS is installed.
exit

bcdboot X:\windows /s S:
Note: Replace "X" with the volume letter of the Windows OS partition.

BCDBoot copies the boot files from the Windows partition to the EFI System partition and creates the BCD store in the same partition.

Remove the Windows installation media and restart the computer into your BIOS settings and set the SSD as the First Boot Device.



Friday, May 05, 2023

Setting up Raspberry pi 4 with Ubuntu for Java 17

 Setting up Raspberry pi 4 with Ubuntu for Java 17 

download ubuntu from https://ubuntu.com/download/raspberry-pi direct link 

https://cdimage.ubuntu.com/releases/22.04.2/release/ubuntu-22.04.2-preinstalled-desktop-arm64+raspi.img.xz

use raspberry imager https://www.raspberrypi.com/software/

direct link
https://downloads.raspberrypi.org/imager/imager_latest.exe


write it to the SD card 

insert into Rpi and follow the steps of the wizard.

create user "pi" 

Goto Settings -> Power disable the lockscreen !  

if RPI with small screen and resolution less than FUL HD 

Goto settings->Displays set resolution 1920x1080 Must set Fractional Scaling!

Goto Settings ->"Sharing" enable it all to have access from PC with Remote Desktop. 

* set your password instead of the default!! 

Goto terminal and become root

sudo su -l

install additional software 

apt update 

this will take time... 

apt upgrade  

now install all the usefil soft 

apt install -y samba mc doublecmd-gtk net-tools alien  mosquitto mosquitto-clients byobu mlocate wget ant maven busybox build-essential cmake curl mc git g++ gzip htop python-all-dev python-all python3-pip python3 rsync zip nedit code openjdk-17-jdk openjdk-17-jre nodejs


Remove the Brile for the blind - it will mess up work with COM port and CH340.
sudo apt remove -y brltty

Enable Samba for network sharing:

  Follow steps from here https://www.debugpoint.com/guide-how-share-folder-between-ubuntu-linux-windows/

notice the 

sudo smbpasswd -a pi

create same password as the ubuntu login - convenient !

under root follow the steps from 

https://adoptium.net/blog/2021/12/eclipse-temurin-linux-installers-available/

close root terminal!


Goto terminal 

ssh-keygen -t ed25519 -b 4096 -C "boris@daich.biz" -f /home/pi/.ssh/id_rsa

copy the id_rsa.pub contents to the source control server keys bitbucket or github...

https://bitbucket.org/account/settings/ssh-keys/


do git clone ... 


install VS Code 

download the deb package https://code.visualstudio.com/download take the arm64 version!!

do 

sudo apt install ./<file>.deb

details are here  https://code.visualstudio.com/docs/setup/linux

open VS code install plugins for java


 

Sunday, April 23, 2023

QNAP RAID recovery

 Situation:

one of the RAID disks failed.

there is one good disk. 

How to recover (copy all files to another disk)

1. Have the good disk connected to some SATA to USB.  

2. Install Ubuntu 22.04 

    * it can be Hyper-V VM on windows 

    * The HDD need to be conected to the PC over USB. in the "Windows Disk Management" r-click the disk and "offline" it. Then go to VM settings and attach physical disk to the VM. 

2. install some relevant tools 

    sudo apt install -y lvm2 mdadm mc partitionmanager

3. create mount point 

    sudo mkdir /mnt/test

4. Open ubuntu disks (part of the default install see in the list of applications) and find the linux name of the partition you want to mount it would be something like 

/dev/sdd3 

it type would be "Linux RAID member" 

5. do the following 

mdadm --assemble --run /dev/md0 /dev/sdd3 

* if it say that the disk is busy - check may be it already mapped to some other /dev/md* i did not researched the reason for that.  

now there is a new device /dev/md0 

lvmdiskscan

lvscan

vgchange -ay

lvs 

lvdisplay

look among logical volumes for something like "LV Path" looks like  /dev/vg288/lv4

mount -o ro /dev/vg288/lv4 /mnt/test

Now the RAID disk should be available at the path  /mnt/test/....


Done.



Followers