iSCSI disconnected when sleep (Daemon Tools for MAC)
When Mac slept, iSCSI disconnected, and the iSCSI LUN disk disappeared. This issue caused application could not open disk correctly when iSCSI connected again.
When Mac slept, iSCSI disconnected, and the iSCSI LUN disk disappeared. This issue caused application could not open disk correctly when iSCSI connected again.
ROCKPro64 is single board computer (SBC) equipped with a PCIe x4 open ended slot. I'm planing to replace my Buffalo NAS mother board, and reuse the Buffalo NAS case.
According to compatibility list, ROCKPro64 supports 6 ports SATA card, Ziyituod SATA Card ASM 1062+1093 6-Port.
But I purchased one 10 ports SATA card, 10port 4x 1xJMB575 + 1xASM1166.
Table of Contents
When using vi
editor in Synology SSH session, the ACL changed upon saving. This causes issue for permission sensitive application, such as SSH.
The vi
command creates a new file, and write new contents into that file, and the new file doesn't follow the ACL of original file.
If SSH is not available, for example, the permission authorized_keys
changed, and only public key access was opened. If the file was shared, GUI is allowed to change ACL in user's home directory.
The ACL page can be accessed using following steps.
Properties
Permission
TabIn Synology, use following command to check file ACL
/usr/syno/bin/synoacltool -get <PATH>
To remove ACL, using following command
/usr/syno/bin/synoacltool -del <PATH>
For example, remove @users group from usbshare1
/usr/syno/sbin/synoshare --setuser usbshare1 RW - "@users"
More options can be found using following command
/usr/syno/bin/synoacltool -h
Table of Contents
The iMac might not auto sleep sometimes, so what do you like to do before you go for quick snack? Turn off iMac display only. But there is not switch on monitor, luckily there are some ways to do.
Go to login screen
Then at the login screen
Go to login screen
Then at the login screen
Run the following command:
pmset displaysleepnow
[How to Turn Off Your Mac's Display Without Putting Your Computer to Sleep}(https://www.iclarified.com/76166/how-to-turn-off-your-macs-display-without-putting-your-computer-to-sleep)
Table of Contents
Many days headache was fixed this morning...
The problem with iCloud on my newly installed MacOS, which is High Sierra, 10.13.6, out of support by Apple.
The machine was installed via Internet, and the MacOS was Mountain Lion, then upgraded to High Sierra, the lastest can be installed in this 2011 iMac.
When connecting to iCloud at beginning, the iCloud can not sync Keychains, it is quite an issue for me, because I need to register all credentials to this iMac separately.
Then I decided to reconfigure iCloud by re-login to iCloud again.
But iCloud could not be registered any more after logout, I thought it could be issue with my unsupported OS.
The symptom was repeating asking for iCloud user and password, no matter which iCloud I like to use. In the email account list, the account is just appear in very short period, then closed immediately.
This morning I tried to send email, found out that I could not add iCloud account, I decided to search solution in Internet.
The solution works for delete all files related to iCloud and system configuration. It is works for my newly configured iMac, because I have nothing in it.
Run following commands in terminal
rm ~/Library/Application Support/iCloud
rm ~/Library/Preferences/com.apple.systempreferences.plist01
rm ~/Library/Keychains
Then reboot
sudo reboot
Table of Contents
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo rpi-update
cat /proc/cpuinfo
discover information about the Raspberry Pi's CPU
cat /proc/meminfo
displays details about the Raspberry Pi's memory.
cat /proc/partitions
reveals the size and number of partitions on your SD card or HDD.
cat /proc/version
shows you which version of the Pi you are using.
vcgencmd measure_temp
reveals the CPU temperature (vital if you're concerned about airflow).
vcgencmd get_mem arm && vcgencmd get_mem gpu
will reveal the memory split between the CPU and GPU, which can be adjusted in the config screen.
free -o -h
will display the available system memory.
top d1
checks the load on your CPU, displaying details for all cores.
sudo shutdown -h now
will commence the shutdown process with immediate effect.
sudo shutdown -h 21:55
Schedule a timed shutdown at 21:55
Raspberry Pi Terminal Commands: A Quick Guide for Raspberry Pi Users
To configure the restart policy for a container, use the --restart flag when using the docker run command. The value of the --restart flag can be any of the following:
Flag | Description |
---|---|
no | Do not automatically restart the container. (the default) |
on-failure | Restart the container if it exits due to an error, which manifests as a non-zero exit code. |
always | Always restart the container if it stops. If it is manually stopped, it is restarted only when Docker daemon restarts or the container itself is manually restarted. (See the second bullet listed in restart policy details) |
unless-stopped | Similar to always, except that when the container is stopped (manually or otherwise), it is not restarted even after Docker daemon restarts. |
Following command set restart policy of container redis to unless-stopped
.
docker update --restart unless-stopped redis
Table of Contents
In order to have bad SD card worry-free, I decided to convert Armbian root filesystem to btrfs and move to Synology iSCSI LUN.
/boot
and root (/
) partitionThis step needs to have another SD card, which needs to be able to hold all the original SD card files.
Insert the new SD card via USB card reader
Identify the SD card device name using lsblk
command, normally should be /dev/sda
Format SD card to have two partitions, such as
/dev/sda1 2048 4196351 4194304 2G 83 Linux
/dev/sda2 4196352 33554431 29358080 14G 83 Linux
Note: There are some soft link in /boot
filesystem, if /dev/sda1
is vfat, those soft link files will not be copied. I'm not sure if any issue will be encountered.
Boot from SD - system on SATA, USB or NVMe
Select /dev/sda2
as destination to install system to /dev/sda2
Select btrfs as filesystem type, after that, the system will format /dev/sda2
and transfer all files into this new partition.
Now, the system should have two filesystems
/
), which is in new USB drive/boot
that binds to /media/mmcboot
, which point to SD card, /dev/mmcblk0p1
./boot
to /dev/sda1
We create the partition /dev/sda1
has same filesystem type as original partition, and maintain the same structure /boot as well.
mkfs.ext4 /dev/sda1
mount /dev/sda1 /mnt
cp -a /boot /mnt
Note: The boot partition files can be in subdirectory of /mnt/boot
, as well as in /mnt
. If they are in /mnt/, then the path in
/etc/fstab` needs to be changed. If failed to do this, the system is still bootable, just can not mount boot filesystem and taking time to scan filesystems as well.
Note: This should have been updated., because the root (/
) is already running on new SD card
/
) filesystem and /boot
filesystem.blkid
/mnt/boot/armbianEnv.txt
to root UUID if required.rootdev=UUID=1c82450c-9013-43d9-9554-1049c264bfb8
Update root (/
) filesystem UUID in /etc/fstab
if required.
Update /boot
filesystem UUID in /etc/fstab
if required.
Now, the system should have /boot
and root (/
) filesystems on new SD card.
apt install open-iscsi
/etc/iscsi/initiatorname.iscsi
, update following lineInitiatorName=<YOUR_INITIATOR_NAME>
Note: The YOUR_INITIATOR_NAME is the iSCSI client name
/etc/iscsi/iscsid.conf
, update following linesnode.session.auth.authmethod = CHAP
node.session.auth.username = <YOUR_USERNAME>
node.session.auth.password = <YOUR_PASSWORD>
iscsid
service and restart itsystemctl enable iscsid
systemctl restart iscsid
# iscsiadm --mode discovery --type sendtargets --portal <YOUR_TARGET_IP>
# iscsiadm --mode node --targetname <YOUR_TARGET_NAME> --portal <YOUR_TARGET_IP> --login
Note: If can not login, restart iscsid
and try again.
systemctl restart iscsid
Use lsblk
command to identify device file, normally should be /dev/sda
.
Creating two partitions using fdisk, the first partition is to prepare following for future used, such as
/dev/sda1 2048 2099199 2097152 1G 83 Linux
/dev/sda2 2099200 33554431 31455232 15G 83 Linux
Note: The first partition can be used for iSCSI boot or /boot
filesystem backup
This is to enable kernel load iscsi driver during boot up
touch /etc/iscsi/iscsi.initramfs
update-initramfs -v -k $(uname -r) -c
extraargs=ip=<ip_address>::<gateway>:<mask>:<host>:<interface_name>::<dns0>:<dns1>: ISCSI_INITIATOR=<ISCSI_INITIATOR> ISCSI_TARGET_NAME=<ISCSI_TARGET_NAME> ISCSI_TARGET_IP=<ISCSI_TARGET_IP> ISCSI_TARGET_PORT=3260 ISCSI_USERNAME=<YOUR_USERNAME> ISCSI_PASSWORD=<YOUR_PASSWORD> rw
Note: This includes IP configuration for fix IP. If use dhcp, just change to ip=dhcp
Make sure the iSCSI drive automatically loaded after reboot, and IP address assigned correctly.
This is to confirm that iSCSI is working during reboot.
Disable iscsid service stop action is to prevent reboot hanging issue.
There is no need to logout as Allow multiple sessions is set to true in Synology iSCSI Target configuration, and the iSCSI Initiator used in both kernel and iscsid configure are the same.
systemctl edit --full open-iscsi.service
Comment out following line
#ExecStop=/lib/open-iscsi/logout-all.sh
Boot from SD - system on SATA, USB or NVMe
Select /dev/sda2
as destination to install system to /dev/sda2
Select btrfs as filesystem type, then the system will format /dev/sda2
, and transfer all files into this new partition.
Once completed, reboot the system
Now, the system should have two filesystems
/
), which is in iSCSI drive/boot
, binds to /media/mmcboot
, which point to SD card, mmcblk0p1./boot/boot.scr
To make sure /boot/boot.scr
is up to date, run following command is necessary especially if /boot/boot.cmd
was modified.
mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr
/boot
to iSCSImkfs.ext4 /dev/sda1
/dev/sda1
mount /dev/sda1 /mnt
cp -a /boot /mnt
umount /mnt
/boot
SD cardAssuming the new SD card is named as /dev/sdb
Create /boot
partition using fdisk
Create filesystem
mkfs.ext4 /dev/sdb1
mount /dev/sdb1 /mnt
cp -a /boot /mnt
umount /mnt
Find out /dev/sdb1
UUID using command blkid
Modify /etc/fstab
Update /boot
filesystem UUID, which should be under /media/mmcboot
entry.
Change SD card to the new card and reboot
Thinking of how to use rest of space in SD card. Maybe can use it as bcache caching device to reduce the network traffic.
quick way to create SD card with separate /boot and / partitions?
Mounting the root filesystem via NFS (nfsroot)
Setting a Static IP Address Using the Kernel Command Line
Shutdown hang on 16.04 with iscsi targets
mkimage - Generate image for U-Boot
How to install to eMMC, NAND, SATA & USB?
Diskless iSCSI boot with PXE HOWTO
Table of Contents
To select correct SD card for correct task, SD card speed is important.
Although SD card is not a sequential writing device, but it is still has fragmentation issue.
SD Standard for Video Recording
Introduction to SD Card Classes and Speeds
A guide to speed classes for SD and microSD Cards