LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware - Installation (https://www.linuxquestions.org/questions/slackware-installation-40/)
-   -   mounting cifs from the installer (https://www.linuxquestions.org/questions/slackware-installation-40/mounting-cifs-from-the-installer-4175727876/)

timsoft 08-09-2023 05:59 AM

mounting cifs from the installer
 
Hi all,
I want to use the slackware64 15.0 installer media for some data recovery,
so, I boot to the dvd, bring the network up with dhcpcd (dhcp client), create a mount point, and attempt to mount the cifs/samba mount from my local server (ip obfuscated)
Code:

dhcpcd
mkdir /mnt/smb1
mount //x.y.z.q/myshare /mnt/smb1

and it gives the error
Quote:

mount: /mnt/smb1: unknown filesystem type 'cifs'.
how can I mount cifs shares from the install media ?

note: I have no problems post installation, but for data recovery, the point is I want the data off the drive, so I can't install anything. (and just in case anyone suggests just plug the drive into another pc, it is an old ide drive, and is not recognised with my sata-ide adapter, but is readable on the old pc.)

Petri Kaukasoina 08-09-2023 07:52 AM

Some ideas:

1. Use ssh
Code:

(cd /directory/from && tar c *) | ssh x.y.z.q 'cd /directory/to && tar x'
2. Or mount using nfs.

3.If you want to use cifs, you can install needed stuff to the system. Not to the hard disk: the installer OS runs in ram. Copy what is needed from another 15.0 system.
Code:

ssh x.y.z.q 'tar c /sbin/mount.cifs /lib64/libcap-ng.so.0.0.0'|(cd / && tar x)
ldconfig

Does the smb mount work now?

timsoft 08-09-2023 08:45 AM

unfortunately, trying the first method gives
Quote:

tar: This does not look like a tar archive
tar:Exiting with failure status due to previous errors
and trying the second method fails on the mount with
Quote:

mount error:cifs filesytem not supported by the system
mount error(19): No such device
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log mesages (dmesg)
I checked and /sbin/mount.cifs is present and executable, as is /lib64/libcap-ng.so.0.0.0

thanks for the suggestions. any more ideas?

Emerson 08-09-2023 08:56 AM

2. You need to fire up NFS server for NFS mounting to work.

Petri Kaukasoina 08-09-2023 09:25 AM

I just tried the first (ssh) one here with an install USB. It worked here. I think your .bashrc prints some rubbish. Try
Code:

$ ssh username@x.y.z.q echo Hello
Hello
$

If it prints anything else, you need to clean your .bashrc.

Petri Kaukasoina 08-09-2023 09:27 AM

Quote:

Originally Posted by Petri Kaukasoina (Post 6447222)
I think your .bashrc prints some rubbish.

Or you have redefined 'cd' to print some rubbish.
Code:

ssh username@x.y.z.q 'cd /'
should not print anything.

Petri Kaukasoina 08-09-2023 09:39 AM

And I tried the cifs mount: didn't work out here either. The cifs module is on the install image, but it doesn't work.

'modprobe cifs' complains:
Code:

modprobe: ERROR: could not insert 'cifs': Unknown symbol in module, or unknown parameter (see dmesg)
and dmesg tells:
Code:

cifs: Unknown symbol cifs_md4_final (err -2)
cifs: Unknown symbol cifs_arc4_setkey (err -2)
cifs: Unknown symbol cifs_arc4_crypt (err -2)
cifs: Unknown symbol cifs_md4_init (err -2)
cifs: Unknown symbol cifs_md4_update (err -2)

If I had to guess, it's because of mismatch between 'huge' kernel and 'generic' modules.

timsoft 08-09-2023 11:01 AM

Petri:
hmm. running
Code:

ssh root@x.y.z.q echo hello
prints hello (after putting in the password)
running
Code:

ssh root@x.y.z.q 'cd /'
prints out nothing. (after putting in the password)
i tried again by cd'ing into the directory to recover, then running
Code:

tar c *|ssh root@x.y.z.q 'cd /destination/path && tar x'
and it seems to work. so that is a workaround for now, thanks.

I get the same errors in dmesg as you do, regarding cifs mounting, although it looks like it boots the huge kernel, and that should have cifs support compiled in.

mounting cifs from the installer "should" work, (it has been one of the options in a network install for ages) so it is worth reporting to Pat.

Petri Kaukasoina 08-09-2023 11:26 AM

I managed to load the cifs module like this. Copy a few additional modules in addition to the other files as before.

Code:

ssh x.y.z.q 'tar c /sbin/mount.cifs /lib64/libcap-ng.so.0.0.0 /lib/modules/5.15.19/kernel/fs/netfs/netfs.ko /lib/modules/5.15.19/kernel/fs/smbfs_common/cifs_arc4.ko /lib/modules/5.15.19/kernel/fs/smbfs_common/cifs_md4.ko'|(cd / && tar x)
ldconfig
insmod /lib/modules/5.15.19/kernel/fs/netfs/netfs.ko
insmod /lib/modules/5.15.19/kernel/fs/smbfs_common/cifs_arc4.ko
insmod /lib/modules/5.15.19/kernel/fs/smbfs_common/cifs_md4.ko
modprobe cifs

After that the cifs mount might work! I don't have a smb server to try with, so it timed out trying to connect to a non-existant server.

The insmod commands above should not have been necessary if I had managed to run depmod but it didn't seem to work. Got this output of 'depmod':
Code:

depmod: can't change directory to /5.15.19': No such file or directory

Petri Kaukasoina 08-09-2023 11:31 AM

Quote:

Originally Posted by timsoft (Post 6447234)
i tried again by cd'ing into the directory to recover, then running
Code:

tar c *|ssh root@x.y.z.q 'cd /destination/path && tar x'
and it seems to work. so that is a workaround for now, thanks.

Great! Last month I copied files from my Windows laptop gone to reboot loop just like this. Now it's a Linux laptop...
Quote:

it boots the huge kernel, and that should have cifs support compiled in.
No, CONFIG_CIFS=m in config-huge-5.15.19.x64.

timsoft 08-09-2023 02:12 PM

yes I just checked, and as there are no modules in the initrd it doesn't work. I guess i'll raise a request for current to get CONFIG_CIFS=Y (and CONFIG_EXFAT=Y while we're at it) in the huge config. That would allow cifs to actually work in the setup, and also allow mounting exfat drives which are becoming more common these days. I have my internal slackware repo on a samba share, so it is really usefull to have access at install time.

rkelsen 08-30-2023 12:10 AM

Quote:

Originally Posted by timsoft (Post 6447200)
I want to use the slackware64 15.0 installer media for some data recovery

Alien Bob's Slackware Live is probably a better tool for this job: https://download.liveslak.org/

The installer's kernel contains exactly what it needs to install Slackware, and not really much else. While it can be used for system recovery in certain circumstances, as you've found, it has its limits.


All times are GMT -5. The time now is 10:25 AM.