WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: samba4 not working  (Read 9864 times)

Offline njs

  • Newbie
  • *
  • Posts: 25
Re: samba4 not working
« Reply #15 on: October 10, 2017, 07:55:00 PM »
Also, I cannot seem to even create an smb.conf.  Even using "sudo" I get "-sh: can't create sbm.conf: Permission denied"

Please post the command-line you're trying.

I tried to create a file with the editor application in the GUI and that failed so I also tried the following (to create the first line of the file) and it failed with "-sh: can't create sbm.conf: Permission denied"

Quote
sudo echo [global] > sbm.conf

Offline polikuo

  • Hero Member
  • *****
  • Posts: 758
Re: samba4 not working
« Reply #16 on: October 10, 2017, 10:59:19 PM »
sudo echo [global] > sbm.conf

Redirections don't work that way
You should do it this way:
Code: [Select]
sudo sh -c 'echo [global] > sbm.conf'
Or switching to superuser:
Code: [Select]
$ sudo su
# echo [global] > sbm.conf

Offline njs

  • Newbie
  • *
  • Posts: 25
Re: samba4 not working
« Reply #17 on: October 10, 2017, 11:07:10 PM »
Thanks. I clearly have a kindergarten level working knowledge of Linux! I'm just trying to set up a platform so I can focus on developing my actual application but its a real barrier at every turn.

Now once I create this .conf file do I also need to go through the filetool process as well so I don't lose it?
« Last Edit: October 10, 2017, 11:37:27 PM by njs »

Offline polikuo

  • Hero Member
  • *****
  • Posts: 758
Re: samba4 not working
« Reply #18 on: October 10, 2017, 11:55:10 PM »
Now once I create this .conf file do I also need to go through the filetool process as well so I don't lose it?

If it's not in /home or /opt; then yes, you'll have to add it to /opt/.filetool.lst for backup.  ;)

Offline DrRob

  • Jr. Member
  • **
  • Posts: 61
Re: samba4 not working
« Reply #19 on: October 11, 2017, 08:16:19 AM »
sudo echo [global] > sbm.conf

By the way, probably just a typo in your post but you want filename smb.conf, not sbm.conf.

Offline DrRob

  • Jr. Member
  • **
  • Posts: 61
Re: samba4 not working
« Reply #20 on: October 11, 2017, 08:28:41 AM »
...I'm just trying to set up a platform so I can focus on developing my actual application but its a real barrier at every turn...

Do you need to use PiCore during development, rather than one of the "standard" Pi OSes such as Raspbian?

PiCore has some unique features - for my projects, it is the ability to load everything required from SD card into RAM, to make it more resilient to unexpected loss of power.  But that characteristic comes at a cost, such as having to remember to persist changes, package management being completely different, and the filesystem layout being a bit different to Raspbian.

I don't know what your app is, but could you develop it in Raspbian, then switch to PiCore at the deployment stage?

Offline njs

  • Newbie
  • *
  • Posts: 25
