Re: [Astlinux-users] USB disk automount in Astlinux

2023-04-29 Thread Ionel Chila via Astlinux-users
Gonzalo

I backup my PBX in 2 places.

1. I have a permanent USB disk mounted as /mnt/kd/USB/ and a script in the 
crontab takes care of the backup:

0 4 * * * tar czf /mnt/kd/USB/backup.`date "+%Y-%m-%d"`.tar.gz $(ls -1 /mnt/kd/ 
| sed -e "s/^cdr-.*//" -e "s/^USB$//" -e "s/^monitor$//" -e "s/^voicemail$//") 
-C /mnt/kd


2. My NAS running UnRaid also pulls a backup from the USB drive remotely via 
scp. You need to do the ssh key setup and so it does not prompt you for 
password. I do pull backups remotely from all my IOT and other devices.

#!/bin/bash
scp -r exile@192.168.0.15:/mnt/kd/USB/*gz  /mnt/user/IOT-BKP/AST-PBX/





> On Apr 29, 2023, at 4:52 AM, Gonzalo  wrote:
> 
> Hi,
> 
> Thank you Ionel and Lonnie.
> 
> The idea was to mount the disk not only at startup but each time the disk is 
> plugged and keep it switched off most of the time but I'll have to mount it 
> with a custom script instead of automatically.
> I have a remote controlled switch which I use to power on the disk each time 
> I want to perform a backup.
> 
> Regards.
> ___
> Astlinux-users mailing list
> Astlinux-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/astlinux-users
> 
> Donations to support AstLinux are graciously accepted via PayPal to 
> pay...@krisk.org.

___
Astlinux-users mailing list
Astlinux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/astlinux-users

Donations to support AstLinux are graciously accepted via PayPal to 
pay...@krisk.org.

Re: [Astlinux-users] USB disk automount in Astlinux

2023-04-29 Thread Lonnie Abelbeck
> The idea was to mount the disk not only at startup but each time the disk is 
> plugged and keep it switched off most of the time but I'll have to mount it 
> with a custom script instead of automatically.

Gonzalo, Make certain you 'umount' before unplugging or powering down the USB 
disk.

Periodic network/cloud backups also work well.

BTW, AstLinux supports a 'wol-host' command to wake a network device that 
supports Wake-on-LAN ... some testing is required for particular hardware.
--
Usage: wol-host [options...] ipv4_addr|name

Options:
  --mac MACManually define the MAC address, aa:bb:cc:dd:ee:ff, default 
none/auto-lookup
  -p pass  Append aa:bb:cc:dd[:ee:ff] password to the WoL packet, default 
none
  -P, --ping   Follow WoL packet with a series of ICMP (ping) packets to host.
  -t secs  Max time (in secs) to send ping packets, default 180
  -v   Verbose mode
  -h, --help   Show this help text
--
So, if everything works correctly, an AstLinux script could initiate a backup 
by first sending a WoL packet to wake a network file server, perform the backup 
and then let the network file server sleep after a period of inactivity.

Lonnie




> On Apr 29, 2023, at 4:52 AM, Gonzalo  wrote:
> 
> Hi,
> 
> Thank you Ionel and Lonnie.
> 
> The idea was to mount the disk not only at startup but each time the disk is 
> plugged and keep it switched off most of the time but I'll have to mount it 
> with a custom script instead of automatically.
> I have a remote controlled switch which I use to power on the disk each time 
> I want to perform a backup.
> 
> Regards.
> ___
> Astlinux-users mailing list
> Astlinux-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/astlinux-users
> 
> Donations to support AstLinux are graciously accepted via PayPal to 
> pay...@krisk.org.



___
Astlinux-users mailing list
Astlinux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/astlinux-users

Donations to support AstLinux are graciously accepted via PayPal to 
pay...@krisk.org.


Re: [Astlinux-users] USB disk automount in Astlinux

2023-04-29 Thread Gonzalo
Hi,

Thank you Ionel and Lonnie.

The idea was to mount the disk not only at startup but each time the disk is 
plugged and keep it switched off most of the time but I'll have to mount it 
with a custom script instead of automatically.
I have a remote controlled switch which I use to power on the disk each time I 
want to perform a backup.

Regards.___
Astlinux-users mailing list
Astlinux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/astlinux-users

Donations to support AstLinux are graciously accepted via PayPal to 
pay...@krisk.org.

Re: [Astlinux-users] USB disk automount in Astlinux

2023-04-28 Thread Ionel Chila via Astlinux-users
Yes I do LOL.  How did that get in there? When?  How many years ago :) I had 
this PBX for like 15 years or so.  Told you I am an idiot :)


HOME-PBX durep # cat /mnt/kd/rc.local 
##

disk_dev="/dev/sdb1"
disk_mnt="/mnt/kd/USB"

mkdir -p "$disk_mnt"
echo "$disk_dev $disk_mnt ext3 noauto,noatime 0 0" >> /tmp/etc/fstab

e2fsck -y "$disk_dev" >/dev/null

echo "Mounting device '$disk_dev' at '$disk_mnt'"
mount "$disk_mnt" >/dev/null
##
HOME-PBX durep # 




> On Apr 28, 2023, at 8:32 PM, Lonnie Abelbeck  
> wrote:
> 
> /mnt/kd/rc.local 

___
Astlinux-users mailing list
Astlinux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/astlinux-users

Donations to support AstLinux are graciously accepted via PayPal to 
pay...@krisk.org.

Re: [Astlinux-users] USB disk automount in Astlinux

2023-04-28 Thread Lonnie Abelbeck
Ionel, are you certain you don't have a 'mount' command in either 
/mnt/kd/rc.local or /mnt/kd/rc.elocal ?

Lonnie



> On Apr 28, 2023, at 7:13 PM, Ionel Chila via Astlinux-users 
>  wrote:
> 
> Lonnie,  I got nothing in /etc/udev/rules.d  LOL.
> 
> The fstab is the only thing I changed and it works fine every reboot
> 
> I guess old school Linux :) Sorry for providing the wrong guidance :)
> 
> 
> [1.684661] usb-storage 1-3:1.0: USB Mass Storage device detected
> [1.685122] scsi host4: usb-storage 1-3:1.0
> [2.715504] scsi 4:0:0:0: Direct-Access SanDisk  Ultra Fit1.00 
> PQ: 0 ANSI: 6
> [2.716621] sd 4:0:0:0: [sdb] 240254976 512-byte logical blocks: (123 
> GB/115 GiB)
> [2.717849] sd 4:0:0:0: [sdb] Write Protect is off
> [2.717906] sd 4:0:0:0: [sdb] Mode Sense: 43 00 00 00
> [2.718997] sd 4:0:0:0: [sdb] Write cache: disabled, read cache: enabled, 
> doesn't support DPO or FUA
> [2.736198]  sdb: sdb1
> [2.739593] sd 4:0:0:0: [sdb] Attached SCSI removable disk
> [6.112418] EXT4-fs (sda2): mounted filesystem without journal. Opts: 
> (null)
> [6.692360] EXT4-fs (sda2): mounted filesystem without journal. Opts: 
> (null)
> [6.735574] udevd[182]: starting version 3.2.11
> [6.737703] random: udevd: uninitialized urandom read (16 bytes read)
> [6.738816] random: udevd: uninitialized urandom read (16 bytes read)
> [6.739044] random: udevd: uninitialized urandom read (16 bytes read)
> [6.755549] udevd[183]: starting eudev-3.2.11
> [6.775029] 8139too: 8139too Fast Ethernet driver 0.9.28
> [6.783055] VMware vmxnet3 virtual NIC driver - version 1.5.0.0-k-NAPI
> [6.799976] e1000: Intel(R) PRO/1000 Network Driver
> [6.800028] e1000: Copyright (c) 1999-2006 Intel Corporation.
> [6.807499] e1000e: Intel(R) PRO/1000 Network Driver
> [6.807552] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
> [6.807973] e1000e :01:00.0: Interrupt Throttling Rate (ints/sec) set 
> to dynamic conservative mode
> [6.849361] e1000e :01:00.0 :01:00.0 (uninitialized): registered 
> PHC clock
> [6.894442] e1000e :01:00.0 eth0: (PCI Express:2.5GT/s:Width x1) 
> 00:22:4d:9f:68:57
> [6.894514] e1000e :01:00.0 eth0: Intel(R) PRO/1000 Network Connection
> [6.894580] e1000e :01:00.0 eth0: MAC: 3, PHY: 8, PBA No: FF-0FF
> [6.904842] igb: Intel(R) Gigabit Ethernet Network Driver
> [6.904894] igb: Copyright (c) 2007-2014 Intel Corporation.
> [6.930470] Intel(R) 2.5G Ethernet Linux Driver
> [6.930519] Copyright(c) 2018 Intel Corporation.
> [   12.783015] EXT4-fs (sda3): mounted filesystem without journal. Opts: 
> (null)
> [   17.855384] random: crng init done
> [   17.855438] random: 5 urandom warning(s) missed due to ratelimiting
> [   18.429089] dahdi: loading out-of-tree module taints kernel.
> [   18.430757] dahdi: Version: 3.2.0
> [   18.432068] dahdi: Telephony Interface Registered on major 196
> [   22.500961] wctdm24xxp :02:00.0: Port 1: Installed -- AUTO FXO (FCC 
> mode)
> [   22.501025] wctdm24xxp :02:00.0: Port 2: Installed -- AUTO FXS/DPO
> [   22.501070] wctdm24xxp :02:00.0: Port 3: Installed -- AUTO FXS/DPO
> [   22.501115] wctdm24xxp :02:00.0: Port 4: Installed -- AUTO FXS/DPO
> [   22.502438] wctdm24xxp :02:00.0: Found a Wildcard TDM: Wildcard 
> TDM410P (0 BRI spans, 4 analog channels)
> [   22.511330] dahdi_echocan_oslec: Registered echo canceler 'OSLEC'
> [   22.522642] dahdi_echocan_mg2: Registered echo canceler 'MG2'
> [   23.793592] w83627ehf: Found W83627DHG-P chip at 0x290
> [   25.210820] e1000e :01:00.0 eth0: NIC Link is Up 1000 Mbps Full 
> Duplex, Flow Control: Rx/Tx
> [   28.547237] EXT4-fs (sdb1): mounting ext3 file system using the ext4 
> subsystem
> [   28.693669] EXT4-fs (sdb1): mounted filesystem with ordered data mode. 
> Opts: (null)
> [   33.390794] sched: RT throttling activated
> 
> 
> HOME-PBX etc # df -h
> FilesystemSize  Used Available Use% Mounted on
> /dev/root10.5M  9.5M393.0K  96% /oldroot
> devtmpfs512.0K 0512.0K   0% /dev
> none144.7M144.7M 0 100% /
> none  9.8M152.0K  9.6M   2% /tmp
> none  9.8M312.0K  9.5M   3% /var
> none512.0K 0512.0K   0% /dev/shm
> none512.0K 0512.0K   0% /mnt/unionfs
> /dev/sda2   983.1M309.7M623.4M  33% /mnt/asturw
> none144.7M144.7M 0 100% 
> /mnt/unionfs/asturo/etc
> unionfs   1.1G454.4M623.4M  42% /mnt/unionfs/union/etc
> unionfs   1.1G454.4M623.4M  42% /etc
> none144.7M144.7M 0 100% 
> /mnt/unionfs/asturo/stat
> unionfs   1.1G454.4M623.4M  42% 
> /mnt/unionfs/union/stat
> unionfs   1.1G454.4M  

Re: [Astlinux-users] USB disk automount in Astlinux

2023-04-28 Thread Ionel Chila via Astlinux-users
Lonnie,  I got nothing in /etc/udev/rules.d  LOL.

The fstab is the only thing I changed and it works fine every reboot

I guess old school Linux :) Sorry for providing the wrong guidance :)


[1.684661] usb-storage 1-3:1.0: USB Mass Storage device detected
[1.685122] scsi host4: usb-storage 1-3:1.0
[2.715504] scsi 4:0:0:0: Direct-Access SanDisk  Ultra Fit1.00 
PQ: 0 ANSI: 6
[2.716621] sd 4:0:0:0: [sdb] 240254976 512-byte logical blocks: (123 GB/115 
GiB)
[2.717849] sd 4:0:0:0: [sdb] Write Protect is off
[2.717906] sd 4:0:0:0: [sdb] Mode Sense: 43 00 00 00
[2.718997] sd 4:0:0:0: [sdb] Write cache: disabled, read cache: enabled, 
doesn't support DPO or FUA
[2.736198]  sdb: sdb1
[2.739593] sd 4:0:0:0: [sdb] Attached SCSI removable disk
[6.112418] EXT4-fs (sda2): mounted filesystem without journal. Opts: (null)
[6.692360] EXT4-fs (sda2): mounted filesystem without journal. Opts: (null)
[6.735574] udevd[182]: starting version 3.2.11
[6.737703] random: udevd: uninitialized urandom read (16 bytes read)
[6.738816] random: udevd: uninitialized urandom read (16 bytes read)
[6.739044] random: udevd: uninitialized urandom read (16 bytes read)
[6.755549] udevd[183]: starting eudev-3.2.11
[6.775029] 8139too: 8139too Fast Ethernet driver 0.9.28
[6.783055] VMware vmxnet3 virtual NIC driver - version 1.5.0.0-k-NAPI
[6.799976] e1000: Intel(R) PRO/1000 Network Driver
[6.800028] e1000: Copyright (c) 1999-2006 Intel Corporation.
[6.807499] e1000e: Intel(R) PRO/1000 Network Driver
[6.807552] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
[6.807973] e1000e :01:00.0: Interrupt Throttling Rate (ints/sec) set to 
dynamic conservative mode
[6.849361] e1000e :01:00.0 :01:00.0 (uninitialized): registered PHC 
clock
[6.894442] e1000e :01:00.0 eth0: (PCI Express:2.5GT/s:Width x1) 
00:22:4d:9f:68:57
[6.894514] e1000e :01:00.0 eth0: Intel(R) PRO/1000 Network Connection
[6.894580] e1000e :01:00.0 eth0: MAC: 3, PHY: 8, PBA No: FF-0FF
[6.904842] igb: Intel(R) Gigabit Ethernet Network Driver
[6.904894] igb: Copyright (c) 2007-2014 Intel Corporation.
[6.930470] Intel(R) 2.5G Ethernet Linux Driver
[6.930519] Copyright(c) 2018 Intel Corporation.
[   12.783015] EXT4-fs (sda3): mounted filesystem without journal. Opts: (null)
[   17.855384] random: crng init done
[   17.855438] random: 5 urandom warning(s) missed due to ratelimiting
[   18.429089] dahdi: loading out-of-tree module taints kernel.
[   18.430757] dahdi: Version: 3.2.0
[   18.432068] dahdi: Telephony Interface Registered on major 196
[   22.500961] wctdm24xxp :02:00.0: Port 1: Installed -- AUTO FXO (FCC mode)
[   22.501025] wctdm24xxp :02:00.0: Port 2: Installed -- AUTO FXS/DPO
[   22.501070] wctdm24xxp :02:00.0: Port 3: Installed -- AUTO FXS/DPO
[   22.501115] wctdm24xxp :02:00.0: Port 4: Installed -- AUTO FXS/DPO
[   22.502438] wctdm24xxp :02:00.0: Found a Wildcard TDM: Wildcard TDM410P 
(0 BRI spans, 4 analog channels)
[   22.511330] dahdi_echocan_oslec: Registered echo canceler 'OSLEC'
[   22.522642] dahdi_echocan_mg2: Registered echo canceler 'MG2'
[   23.793592] w83627ehf: Found W83627DHG-P chip at 0x290
[   25.210820] e1000e :01:00.0 eth0: NIC Link is Up 1000 Mbps Full Duplex, 
Flow Control: Rx/Tx
[   28.547237] EXT4-fs (sdb1): mounting ext3 file system using the ext4 
subsystem
[   28.693669] EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts: 
(null)
[   33.390794] sched: RT throttling activated


HOME-PBX etc # df -h
FilesystemSize  Used Available Use% Mounted on
/dev/root10.5M  9.5M393.0K  96% /oldroot
devtmpfs512.0K 0512.0K   0% /dev
none144.7M144.7M 0 100% /
none  9.8M152.0K  9.6M   2% /tmp
none  9.8M312.0K  9.5M   3% /var
none512.0K 0512.0K   0% /dev/shm
none512.0K 0512.0K   0% /mnt/unionfs
/dev/sda2   983.1M309.7M623.4M  33% /mnt/asturw
none144.7M144.7M 0 100% /mnt/unionfs/asturo/etc
unionfs   1.1G454.4M623.4M  42% /mnt/unionfs/union/etc
unionfs   1.1G454.4M623.4M  42% /etc
none144.7M144.7M 0 100% /mnt/unionfs/asturo/stat
unionfs   1.1G454.4M623.4M  42% /mnt/unionfs/union/stat
unionfs   1.1G454.4M623.4M  42% /stat
/dev/sda357.5G 25.9G 28.6G  48% /mnt/kd
/dev/sda1   191.7M130.4M 61.3M  68% /oldroot/cdrom
/dev/sdb1   112.2G  6.6G 99.9G   6% /mnt/kd/USB
HOME-PBX etc # 


> On Apr 28, 2023, at 6:58 PM, Lonnie Abelbeck  
> wrote:
> 
> /etc/udev/rules.d 

___

Re: [Astlinux-users] USB disk automount in Astlinux

2023-04-28 Thread Lonnie Abelbeck
Ionel, Did you have to edit/add anything to /etc/udev/rules.d to make that 
work?  Puzzled.

Gonzalo, If you only wanted it to mount on startup, create /mnt/kd/rc.local and 
make script executable (vfat example).

-- /mnt/kd/rc.local --
#!/bin/sh

DISK="/dev/sdb1"
DISK_MP="/tmp/USB"

mkdir -p "$DISK_MP"

if [ -e "$DISK" ]; then
 mount -t vfat $DISK $DISK_MP
fi
--

Make the script executable
# chmod +x /mnt/kd/rc.local

Now, on each reboot, the USB drive will be mounted if it exists.

AstLinux does not support any automount functionally.

Lonnie


> On Apr 28, 2023, at 5:55 PM, Ionel Chila via Astlinux-users 
>  wrote:
> 
> A line in /etc/fstab will do the trick. Figure out what what dev is your USB 
> drive and the partition type and change the line accordingly 
> 
> My example below is for my 256G USB drive I use for backing up my configs
> 
> /dev/sdb1 /mnt/kd/USB ext3 noauto,noatime 0 0
> 
> 
> 
> 
>> On Apr 28, 2023, at 5:34 PM, Gonzalo  wrote:
>> 
>> Hi,
>> 
>> What would be the best way to configure automount for an external usb disk 
>> in Astlinux?
>> 
>> The goal is to get the disk mounted automatically on a fixed path every time 
>> the disk is plugged into Astlinux box.
>> 
>> Thanks.
>> ___
>> Astlinux-users mailing list
>> Astlinux-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/astlinux-users
>> 
>> Donations to support AstLinux are graciously accepted via PayPal to 
>> pay...@krisk.org.
> 
> ___
> Astlinux-users mailing list
> Astlinux-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/astlinux-users
> 
> Donations to support AstLinux are graciously accepted via PayPal to 
> pay...@krisk.org.



___
Astlinux-users mailing list
Astlinux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/astlinux-users

Donations to support AstLinux are graciously accepted via PayPal to 
pay...@krisk.org.


Re: [Astlinux-users] USB disk automount in Astlinux

2023-04-28 Thread Ionel Chila via Astlinux-users
A line in /etc/fstab will do the trick. Figure out what what dev is your USB 
drive and the partition type and change the line accordingly 

My example below is for my 256G USB drive I use for backing up my configs

/dev/sdb1 /mnt/kd/USB ext3 noauto,noatime 0 0




> On Apr 28, 2023, at 5:34 PM, Gonzalo  wrote:
> 
> Hi,
> 
> What would be the best way to configure automount for an external usb disk in 
> Astlinux?
> 
> The goal is to get the disk mounted automatically on a fixed path every time 
> the disk is plugged into Astlinux box.
> 
> Thanks.
> ___
> Astlinux-users mailing list
> Astlinux-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/astlinux-users
> 
> Donations to support AstLinux are graciously accepted via PayPal to 
> pay...@krisk.org.

___
Astlinux-users mailing list
Astlinux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/astlinux-users

Donations to support AstLinux are graciously accepted via PayPal to 
pay...@krisk.org.