Re: samba4 not working
« Reply #21 on: October 11, 2017, 09:53:43 PM »
My app is a wireless IoT wildlife camera. It is actually already mostly developed on Raspian / DietPi, although I have a backlog of refinements to make.  As far as the OS I am trying to optimize boot time (DietPi is nearly 30 sec) and increase reliability (i've seen unexplained SD corruption once already with DietPi).

I need to get python set up with multiple packages that are not available as existing TC extensions and I want to setup Samba share for convenience during development (e.g. editing python script from my Windows PC, etc.)
« Last Edit: October 11, 2017, 09:58:05 PM by njs »

Offline DrRob

  • Jr. Member
  • **
  • Posts: 61
Re: samba4 not working
« Reply #22 on: October 12, 2017, 03:44:08 PM »
...I am trying to optimize boot time (DietPi is nearly 30 sec)...

I'm using a Pi Zero W, and I haven't timed the bootup time, but I don't think it's significantly quicker than that.  Possibly slower.  The package system makes the system flexible but slows down the boot time.

I need to get python set up with multiple packages that are not available as existing TC extensions and I want to setup Samba share for convenience during development (e.g. editing python script from my Windows PC, etc.)

TC extensions are fairly easy to build if a standard package doesn't provide what you need, but if you have to build your own then you take on the maintenance of those packages as well (e.g. they may need updating to work with a newer version of PiCore).

If the samba share does work out, you could edit files on your PC and then scp or rsync updates onto the Pi (via ssh, so it doesn't need anything special on the Pi).

Offline njs

  • Newbie
  • *
  • Posts: 25
Re: samba4 not working
« Reply #23 on: October 13, 2017, 12:31:38 AM »
I got samba working thanks to your awesome instructions.

I am also using pi zero and my boot time is in the 15-20 sec range per dmesg...
Code: [Select]
...
[    0.229901] Trying to unpack rootfs image as initramfs...
[    0.662759] Freeing initrd memory: 4464K (dbb94000 - dbff0000)
[    0.684829] hw perfevents: enabled with armv6_1176 PMU driver, 3 counters available
[    0.686405] workingset: timestamp_bits=14 max_order=17 bucket_order=3
[    0.697663] zbud: loaded
[    0.700454] FS-Cache: Netfs 'nfs' registered for caching
[    0.701610] NFS: Registering the id_resolver key type
[    0.701649] Key type id_resolver registered
[    0.701654] Key type id_legacy registered
[    0.707815] jitterentropy: Initialization failed with host not compliant with requirements: 2
[    0.707935] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[    0.708189] io scheduler noop registered
[    0.708198] io scheduler deadline registered (default)
[    0.708496] io scheduler cfq registered
[    0.712667] BCM2708FB: allocated DMA memory 5b100000
[    0.712708] BCM2708FB: allocated DMA channel 0 @ dc80d000
[    0.739356] Console: switching to colour frame buffer device 228x61
[    0.761728] bcm2835-rng 20104000.rng: hwrng registered
[    0.761847] vc-cma: Videocore CMA driver
[    0.761854] vc-cma: vc_cma_base      = 0x00000000
[    0.761861] vc-cma: vc_cma_size      = 0x00000000 (0 MiB)
[    0.761864] vc-cma: vc_cma_initial   = 0x00000000 (0 MiB)
[    0.762161] vc-mem: phys_addr:0x00000000 mem_base=0x1ec00000 mem_size:0x20000000(512 MiB)
[    0.780786] brd: module loaded
[    0.790011] loop: module loaded
[    0.790027] Loading iSCSI transport class v2.0-870.
[    0.790750] usbcore: registered new interface driver smsc95xx
[    0.790770] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[    1.016365] Core Release: 2.80a
[    1.016376] Setting default values for core params
[    1.016403] Finished setting default values for core params
[    1.216325] Using Buffer DMA mode
[    1.216336] Periodic Transfer Interrupt Enhancement - disabled
[    1.216339] Multiprocessor Interrupt Enhancement - disabled
[    1.216345] OTG VER PARAM: 0, OTG VER FLAG: 0
[    1.216414] Dedicated Tx FIFOs mode
[    1.216923] WARN::dwc_otg_hcd_init:1053: FIQ DMA bounce buffers: virt = 0xdb114000 dma = 0x5b114000 len=9024
[    1.216947] FIQ FSM acceleration enabled for :
[    1.216947] Non-periodic Split Transactions
[    1.216947] Periodic Split Transactions
[    1.216947] High-Speed Isochronous Endpoints
[    1.216947] Interrupt/Control Split Transaction hack enabled
[    1.216954] dwc_otg: Microframe scheduler enabled
[    1.217014] WARN::hcd_init_fiq:459: FIQ on core 0 at 0xc0466f8c
[    1.217023] WARN::hcd_init_fiq:460: FIQ ASM at 0xc0467268 length 36
[    1.217040] WARN::hcd_init_fiq:486: MPHI regs_base at 0xdc8a5000
[    1.217096] dwc_otg 20980000.usb: DWC OTG Controller
[    1.217142] dwc_otg 20980000.usb: new USB bus registered, assigned bus number 1
[    1.217229] dwc_otg 20980000.usb: irq 56, io mem 0x00000000
[    1.217273] Init: Port Power? op_state=1
[    1.217277] Init: Power Port (0)
[    1.217545] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    1.217557] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.217565] usb usb1: Product: DWC OTG Controller
[    1.217571] usb usb1: Manufacturer: Linux 4.9.22-piCore dwc_otg_hcd
[    1.217577] usb usb1: SerialNumber: 20980000.usb
[    1.218468] hub 1-0:1.0: USB hub found
[    1.218531] hub 1-0:1.0: 1 port detected
[    1.219244] dwc_otg: FIQ enabled
[    1.219250] dwc_otg: NAK holdoff enabled
[    1.219255] dwc_otg: FIQ split-transaction FSM enabled
[    1.219272] Module dwc_common_port init
[    1.219650] usbcore: registered new interface driver usb-storage
[    1.219996] mousedev: PS/2 mouse device common for all mice
[    1.221188] bcm2835-wdt 20100000.watchdog: Broadcom BCM2835 watchdog timer
[    1.221550] bcm2835-cpufreq: min=700000 max=1000000
[    1.221998] sdhci: Secure Digital Host Controller Interface driver
[    1.222003] sdhci: Copyright(c) Pierre Ossman
[    1.222345] sdhost-bcm2835 20202000.sdhost: could not get clk, deferring probe
[    1.222567] sdhci-pltfm: SDHCI platform and OF driver helper
[    1.223098] ledtrig-cpu: registered to indicate activity on CPUs
[    1.223249] hidraw: raw HID events driver (C) Jiri Kosina
[    1.223450] usbcore: registered new interface driver usbhid
[    1.223454] usbhid: USB HID core driver
[    1.224385] vchiq: vchiq_init_state: slot_zero = 0xdb180000, is_master = 0
[    1.226365] Initializing XFRM netlink socket
[    1.226405] NET: Registered protocol family 17
[    1.226537] Key type dns_resolver registered
[    1.228386] registered taskstats version 1
[    1.228547] zswap: loaded using pool lzo/zbud
[    1.316247] Key type encrypted registered
[    1.316539] vc-sm: Videocore shared memory driver
[    1.316552] [vc_sm_connected_init]: start
[    1.317555] [vc_sm_connected_init]: end - returning 0
[    1.322678] 20201000.serial: ttyAMA0 at MMIO 0x20201000 (irq = 81, base_baud = 0) is a PL011 rev2
[    1.322759] console [ttyAMA0] enabled
[    1.324588] sdhost: log_buf @ db113000 (5b113000)
[    1.396817] mmc0: sdhost-bcm2835 loaded - DMA enabled (>1)
[    1.417002] of_cfs_init
[    1.417109] of_cfs_init: OK
[    1.417597] uart-pl011 20201000.serial: no DMA platform data
[    1.418683] Freeing unused kernel memory: 400K (c085c000 - c08c0000)
[    1.418688] This architecture does not have kernel memory protection.
[    1.455041] Indeed it is in host mode hprt0 = 00021501
[    1.521054] random: fast init done
[    1.574714] mmc0: host does not support reading read-only switch, assuming write-enable
[    1.576877] mmc0: new high speed SDHC card at address 59b4
[    1.581317] mmcblk0: mmc0:59b4 00000 29.8 GiB
[    1.624933]  mmcblk0: p1 p2
[    1.756875] usb 1-1: new high-speed USB device number 2 using dwc_otg
[    1.757050] Indeed it is in host mode hprt0 = 00001101
[    2.067478] usb 1-1: New USB device found, idVendor=1a40, idProduct=0101
[    2.067493] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    2.067499] usb 1-1: Product: USB 2.0 Hub
[    2.068477] hub 1-1:1.0: USB hub found
[    2.068610] hub 1-1:1.0: 4 ports detected
[    2.416890] usb 1-1.2: new low-speed USB device number 4 using dwc_otg
[    2.554912] usb 1-1.2: New USB device found, idVendor=1c4f, idProduct=0034
[    2.554928] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    2.554936] usb 1-1.2: Product: Usb Mouse
[    2.554942] usb 1-1.2: Manufacturer: SIGMACHIP
[    2.569512] input: SIGMACHIP Usb Mouse as /devices/platform/soc/20980000.usb/usb1/1-1/1-1.2/1-1.2:1.0/0003:1C4F:0034.0001/input/input0
[    2.570073] hid-generic 0003:1C4F:0034.0001: input,hidraw0: USB HID v1.10 Mouse [SIGMACHIP Usb Mouse] on usb-20980000.usb-1.2/input0
[    2.666966] usb 1-1.3: new low-speed USB device number 5 using dwc_otg
[    2.808777] usb 1-1.3: New USB device found, idVendor=413c, idProduct=2003
[    2.808792] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    2.808799] usb 1-1.3: Product: Dell USB Keyboard
[    2.808805] usb 1-1.3: Manufacturer: Dell
[    2.825500] input: Dell Dell USB Keyboard as /devices/platform/soc/20980000.usb/usb1/1-1/1-1.3/1-1.3:1.0/0003:413C:2003.0002/input/input1
[    2.887860] hid-generic 0003:413C:2003.0002: input,hidraw1: USB HID v1.10 Keyboard [Dell Dell USB Keyboard] on usb-20980000.usb-1.3/input0
[    3.307757] gpiomem-bcm2835 20200000.gpiomem: Initialised: Registers at 0x20200000
[    3.857888] zram: Added device: zram0
[    3.904931] zram0: detected capacity change from 0 to 106430464
[    3.927148] Adding 103932k swap on /dev/zram0.  Priority:-1 extents:1 across:103932k SSFS
[    4.177377] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    5.638882] EXT4-fs (mmcblk0p2): recovery complete
[    5.643471] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    6.055935] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[   14.742861] i2c /dev entries driver
[   19.440835] random: crng init done

This is with with the following onboot.lst:
Code: [Select]
openssh.tcz
readline.tcz
firmware-ralinkwifi.tcz
wifi.tcz
samba4.tcz
i2c-tools.tcz
rtc-4.9.22-piCore.tcz

cmdline.txt:
Code: [Select]
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 root=/dev/ram0 elevator=deadline rootwait quiet nortc loglevel=3 noembed waitusb=1

and config.txt:
Code: [Select]
initramfs 9.0.3.gz followkernel
kernel kernel4922.img
cmdline cmdline.txt
...
initial_turbo=30
arm_freq=1000
gpu_freq=500
core_freq=500
sdram_freq=500
sdram_schmoo=0x02000020
over_voltage=2
sdram_over_voltage=2
#dtoverlay=sdhost,overclock_50=84

Loading extensions for Python + all the modules my app needs will undoubtedly add a lot more time to boot, but I should be able to speed things back up by this technique: http://forum.tinycorelinux.net/index.php/topic,20711.msg129294/topicseen.html#msg129294 to load wifi, ssh, samba etc. after my app is up and running

Offline DrRob

  • Jr. Member
  • **
  • Posts: 61
Re: samba4 not working
« Reply #24 on: October 13, 2017, 03:09:57 AM »
I am also using pi zero and my boot time is in the 15-20 sec range per dmesg...

I have /mnt/mmcblk0p2/tce/copy2fs.flg so that all extensions are loaded into RAM at boot, and then the SD card partition gets unmounted.  Seems safer, but that adds to boot up time.  onboot.lst contains:

Code: [Select]
w1-4.9.22-piCore.tcz
mc.tcz
openssh.tcz
firmware-rpi3-wireless.tcz
wifi.tcz
requests.tcz
pyinfluxdb.tcz
rpi-vc.tcz

which results in dmesg ending:

Code: [Select]
[    3.722558] gpiomem-bcm2835 20200000.gpiomem: Initialised: Registers at 0x20200000
[    4.266170] zram: Added device: zram0
[    4.319183] zram0: detected capacity change from 0 to 106156032
[    4.346338] Adding 103664k swap on /dev/zram0.  Priority:-1 extents:1 across:103664k SSFS
[    4.655151] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    7.477899] EXT4-fs (mmcblk0p2): recovery complete
[    7.480982] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    7.707177] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[   21.777788] Driver for 1-wire Dallas network protocol.
[   21.779851] w1-gpio onewire@0: gpio pin 4, external pullup pin -1, parasitic power 0
[   21.779889] w1_add_master_device: set_pullup requires write_byte or touch_bit, disabling
[   22.853016] usbcore: registered new interface driver brcmfmac
[   22.951449] brcmfmac: Firmware version = wl0: May 27 2016 00:13:38 version 7.45.41.26 (r640327) FWID 01-df77e4a7
[   24.074855] i2c /dev entries driver
[   24.127136] uart-pl011 20201000.serial: no DMA platform data
[   25.644115] brcmfmac: power management disabled
[  356.012500] random: crng init done

I've no idea why that last line comes after such a long gap.  Also, not sure at what point the wi-fi connection is up, as that's when my application (a heating system monitor, and later, control too).

I have another project using a Pi version 1 model B, with onboot.lst:

Code: [Select]
mc.tcz
openssh.tcz
samba4.tcz
bash.tcz
curl.tcz
lftp.tcz
gawk.tcz
rpi-vc.tcz
mutagen.tcz
sox.tcz

and dmesg ending:

Code: [Select]

[    4.262045]  sda: sda1
[    4.266119] sd 0:0:0:0: [sda] Attached SCSI removable disk
[    4.428706] gpiomem-bcm2835 20200000.gpiomem: Initialised: Registers at 0x20200000
[    4.733112] zram: Added device: zram0
[    4.906648] zram0: detected capacity change from 0 to 52543488
[    4.936480] Adding 51308k swap on /dev/zram0.  Priority:-1 extents:1 across:51308k SSFS
[    5.420546] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    7.213699] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    7.377363] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[   34.661679] i2c /dev entries driver
[   35.100922] NET: Registered protocol family 10
[   35.361342] random: crng init done
[   35.399562] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[   35.495912] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
[   36.804036] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xD1E1

which receives recordings from a networked audio recorder installed in the sound desk at the church I attend, processes them and uploads the results to an FTP site for linking into the church website.  This is the one I needed Samba for, as the network recorder only knows how to upload to a Windows share.

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14848
Re: samba4 not working
« Reply #25 on: October 13, 2017, 07:54:48 AM »
You don't need openssl.tcz in the lists below as it is a recursive dep of one or more of the other extensions.

Offline DrRob

  • Jr. Member
  • **
  • Posts: 61
Re: samba4 not working
« Reply #26 on: October 14, 2017, 02:53:30 AM »
You don't need openssl.tcz in the lists below as it is a recursive dep of one or more of the other extensions.

Which list are you referring to?  I can't see openssl.tcz in any of them...

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14848
Re: samba4 not working
« Reply #27 on: October 14, 2017, 03:40:43 AM »
Oops, sorry - I confused openssh with openssl  :-[

Offline DrRob

  • Jr. Member
  • **
  • Posts: 61
Re: samba4 not working
« Reply #28 on: October 23, 2017, 10:14:25 AM »
Loading extensions for Python + all the modules my app needs will undoubtedly add a lot more time to boot, but I should be able to speed things back up by this technique: http://forum.tinycorelinux.net/index.php/topic,20711.msg129294/topicseen.html#msg129294 to load wifi, ssh, samba etc. after my app is up and running

In another thread (http://forum.tinycorelinux.net/index.php/topic,20709.msg129945.html#msg129945), someone brought my attention to a script that can build a single extension file from all the extensions you're using, which loads quicker and uses less memory.  I haven't tried it yet, but I think it may be of use to you too.