date
int64 1,220B
1,719B
| question_description
stringlengths 28
29.9k
| accepted_answer
stringlengths 12
26.4k
| question_title
stringlengths 14
159
|
---|---|---|---|
1,424,716,405,000 |
I am having issues getting autofs to mount user's home directories via NFS. I have an NFS client (client.home) and an NFS server (server.home). Both systems are CentOS 7.4. SELinux is running in permissive mode on both systems.
Can anyone point me into the right direction so I can automount user's home directories?
NFS Export Table on server
[root@server ~]# exportfs -v
/home/tim
client.home(rw,sync,wdelay,hide,no_subtree_check,sec=sys,secure,root_squash,no_all_squash)
The client can see these exports
[root@client ~]# showmount -e server
Export list for server:
/home/tim client.home
There are two users. One on the client, and one on the server. They both have the same name and UID. However, the user's home directory is only located on server.home.
[tim@server ~]$ id
uid=1001(tim) gid=1001(tim) groups=1001(tim)
context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
-bash-4.2$ hostname
client.home
-bash-4.2$ id
uid=1001(tim) gid=1001(tim) groups=1001(tim)
context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
This directory should automount for user tim on client.home. Unfortunately, that does not seem to happen.
[root@client ~]# su - tim
-bash-4.2$ id
uid=1001(tim) gid=1001(tim) groups=1001(tim)
context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
-bash-4.2$ cd /home/tim
-bash: cd: /home/tim: No such file or directory
-bash-4.2$ ls /home
vagrant
Even though, I believe I have set up my auto.master file correctly.
[root@client ~]# cat /etc/auto.master
#
# Sample auto.master file
# This is a 'master' automounter map and it has the following format:
# mount-point [map-type[,format]:]map [options]
# For details of the format look at auto.master(5).
#
/misc /etc/auto.misc
#
# NOTE: mounts done from a hosts map will be mounted with the
# "nosuid" and "nodev" options unless the "suid" and "dev"
# options are explicitly given.
#
/net -hosts
#
# Include /etc/auto.master.d/*.autofs
# The included files must conform to the format of this file.
#
+dir:/etc/auto.master.d
#
# Include central master map if it can be found using
# nsswitch sources.
#
# Note that if there are entries for /net or /misc (as
# above) in the included master map any keys that are the
# same will not be seen as the first read key seen takes
# precedence.
#
+auto.master
/home /etc/auto.home
And the contents of my /etc/auto.home
[root@client /]# cat /etc/auto.home
* nfs4,rw &:/home/&
I would expect that I should be able to simply cd into the user's home directory. Instead, when autofs.service is running, I can't even create any files in /home.
[root@client /]# systemctl is-active autofs
active
[root@client /]# touch /home/test
touch: cannot touch ‘/home/test’: Permission denied
[root@client home]# ll -d /home
drwxr-xr-x. 2 root root 0 Sep 16 02:04 /home
[root@client /]# systemctl stop autofs
[root@client /]# systemctl is-active autofs
inactive
[root@client /]# touch /home/test
[root@client /]# ls /home
test vagrant
EDIT:
I can manually mount the NFS shares. Also, I am pretty sure the strange permissions issues from before were due to the root_squash option I had set in the /etc/exports file.
[root@client ~]# mount -t nfs4 -o rw server.home:/home/tim /mnt
[root@client ~]# df -t nfs4
Filesystem 1K-blocks Used Available Use% Mounted on
server.home:/home/tim 39269760 1192448 38077312 4% /mnt
[root@client ~]# ll -d /mnt
drwx------. 2 tim tim 86 Sep 16 18:51 /mnt
|
I figured it out. I was editing the /etc/auto.master on the server when I should have been doing it on the client. That is, on the client add the following to /etc/auto.master
/home/ /etc/auto.home
Still on the client, create the /etc/auto.home file and add the following to it
* -nfs4,rw &:/home/&
Finally restart autofs (on the client)
$ systemctl restart autofs
And that should do it. It is important to note that the user on the client should be the same as on the server (same username, same UID). This is usually accomplished using LDAP. Also, the home directory should only exist on the server, as autofs will create the mount point on the client for you.
| Autofs Issues Mounting NFS Home Directories (CentOS 7.4) [closed] |
1,424,716,405,000 |
I'm on CentOS 6.6 and I'm having a strange problem with autofs.
I'm trying to mount an smb share on /var/www/html/mysite/docfolder, so I created a docfolder inside the mysite folder, ran chmod 777 on it, then added:
/var/www/html/mysite/docfolder /etc/auto.docfolder --ghost
in /etc/auto.master . Then i created auto.docfolder under /etc and inside it:
pdf -fstype=cifs,rw,noperm,user=username,pass=password ://myshare/docs
When I run
sudo /sbin/service autofs restart
inside /var/log/messages I can read:
Jun 18 12:19:53 Rtmbssrv automount[30779]: do_mount_autofs_indirect: failed to mount autofs path /var/www/html/mysite/docfolder at /var/www/html/mysite/docfolder
Jun 18 12:19:53 Rtmbssrv automount[30779]: handle_mounts: mount of /var/www/html/mysite/docfolder failed!
So I tried stopping the service and running it manually:
sudo automount -vdf
And the folder got mounted correctly without errors.
Changing the mount folder to: /mnt/docfolder works correctly every time.
What's the difference of running automount instead of launching autofs as service?
Why is the service unable to mount that folder?
Edit:
It's a SELinux related problem. I have to keep it enabled, so now the question is: how to give permission to autofs to mount file inside a apache folder, leaving it readable from the apache server?
|
Found this in my notes, from when I ran into this same thing:
Set SELinux boolean to allow Apache to access CIFS shares:
# setsebool -P httpd_use_cifs on
| autofs 'failed to mount autofs path' as service but not manually (selinux) |
1,424,716,405,000 |
Does anyone have a more comprehensive /etc/auto.disks script for autofs that takes into consideration all mounted disks, even NTFS, FAT32? So all that's needed to mount any attached drive is ls /mnt/sda1 or ls /mnt/sdb2?
This guide along the line of what I'm looking for, except this guy only accesses ext3 drives.
|
Here's what I came up with:
#!/bin/bash
key="$1"
[ -b /dev/${key} ] && {
fstype=`sudo blkid -s TYPE "/dev/$key" -o value`
opts="-fstype=$fstype,rw"
echo "$opts :/dev/${key}";
}
| Comprehensive /etc/auto.disks script for autofs that takes into consideration all mounted disks, including NTFS and FAT32? |
1,424,716,405,000 |
Is there a way to find out what is trying to mount this file?
Jul 13 14:27:24 myhost automount[13527]: lookup(file): lookup for
tmp_dir failed
Something is looking for "tmp_dir", and I've grepped a bunch of places but cannot find what script, program, etc... is looking for the file/dir and is causing automount to try and mount it up.
I see there are entries in /proc/mounts for tmp_dir, but looks like I cannot remove them since /proc/mounts is read-only (probably for good reason). Thoughts?
For a little background, we recently took down a file share that was called tmp_dir, and I think a programmer still has something pointing to tmp_dir, but he claims he cleaned everything up. I'm thinking maybe we did not umount tmp_dir properly before taking down the share, and autofs is still attempting to load it. The OS is SLES 11 SP1.
|
Here are a couple of ways to monitor accesses to particular files. I'm not completely sure how they'll interact with an automounter, but they probably will work.
Put a LoggedFS filesystem on the automount directory (/amnt or whatever), and configure it to look out for /amnt/tmp_dir. Start from the provided configuration file example and tweak the include/exclude rules according to this guide.
Get the Linux audit subsystem utilities (on any recent distribution, this should just be a matter of installing a package), and make the kernel look out for this file:
auditctl -a exit,always -w /amnt/tmp_dir
See also Determine which process is creating a file; my answer there has more explanations on LoggedFS and auditd.
| Automount lookup failed. How to determine what is trying to access the file? |
1,424,716,405,000 |
I have a laptop with an extra internal HDD and external HDD via USB that I would like to automount using autofs. Here is my auto.master:
/mnt/ /etc/auto.ext-int
/run/media/ /etc/auto.ext-usb
Auto.ext-int, which is for the internal HDD, contains:
external -fstype=auto :dev/sda1
Auto.ext-usb, which is for the external HDD, contains:
8E7633617633496B -fstype=auto :/dev/sdb
The internal HDD seems to be automounting correctly now, although it seems to break easily when I stop the service multiple times to manually use the automount with automount -f -v. The latter refuses to mount. Here is what automount -f -v displays:
Starting automounter version 5.1.7-17.fc34, master map auto.master
using kernel protocol version 5.05
can't connect to sssd, retry for 10 seconds
can't connect to sssd, retry for 10 seconds
can't connect to sssd, retry for 10 seconds
mounted indirect on /misc with timeout 300, freq 75 seconds
mounted indirect on /net with timeout 300, freq 75 seconds
mounted indirect on /mnt with timeout 300, freq 75 seconds
mounted indirect on /run/media with timeout 300, freq 75 seconds
attempting to mount entry /mnt/external
mounted /mnt/external
fdisk -l displays this info about both drives:
Disk /dev/sda: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: TOSHIBA MQ01ACF0
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 7AF52ADD-7356-4437-B499-31359675DAC1
Device Start End Sectors Size Type
/dev/sda1 2048 976773119 976771072 465.8G Linux filesystem
Disk /dev/sdb: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: 2115
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x6233580c
Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 2048 206847 204800 100M 7 HPFS/NTFS/exFAT
/dev/sdb2 206848 1953521663 1953314816 931.4G 7 HPFS/NTFS/exFAT
I am not sure why sdb cannot be mounted in this way. I can mount it with a GUI like Gigolo to /run/media/$USER/8E7633617633496B/ or through command line, but only if the autofs service hasn't ran. Even after stopping the service, I cannot mount the HDD without the error:
mount: /home: /dev/sdb already mounted or mount point busy.
Although df shows that it is clearly not mounted:
Filesystem 1K-blocks Used Available Use% Mounted on
devtmpfs 8046936 0 8046936 0% /dev
tmpfs 8066544 20500 8046044 1% /dev/shm
tmpfs 3226620 1780 3224840 1% /run
/dev/nvme0n1p3 242534400 3548988 238084340 2% /
tmpfs 8066544 544 8066000 1% /tmp
/dev/nvme0n1p3 242534400 3548988 238084340 2% /home
/dev/nvme0n1p2 999320 242532 687976 27% /boot
/dev/nvme0n1p1 613184 16524 596660 3% /boot/efi
tmpfs 1613308 56 1613252 1% /run/user/1000
This is all very confusing at this point, any help would be appreciated.
EDIT: I receive this error when attempted to cd into the external HDD from automount:
attempting to mount entry /run/media/8E7633617633496B
>> mount: /run/media/8E7633617633496B: wrong fs type, bad option, bad superblock on /dev/sdb, missing codepage or helper program, or other error.
mount(generic): failed to mount /dev/sdb (type auto) on /run/media/8E7633617633496B
failed to mount /run/media/8E7633617633496B
It also seems that I was wrong and that my internal HDD is also not mounting automatically, it will only display in ranger if I cd into it. Otherwise it displays as empty. Trying this with the external HDD does not work at all.
|
The problem is that you are using /dev/sdb in your automount definition, which is the device name for the whole drive, not an individual partition. Pick /dev/sdb1 or /dev/sdb2, and it will mount.
Also, you are using /run/media as the mount point, which the udisks2 service also uses. It will create its own mount point on top of your autofs mount, depending on the order of services starting. Choose something other than /mnt or /run/media.
| autofs/automount not mounting an external HDD |
1,424,716,405,000 |
I'm working with the DataDomain server in our Commvault solutions. Anytime this server is rebooted the network disk in use for the solution does not remount. Right now this means we need to stop some processes then run:
boostfs mount -d datastore.company.com -s Commvault /cvdisk
I didn't see a way to mount with fstab so I tried following a guide to run scripts at boot. Now I have two scripts. The first:
cat /etc/systemd/system/remountboostfs.service
[Unit]
Description=Remount boostfs commvault drive
After=network.target
[Service]
Type=simple
ExecStart=/usr/local/sbin/cvdiskmount.sh
RemainAfterExit=yes
[Install]
Wantedby=default.target
That calls the second which should handle the mounting
cat /usr/local/sbin/cvdiskmount.sh
#!/bin/bash
(cd /opt/emc/boostfs/bin && ./boostfs mount -d datastore.company.com -s Commvault /cvdisk)
After some trial and error I can confirm that the second script will remount the drive when run manual, and that the first service file is running (not not generating anything in the messages logs (not since I fixt the counting script).
Is there a better way to remount this file system on rebooting? What am I missing in the current scripts?
Edit 1:
As seen in the notes the fstab works as written:
aemb01p.salemstate.edu:Commvault /cvdisk boostfs defaults 0 0
This works perfectly, but when I tried to convert this for automount/ autofs this doesn't appear to work. No errors, notices or logs I can find.
$cat /etc/auto.master| grep cvdisk
/cvdisk /etc/auto.cvdisk --timeout 120
$cat /etc/auto.cvdisk
/ -fstype=boostfs aemb01p.salemstate.edu:Commvault
|
See page 37 of the BoostFS for Linux Configuration Guide. In there, you will see a section on using mount. For your environment, the mount command would be mount -t boostfs datastore.company.com:Commvault /cvdisk. In /etc/fstab terms:
datastore.company.com:Commvault /cvdisk boostfs defaults 0 0
| Automatically remount boostfs drive |
1,429,982,938,000 |
What is a “bind mount”? How do I make one? What is it good for?
I've been told to use a bind mount for something, but I don't understand what it is or how to use it.
|
What is a bind mount?
A bind mount is an alternate view of a directory tree. Classically, mounting creates a view of a storage device as a directory tree. A bind mount instead takes an existing directory tree and replicates it under a different point. The directories and files in the bind mount are the same as the original. Any modification on one side is immediately reflected on the other side, since the two views show the same data.
For example, after issuing the Linux command-
mount --bind /some/where /else/where
the directories /some/where and /else/where have the same content, which is the content of /some/where. (If /else/where was not empty, its previous content is now hidden.)
Unlike a hard link or symbolic link, a bind mount doesn't affect what is stored on the filesystem. It's a property of the live system.
How do I create a bind mount?
bindfs
The bindfs filesystem is a FUSE filesystem which creates a view of a directory tree. For example, the command
bindfs /some/where /else/where
makes /else/where a mount point under which the contents of /some/where are visible.
Since bindfs is a separate filesystem, the files /some/where/foo and /else/where/foo appear as different files to applications (the bindfs filesystem has its own st_dev value). Any change on one side is “magically” reflected on the other side, but the fact that the files are the same is only apparent when one knows how bindfs operates.
Bindfs has no knowledge of mount points, so if there is a mount point under /some/where, it appears as just another directory under /else/where. Mounting or unmounting a filesystem underneath /some/where appears under /else/where as a change of the corresponding directory.
Bindfs can alter some of the file metadata: it can show fake permissions and ownership for files. See the manual for details, and see below for examples.
A bindfs filesystem can be mounted as a non-root user, you only need the privilege to mount FUSE filesystems. Depending on your distribution, this may require being in the fuse group or be allowed to all users. To unmount a FUSE filesystem, use fusermount -u instead of umount, e.g.
fusermount -u /else/where
nullfs
FreeBSD provides the nullfs filesystem which creates an alternate view of a filesystem. The following two commands are equivalent:
mount -t nullfs /some/where /else/where
mount_nullfs /some/where /else/where
After issuing either command, /else/where becomes a mount point at which the contents of /some/where are visible.
Since nullfs is a separate filesystem, the files /some/where/foo and /else/where/foo appear as different files to applications (the nullfs filesystem has its own st_dev value). Any change on one side is “magically” reflected on the other side, but the fact that the files are the same is only apparent when one knows how nullfs operates.
Unlike the FUSE bindfs, which acts at the level of the directory tree, FreeBSD's nullfs acts deeper in the kernel, so mount points under /else/where are not visible: only the tree that is part of the same mount point as /some/where is reflected under /else/where.
The nullfs filesystem may be usable under other BSD variants (OS X, OpenBSD, NetBSD) but it is not compiled as part of the default system.
Linux bind mount
Under Linux, bind mounts are available as a kernel feature. You can create one with the mount command, by passing either the --bind command line option or the bind mount option. The following two commands are equivalent:
mount --bind /some/where /else/where
mount -o bind /some/where /else/where
Here, the “device” /some/where is not a disk partition like in the case of an on-disk filesystem, but an existing directory. The mount point /else/where must be an existing directory as usual. Note that no filesystem type is specified either way: making a bind mount doesn't involve a filesystem driver, it copies the kernel data structures from the original mount.
mount --bind also support mounting a non-directory onto a non-directory: /some/where can be a regular file (in which case /else/where needs to be a regular file too).
A Linux bind mount is mostly indistinguishable from the original. The command df -T /else/where shows the same device and the same filesystem type as df -T /some/where. The files /some/where/foo and /else/where/foo are indistinguishable, as if they were hard links. It is possible to unmount /some/where, in which case /else/where remains mounted.
With older kernels (I don't know exactly when, I think until some 3.x), bind mounts were truly indistinguishable from the original. Recent kernels do track bind mounts and expose the information through <code/proc/PID/mountinfo, which allows findmnt to indicate bind mount as such.
You can put bind mount entries in /etc/fstab. Just include bind (or rbind etc.) in the options, together with any other options you want. The “device” is the existing tree. The filesystem column can contain none or bind (it's ignored, but using a filesystem name would be confusing). For example:
/some/where /readonly/view none bind,ro
If there are mount points under /some/where, their contents are not visible under /else/where. Instead of bind, you can use rbind, also replicate mount points underneath /some/where. For example, if /some/where/mnt is a mount point then
mount --rbind /some/where /else/where
is equivalent to
mount --bind /some/where /else/where
mount --bind /some/where/mnt /else/where/mnt
In addition, Linux allows mounts to be declared as shared, slave, private or unbindable. This affects whether that mount operation is reflected under a bind mount that replicates the mount point. For more details, see the kernel documentation.
Linux also provides a way to move mounts: where --bind copies, --move moves a mount point.
It is possible to have different mount options in two bind-mounted directories. There is a quirk, however: making the bind mount and setting the mount options cannot be done atomically, they have to be two successive operations. (Older kernels did not allow this.) For example, the following commands create a read-only view, but there is a small window of time during which /else/where is read-write:
mount --bind /some/where /else/where
mount -o remount,ro,bind /else/where
I can't get bind mounts to work!
If your system doesn't support FUSE, a classical trick to achieve the same effect is to run an NFS server, make it export the files you want to expose (allowing access to localhost) and mount them on the same machine. This has a significant overhead in terms of memory and performance, so bind mounts have a definite advantage where available (which is on most Unix variants thanks to FUSE).
Use cases
Read-only view
It can be useful to create a read-only view of a filesystem, either for security reasons or just as a layer of safety to ensure that you won't accidentally modify it.
With bindfs:
bindfs -r /some/where /mnt/readonly
With Linux, the simple way:
mount --bind /some/where /mnt/readonly
mount -o remount,ro,bind /mnt/readonly
This leaves a short interval of time during which /mnt/readonly is read-write. If this is a security concern, first create the bind mount in a directory that only root can access, make it read-only, then move it to a public mount point. In the snippet below, note that it's important that /root/private (the directory above the mount point) is private; the original permissions on /root/private/mnt are irrelevant since they are hidden behind the mount point.
mkdir -p /root/private/mnt
chmod 700 /root/private
mount --bind /some/where /root/private/mnt
mount -o remount,ro,bind /root/private/mnt
mount --move /root/private/mnt /mnt/readonly
Remapping users and groups
Filesystems record users and groups by their numerical ID. Sometimes you end up with multiple systems which assign different user IDs to the same person. This is not a problem with network access, but it makes user IDs meaningless when you carry data from one system to another on a disk. Suppose that you have a disk created with a multi-user filesystem (e.g. ext4, btrfs, zfs, UFS, …) on a system where Alice has user ID 1000 and Bob has user ID 1001, and you want to make that disk accessible on a system where Alice has user ID 1001 and Bob has user ID 1000. If you mount the disk directly, Alice's files will appear as owned by Bob (because the user ID is 1001) and Bob's files will appear as owned by Alice (because the user ID is 1000).
You can use bindfs to remap user IDs. First mount the disk partition in a private directory, where only root can access it. Then create a bindfs view in a public area, with user ID and group ID remapping that swaps Alice's and Bob's user IDs and group IDs.
mkdir -p /root/private/alice_disk /media/alice_disk
chmod 700 /root/private
mount /dev/sdb1 /root/private/alice_disk
bindfs --map=1000/1001:1001/1000:@1000/1001:@1001/1000 /root/private/alice_disk /media/alice_disk
See How does one permissibly access files on non-booted system's user's home folder? and mount --bind other user as myself another examples.
Mounting in a jail or container
A chroot jail or container runs a process in a subtree of the system's directory tree. This can be useful to run a program with restricted access, e.g. run a network server with access to only its own files and the files that it serves, but not to other data stored on the same computer). A limitation of chroot is that the program is confined to one subtree: it can't access independent subtrees. Bind mounts allow grafting other subtrees onto that main tree. This makes them fundamental to most practical usage of containers under Linux.
For example, suppose that a machine runs a service /usr/sbin/somethingd which should only have access to data under /var/lib/something. The smallest directory tree that contains both of these files is the root. How can the service be confined? One possibility is to make hard links to all the files that the service needs (at least /usr/sbin/somethingd and several shared libraries) under /var/lib/something. But this is cumbersome (the hard links need to be updated whenever a file is upgraded), and doesn't work if /var/lib/something and /usr are on different filesystems. A better solution is to create an ad hoc root and populate it with using mounts:
mkdir /run/something
cd /run/something
mkdir -p etc/something lib usr/lib usr/sbin var/lib/something
mount --bind /etc/something etc/something
mount --bind /lib lib
mount --bind /usr/lib usr/lib
mount --bind /usr/sbin usr/sbin
mount --bind /var/lib/something var/lib/something
mount -o remount,ro,bind etc/something
mount -o remount,ro,bind lib
mount -o remount,ro,bind usr/lib
mount -o remount,ro,bind usr/sbin
chroot . /usr/sbin/somethingd &
Linux's mount namespaces generalize chroots. Bind mounts are how namespaces can be populated in flexible ways. See Making a process read a different file for the same filename for an example.
Running a different distribution
Another use of chroots is to install a different distribution in a directory and run programs from it, even when they require files at hard-coded paths that are not present or have different content on the base system. This can be useful, for example, to install a 32-bit distribution on a 64-bit system that doesn't support mixed packages, to install older releases of a distribution or other distributions to test compatibility, to install a newer release to test the latest features while maintaining a stable base system, etc. See How do I run 32-bit programs on a 64-bit Debian/Ubuntu? for an example on Debian/Ubuntu.
Suppose that you have an installation of your distribution's latest packages under the directory /f/unstable, where you run programs by switching to that directory with chroot /f/unstable. To make home directories available from this installations, bind mount them into the chroot:
mount --bind /home /f/unstable/home
The program schroot does this automatically.
Accessing files hidden behind a mount point
When you mount a filesystem on a directory, this hides what is behind the directory. The files in that directory become inaccessible until the directory is unmounted. Because BSD nullfs and Linux bind mounts operate at a lower level than the mount infrastructure, a nullfs mount or a bind mount of a filesystem exposes directories that were hidden behind submounts in the original.
For example, suppose that you have a tmpfs filesystem mounted at /tmp. If there were files under /tmp when the tmpfs filesystem was created, these files may still remain, effectively inaccessible but taking up disk space. Run
mount --bind / /mnt
(Linux) or
mount -t nullfs / /mnt
(FreeBSD) to create a view of the root filesystem at /mnt. The directory /mnt/tmp is the one from the root filesystem.
NFS exports at different paths
Some NFS servers (such as the Linux kernel NFS server before NFSv4) always advertise the actual directory location when they export a directory. That is, when a client requests server:/requested/location, the server serves the tree at the location /requested/location. It is sometimes desirable to allow clients to request /request/location but actually serve files under /actual/location. If your NFS server doesn't support serving an alternate location, you can create a bind mount for the expected request, e.g.
/requested/location *.localdomain(rw,async)
in /etc/exports and the following in /etc/fstab:
/actual/location /requested/location bind bind
A substitute for symbolic links
Sometimes you'd like to make symbolic link to make a file /some/where/is/my/file appear under /else/where, but the application that uses file expands symbolic links and rejects /some/where/is/my/file. A bind mount can work around this: bind-mount /some/where/is/my to /else/where/is/my, and then realpath will report /else/where/is/my/file to be under /else/where, not under /some/where.
Side effects of bind mounts
Recursive directory traversals
If you use bind mounts, you need to take care of applications that traverse the filesystem tree recursively, such as backups and indexing (e.g. to build a locate database).
Usually, bind mounts should be excluded from recursive directory traversals, so that each directory tree is only traversed once, at the original location. With bindfs and nullfs, configure the traversal tool to ignore these filesystem types, if possible. Linux bind mounts cannot be recognized as such: the new location is equivalent to the original. With Linux bind mounts, or with tools that can only exclude paths and not filesystem types, you need to exclude the mount points for the bind mounts.
Traversals that stop at filesystem boundaries (e.g. find -xdev, rsync -x, du -x, …) will automatically stop when they encounter a bindfs or nullfs mount point, because that mount point is a different filesystem. With Linux bind mounts, the situation is a bit more complicated: there is a filesystem boundary only if the bind mount is grafting a different filesystem, not if it is grafting another part of the same filesystem.
Going beyond bind mounts
Bind mounts provide a view of a directory tree at a different location. They expose the same files, possibly with different mount options and (with bindfs) different ownership and permissions. Filesystems that present an altered view of a directory tree are called overlay filesystems or stackable filesystems. There are many other overlay filesystems that perform more advanced transformations. Here are a few common ones. If your desired use case is not covered here, check the repository of FUSE filesystems.
loggedfs — log all filesystem access for debugging or monitoring purposes (configuration file syntax, Is it possible to find out what program or script created a given file?, List the files accessed by a program)
Filter visible files
clamfs — run files through a virus scanner when they are read
filterfs — hide parts of a filesystem
rofs — a read-only view. Similar to bindfs -r, just a little more lightweight.
Union mounts — present multiple filesystems (called branches) under a single directory: if tree1 contains foo and tree2 contains bar then their union view contains both foo and bar. New files are written to a specific branch, or to a branch chosen according to more complex rules. There are several implementations of this concept, including:
aufs — Linux kernel implementation, but rejected upstream many times
funionfs — FUSE implementation
mhddfs — FUSE, write files to a branch based on free space
overlay — Linux kernel implementation, merged upstream in Linux v3.18
unionfs-fuse — FUSE, with caching and copy-on-write features
Modify file names and metadata
ciopfs — case-insensitive filenames (can be useful to mount Windows filesystems)
convmvfs — convert filenames between character sets (example)
posixovl — store Unix filenames and other metadata (permissions, ownership, …) on more restricted filesystems such as VFAT (example)
View altered file contents
avfs — for each archive file, present a directory with the content of the archive (example, more examples). There are also many FUSE filesystems that expose specific archives as directories.
fuseflt — run files through a pipeline when reading them, e.g. to recode text files or media files (example)
lzopfs — transparent decompression of compressed files
mp3fs — transcode FLAC files to MP3 when they are read (example)
scriptfs — execute scripts to serve content (a sort of local CGI) (example)
Modify the way content is stored
chironfs — replicate files onto multiple underlying storage (RAID-1 at the directory tree level)
copyfs — keep copies of all versions of the files
encfs — encrypt files
pcachefs — on-disk cache layer for slow remote filesystems
simplecowfs — store changes via the provided view in memory, leaving the original files intact
wayback — keep copies of all versions of the files
| What is a bind mount? |
1,429,982,938,000 |
On my Arch Linux system (Linux Kernel 3.14.2) bind mounts do not respect the read only option
# mkdir test
# mount --bind -o ro test/ /mnt
# touch /mnt/foo
creates the file /mnt/foo. The relevant entry in /proc/mounts is
/dev/sda2 /mnt ext4 rw,noatime,data=ordered 0 0
The mount options do not match my requested options, but do match both the read/write behaviour of the bind mount and the options used to originally mount /dev/sda2 on /
/dev/sda2 / ext4 rw,noatime,data=ordered 0 0
If, however, I remount the mount then it respects the read only option
# mount --bind -o remount,ro test/ /mnt
# touch /mnt/bar
touch: cannot touch ‘/mnt/bar’: Read-only file system
and the relevant entry in /proc/mounts/
/dev/sda2 /mnt ext4 ro,relatime,data=ordered 0 0
looks like what I might expect (although in truth I would expect to see the full path of the test directory). The entry in /proc/mounts/ for the orignal mount of /dev/sda2/ on / is also unchanged and remains read/write
/dev/sda2 / ext4 rw,noatime,data=ordered 0 0
This behaviour and the work around have been known since at least 2008 and are documented in the man page of mount
Note that the filesystem mount options will remain the same as those on the original mount point, and cannot be changed by passing the -o option along with --bind/--rbind. The mount options can be changed by a separate remount command
Not all distributions behave the same. Arch seems to silently fail to respect the options while Debian generates a warning when the bind mount does not get mount read-only
mount: warning: /mnt seems to be mounted read-write.
There are reports that this behaviour was "fixed" in Debian Lenny and Squeeze although it does not appear to be a universal fix nor does it still work in Debian Wheezy. What is the difficultly associated with making bind mount respect the read only option on the initial mount?
|
Bind mount is just... well... a bind mount. I.e. it's not a new mount. It just "links"/"exposes"/"considers" a subdirectory as a new mount point. As such it cannot alter the mount parameters. That's why you're getting complaints:
# mount /mnt/1/lala /mnt/2 -o bind,ro
mount: warning: /mnt/2 seems to be mounted read-write.
But as you said a normal bind mount works:
# mount /mnt/1/lala /mnt/2 -o bind
And then a ro remount also works:
# mount /mnt/1/lala /mnt/2 -o bind,remount,ro
However what happens is that you're changing the whole mount and not just this bind mount. If you take a look at /proc/mounts you'll see that both bind mount and the original mount change to read-only:
/dev/loop0 /mnt/1 ext2 ro,relatime,errors=continue,user_xattr,acl 0 0
/dev/loop0 /mnt/2 ext2 ro,relatime,errors=continue,user_xattr,acl 0 0
So what you're doing is like changing the initial mount to a read-only mount and then doing a bind mount which will of course be read-only.
UPDATE 2016-07-20:
The following are true for 4.5 kernels, but not true for 4.3 kernels (This is wrong. See update #2 below):
The kernel has two flags that control read-only:
The MS_READONLY: Indicating whether the mount is read-only
The MNT_READONLY: Indicating whether the "user" wants it read-only
On a 4.5 kernel, doing a mount -o bind,ro will actually do the trick. For example, this:
# mkdir /tmp/test
# mkdir /tmp/test/a /tmp/test/b
# mount -t tmpfs none /tmp/test/a
# mkdir /tmp/test/a/d
# mount -o bind,ro /tmp/test/a/d /tmp/test/b
will create a read-only bind mount of /tmp/test/a/d to /tmp/test/b, which will be visible in /proc/mounts as:
none /tmp/test/a tmpfs rw,relatime 0 0
none /tmp/test/b tmpfs ro,relatime 0 0
A more detailed view is visible in /proc/self/mountinfo, which takes into consideration the user view (namespace). The relevant lines will be these:
363 74 0:49 / /tmp/test/a rw,relatime shared:273 - tmpfs none rw
368 74 0:49 /d /tmp/test/b ro,relatime shared:273 - tmpfs none rw
Where on the second line, you can see that it says both ro (MNT_READONLY) and rw (!MS_READONLY).
The end result is this:
# echo a > /tmp/test/a/d/f
# echo a > /tmp/test/b/f
-su: /tmp/test/b/f: Read-only file system
UPDATE 2016-07-20 #2:
A bit more digging into this shows that the behavior in fact depends on the version of libmount which is part of util-linux. Support for this was added with this commit and was released with version 2.27:
commit 9ac77b8a78452eab0612523d27fee52159f5016a
Author: Karel Zak
Date: Mon Aug 17 11:54:26 2015 +0200
libmount: add support for "bind,ro"
Now it's necessary t use two mount(8) calls to create a read-only
mount:
mount /foo /bar -o bind
mount /bar -o remount,ro,bind
This patch allows to specify "bind,ro" and the remount is done
automatically by libmount by additional mount(2) syscall. It's not
atomic of course.
Signed-off-by: Karel Zak
which also provides the workaround. The behavior can be seen using strace on an older and a newer mount:
Old:
mount("/tmp/test/a/d", "/tmp/test/b", 0x222e240, MS_MGC_VAL|MS_RDONLY|MS_BIND, NULL) = 0 <0.000681>
New:
mount("/tmp/test/a/d", "/tmp/test/b", 0x1a8ee90, MS_MGC_VAL|MS_RDONLY|MS_BIND, NULL) = 0 <0.011492>
mount("none", "/tmp/test/b", NULL, MS_RDONLY|MS_REMOUNT|MS_BIND, NULL) = 0 <0.006281>
Conclusion:
To achieve the desired result one needs to run two commands (as @Thomas already said):
mount SRC DST -o bind
mount DST -o remount,ro,bind
Newer versions of mount (util-linux >=2.27) do this automatically when one runs
mount SRC DST -o bind,ro
| Why doesn't mount respect the read only option for bind mounts? |
1,429,982,938,000 |
Rather than using mount | grep, I'd like to use mount -l -t bind, but that doesn't work, and -t none shows all mounts.
|
Bind mounts are not a filesystem type, nor a parameter of a mounted filesystem; they're parameters of a mount operation. As far as I know, the following sequences of commands lead to essentially identical system states as far as the kernel is concerned:
mount /dev/foo /mnt/one; mount --bind /mnt/one /mnt/two
mount /dev/foo /mnt/two; mount --bind /mnt/two /mnt/one
So the only way to remember what mounts were bind mounts is the log of mount commands left in /etc/mtab. A bind mount operation is indicated by the bind mount option (which causes the filesystem type to be ignored). But mount has no option to list only filesystems mounted with a particular set of sets of options. Therefore you need to do your own filtering.
mount | grep -E '[,(]bind[,)]'
</etc/mtab awk '$4 ~ /(^|,)bind(,|$)/'
Note that /etc/mtab is only useful here if it's a text file maintained by mount. Some distributions set up /etc/mtab as a symbolic link to /proc/mounts instead; /proc/mounts is mostly equivalent to /etc/mtab but does have a few differences, one of which is not tracking bind mounts.
One piece of information that is retained by the kernel, but not shown in /proc/mounts, is when a mount point only shows a part of the directory tree on the mounted filesystem. In practice this mostly happens with bind mounts:
mount --bind /mnt/one/sub /mnt/partial
In /proc/mounts, the entries for /mnt/one and /mnt/partial have the same device, the same filesystem type and the same options. The information that /mnt/partial only shows the part of the filesystem that's rooted at /sub is visible in the per-process mount point information in /proc/$pid/mountinfo (column 4). Entries there look like this:
12 34 56:78 / /mnt/one rw,relatime - ext3 /dev/foo rw,errors=remount-ro,data=ordered
12 34 56:78 /sub /mnt/partial rw,relatime - ext3 /dev/foo rw,errors=remount-ro,data=ordered
| List only bind mounts |
1,429,982,938,000 |
I'm using fstab to bind a folder that belongs to another user in one of my own directories. I know that I can map users when I mount an SSHFS, I've been doing some research and I can't find a mount --bind equivalent.
Is there any way I can mount another user's folder and files as my own?
Update: It doesn't necessarily have to be mount --bind. It just has to do something similar while mapping users, and can be done on startup.
|
You can't do that with the Linux bind mount kernel feature. But you can do it with the FUSE filesystem bindfs. Bindfs is slower than bind mounts and doesn't pass extended attributes, but on the flip side, it can be used by non-root users and on Unix variants other than Linux, and most importantly for you, allows simple transformations of ownership and permissions.
Assuming that your user name is andy and the other user is bob:
bindfs -u andy /home/bob/stuff /home/andy/bobs-stuff
In /etc/fstab, that would translate to:
bindfs#/home/bob/stuff /home/andy/bobs-stuff fuse force-user=andy 0 0
| mount --bind other user as myself |
1,429,982,938,000 |
Asked on serverfault but didn't get enough attention, so reposted here, with the hope some people here know the answer.
There is another question discussing about umounting rbind mounts, but the solution has unwanted effect. Consider the following directory layout:
.
├── A_dir
│ └── mount_b
├── B_dir
│ └── mount_c
└── C_dir
Now I bind C_dir to B_dir/mount_c and rbind B_dir to A_dir/mount_b:
[hidden]$ sudo mount --bind C_dir B_dir/mount_c
[hidden]$ sudo mount --rbind B_dir A_dir/mount_b
[hidden]$ mount | grep _dir | wc -l
3
Now umount A_dir/mount_b will fail, which is not surprising. According to the answers everywhere on the web, we need to umount A_dir/mount_b/mount_c first then umount A_dir/mount_b. However, umount A_dir/mount_b/mount_c will also unmount B_dir/mount_c, which is unwanted:
[hidden]$ sudo umount A_dir/mount_b/mount_c
[hidden]$ mount | grep _dir | wc -l
1
Now my question is, how do I unmount A_dir/mount_b but leaving B_dir unaffected, i.e. there is still a bind B_dir/mount_c to C_dir?
EDIT: this problem doesn't seem to appear in Ubuntu. More specifically, it works fine on my Ubuntu 14.04 but not working on Fedora 23 and CentOS 7. Why there is the difference and what's the work around for Fedora and CentOS?
EDIT: some more information on the actual problem that I am trying to solve. I tried to create a sandbox and used --rbind to mount the /dev and /proc to the sandbox. When destroying the sandbox, it seems I can't cleanly destroy it because unmounting <sandbox-root>/dev/pts in FC23 and CentOS7 will unmount /dev/pts, after which my shell and SSH connections hang and I have to reboot the machine. That's why I am asking if there is a way to unmount the --rbind mounts without affecting submounts.
|
I found the solution myself. I simply just need to use --make-rslave to make any changes in A_dir/mount_b not propagate back to B_dir:
sudo mount --make-rslave A_dir/mount_b
sudo umount -R A_dir/mount_b
See mount man page section The shared subtree operations.
| Unmount a rbind mount without affecting the original mount |
1,429,982,938,000 |
Why doesn't this work?
$ unshare -rm mount --bind / /mnt
mount: /mnt: wrong fs type, bad option, bad superblock on /, missing codepage or helper program, or other error.
These work ok:
$ unshare -rm mount --bind /tmp /mnt
$ unshare -rm mount --bind /root /mnt
$
$ uname -r # Linux kernel version
4.17.3-200.fc28.x86_64
|
The difference is that / has child mounts. Inside a user namespace, you are not allowed to separate inherited mounts from their child mounts. A more obvious example is that you are not allowed to umount /proc. Otherwise, it could suddenly grant you access to files that were hidden underneath other mounts. Overmounts are sometimes used deliberately as a security measure.
You are allowed to create a recursive bind mount instead, which preserves all the sub-mounts:
$ unshare -rm mount --rbind / /mnt
| Why can't I bind-mount "/" inside a user namespace? |
1,429,982,938,000 |
So I'm trying to get a handle on how Linux's mount namespace works. So, I did a little experiment and opened up two terminals and ran the following:
Terminal 1
root@goliath:~# mkdir a b
root@goliath:~# touch a/foo.txt
root@goliath:~# unshare --mount -- /bin/bash
root@goliath:~# mount --bind a b
root@goliath:~# ls b
foo.txt
Terminal 2
root@goliath:~# ls b
foo.txt
How come the mount is visible in Terminal 2? Since it is not part of the mount namespace I expected the directory to appear empty here. I also tried passing -o shared=no and using --make-private options with mount, but I got the same result.
What am I missing and how can I make it actually private?
|
If you are on a systemd-based distribution with a util-linux version less than 2.27, you will see this unintuitive behavior. This is because CLONE_NEWNS propogates flags such as shared depending on a setting in the kernel. This setting is normally private, but systemd changes this to shared. As of util-linux 2.27, a patch was made that changes the default behaviour of the unshare command to use private as the default propagation behaviour as to be more intuitive.
Solution
If you are on a systemd system with util-linux prior to version 2.27, you must remount the root filesystem after running the unshare command:
# unshare --mount -- /bin/bash
# mount --make-private -o remount /
If you are on a systemd system with util-linux version 2.27 or later, it should work as expected in the example you gave in your question, verbatim, without the need to remount. If not, pass --propagation private to the unshare command to force the propagation of the mount namespace to be private.
| Why is my bind mount visible outside its mount namespace? |
1,429,982,938,000 |
I'm running a modified WD MyCloud (Gen 1) NAS with Debian 8 (Jessie) installed on it.
Due to the nuances of the device, I can't resize the root partition, and am struggling with space on it.
To remedy this, I've rsynced the /var and /usr directories on to the main data partition.
I've then added the following lines to the /etc/fstab:
/data/rootfs/var /var none defaults,bind 0 0
/data/rootfs/usr /usr none defaults,bind 0 0
Upon rebooting, I find that the /var directory has successfully been mounted, but that the /usr directory has not.
If I then run mount -a, I get no errors, and the /usr directory is correctly mounted.
What's going wrong?
|
If you are using systemd, mounts are done in parallel (by dynamically converting the fstab entries into mount units), line ordering is not preserved as would be expected from pre-systemd experience.
You have an untold dependency that's not automatically guessed: mounting /data/ before mounting /usr. WIthout it you get a race condition.
You have to manually add the dependency as a pseudo mount option, using x-systemd.requires=. So if the previous mountpoint that should be mounted is /data, this should make it work:
/data/rootfs/var /var none x-systemd.requires=/data,bind 0 0
/data/rootfs/usr /usr none x-systemd.requires=/data,bind 0 0
In case somebody else finds this question, but the use case is for /data being a remote network filesystem like NFS, the pseudo mount option _netdev (pre-systemd option also recognized by systemd) must also be added on the /data/rootfs/usr entry to get everything working fine, because none can't hint this automatically and not having it might then confuse the x-systemd.requires= resolution.
| /etc/fstab fails to bind mount on boot, but running mount -a works correctly |
1,429,982,938,000 |
Original Problem
I have a file on one filesystem: /data/src/file
and I want to hard link it to: /home/user/proj/src/file
but /home is on one disk, and /data is on another so I get an error:
$ cd /home/user/proj/src
$ ln /data/src/file .
ln: failed to create hard link './file' => '/data/src/file': Invalid cross-device link
Okay, so I learned I can't hard link across devices. Makes sense.
Problem at hand
So I thought I'd get fancy and bind mount a src folder that's on /data's file system:
$ mkdir -p /data/other/src
$ cd /home/user/proj
$ sudo mount --bind /data/other/src src/
$ cd src
$ # (now we're technically on `/data`'s file system, right?)
$ ln /data/src/file .
ln: failed to create hard link './file' => '/data/src/file': Invalid cross-device link
Why does this still not work?
Workaround
I know I have this setup right because I can make the hard link as long as I'm in the "real" /data directory instead of the bound one.
$ cd /data/other/src
$ ln /data/src/file .
$ # OK
$ cd /home/user/proj/src
$ ls -lh
total 35M
-rw------- 2 user user 35M Jul 17 22:22 file
$
Some System Info
$ uname -a
Linux <host> 4.10.0-24-generic #28-Ubuntu SMP Wed Jun 14 08:14:34 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
$ findmnt
.
.
.
├─/home /dev/sdb8 ext4 rw,relatime,data=ordered
│ └─/home/usr/proj/src /dev/sda2[/other/src]
│ ext4 rw,relatime,data=ordered
└─/data /dev/sda2 ext4 rw,relatime,data=ordered
$ mountpoint -d /data
8:2
$ mountpoint -d /home/usr/proj/src/
8:2
Note: I manually changed the file and directory names to make the situation more clear, so there may be a typo or two in the command readouts.
|
There's a disappointing lack of comments in the code. It's as if no-one ever thought it useful, since the time bind mounts were implemented in v2.4. Surely all you'd need to do is substitute .mnt->mnt_sb where it says .mnt...
Because it gives you a security boundary around a subtree.
PS: that had been discussed quite a few times, but to avoid searches:
consider e.g. mount --bind /tmp /tmp; now you've got a situation when
users can't create links to elsewhere no root fs, even though they
have /tmp writable to them. Similar technics works for other isolation
needs - basically, you can confine rename/link to given subtree. IOW,
it's a deliberate feature. Note that you can bind a bunch of trees
into chroot and get predictable restrictions regardless of how the
stuff might get rearranged a year later in the main tree, etc.
-- Al Viro
There's a concrete example further down the thread
Whenever we get mount -r --bind working properly (which I use to place
copies of necessary shared libraries inside chroot jails while
allowing page cache sharing), this feature would break security.
mkdir /usr/lib/libs.jail
for i in $LIST_OF_LIBRARIES; do
ln /usr/lib/$i /usr/lib/libs.jail/$i
done
mount -r /usr/lib/libs.jail /jail/lib
chown prisoner /usr/log/jail
mount /usr/log/jail /jail/usr/log
chrootuid /jail prisoner /bin/untrusted &
Although protections should be enough, but I'd rather avoid having the
prisoner link /jail/lib/libfoo.so (write returns EROFS) to
/jail/usr/log where it's potentially writeable.
| Why can't I create a `hardlink` to a file from a "mount --bind" directory on the same filesystem? |
1,429,982,938,000 |
I have a home partition which is shared by mulitple distros on the same box. I'm using bind mounts from fstab. Each Linux install has something like this:
UUID=[...] /mnt/data ext4 nodev,nosuid 0 2
/mnt/data/arch /home none defaults,bind 0 0
/mnt/data/files /files none defaults,bind 0 0
The disadvantage is, of course, that /mnt/data/arch and /mnt/data/files are now mounted twice. On a hunch, I tried umount /mnt/data, which seems to work as I had hoped: according to mount, the device is now only mounted to /home and /files.
My questions are:
Is this safe, or am I overlooking something?
Is it possible to get the same effect as umount /mnt/data using only fstab? Or could I do it in rc.local?
|
It's safe to unmount one of the bind-mounted copies. After you run mount --bind /foo /bar, the kernel doesn't keep track of which of /foo or /bar came first, they're two mount points for the same filesystem (or part of a filesystem).
Note that if /foo is a mount point but /foo/wibble isn't, mount --bind /foo/wibble /bar makes /bar point to a part of the filesystem that's mounted on /foo. It's still ok to unmount /foo.
So if you mount /mnt/data, then bind parts of it to /home and /files, and unmount /mnt/data, you end up with no access to the parts of /mnt/data outside arch and files. If that doesn't bother you, go for it.
You can't achieve that through fstab: it only supports mounting filesystems. Bind mounts get in through a hack (the bind mount option is turned into a --bind option to the mount command internally). mount --move and unmounting can't be specified in fstab. You can use /etc/rc.local to call umount.
| Umount device after bind mounting directories: is it safe? |
1,429,982,938,000 |
A common scenario for setting up a container/sandbox is wanting to create a minimal set of device nodes in a new tmpfs (rather than exposing the host /dev), and the only (unprivileged) way I know to do this is by bind-mounting the desired ones into it. The commands I'm using (inside unshare -mc --keep-caps) are:
mkdir /tmp/x
mount -t tmpfs none /tmp/x
touch /tmp/x/null
mount -o bind /dev/null /tmp/x/null
with the intend of moving the mount on top of /dev. However, even before doing the move, running echo > /tmp/x/null produces a "Permission denied" error (EACCES).
Yet if I additionally perform:
mkdir /tmp/x/y
touch /tmp/x/y/null
mount -o bind /dev/null /tmp/x/y/null
echo > /tmp/x/y/null
the write succeeds as it should. I've played around with this quite a bit, but can't find a root cause or reason this should be happening. It's possible to work around it by putting the bind-mounted nodes in a subdirectory and symlinks to them in the top-level of the filesystem that will become the new /dev, but it seems like this shouldn't be necessary.
What's going on? Is there a reasonable explanation for this? Or is it some access control logic gone wrong?
|
Well, this seems to be a very interesting effect, which is a consequence of three mechanisms combined together.
The first (trivial) point is that when you redirect something to the file, the shell opens the target file with the O_CREAT option to be sure that the file will be created if it does not yet exist.
The second thing to consider is the fact that /tmp/x is a tmpfs mountpoint, while /tmp/x/y is an ordinary directory. Given that you mount tmpfs with no options, the mountpoint's permissions automagically change so that it becomes world-writable and has a sticky bit (1777, which is a usual set of permissions for /tmp, so this feels like a sane default), while the permissions for /tmp/x/y are probably 0755 (depends on your umask).
Finally, the third part of the puzzle is the way you set up the user namespace: you instruct unshare(1) to map UID/GID of your host user to the same UID/GID in the new namespace. This is the only mapping in new namespace, so trying to translate any other UID between the parent/child namespaces will result in so-called overflow UID, which by default is 65534 — a nobody user (see user_namespaces(7), section Unmapped user and group IDs). This makes /dev/null (and its bind-mounts) be owned by nobody inside the child user namespace (as there is no mapping for host's root user in the child user namespace):
$ ls -l /dev/null
crw-rw-rw- 1 nobody nobody 1, 3 Nov 25 21:54 /dev/null
Combining all the facts together we come to the following: echo > /tmp/x/null tries to open an existing file with O_CREAT option, while this file resides inside the world-writable sticky directory and is owned by nobody, who is not the owner of the directory containing it.
Now, read openat(2) carefully, word by word:
EACCES
Where O_CREAT is specified, the protected_fifos or protected_regular sysctl is enabled, the file already exists and is a FIFO or regular file, the owner of
the file is neither the current user nor the owner of the containing directory, and the containing directory is both world- or group-writable and sticky.
For details, see the descriptions of /proc/sys/fs/protected_fifos and /proc/sys/fs/protected_regular in proc(5).
Isn't this brilliant? This seems almost like our case... Except the fact that the man page tells only about ordinary files and FIFOs and tells nothing about device nodes.
Well, let's take a look at the code which actually implements this. We can see that, essentially, it first checks for exceptional cases which must succeed (the first if), and then it just denies the access for any other case if the sticky directory is world-writable (the second if, first condition):
static int may_create_in_sticky(umode_t dir_mode, kuid_t dir_uid,
struct inode * const inode)
{
if ((!sysctl_protected_fifos && S_ISFIFO(inode->i_mode)) ||
(!sysctl_protected_regular && S_ISREG(inode->i_mode)) ||
likely(!(dir_mode & S_ISVTX)) ||
uid_eq(inode->i_uid, dir_uid) ||
uid_eq(current_fsuid(), inode->i_uid))
return 0;
if (likely(dir_mode & 0002) ||
(dir_mode & 0020 &&
((sysctl_protected_fifos >= 2 && S_ISFIFO(inode->i_mode)) ||
(sysctl_protected_regular >= 2 && S_ISREG(inode->i_mode))))) {
const char *operation = S_ISFIFO(inode->i_mode) ?
"sticky_create_fifo" :
"sticky_create_regular";
audit_log_path_denied(AUDIT_ANOM_CREAT, operation);
return -EACCES;
}
return 0;
}
So, if the target file is a char device (not a regular file or a FIFO), the kernel still denies opening it with O_CREAT when this file is in the world-writable sticky directory.
To prove that I found the reason correctly, we may check that the problem disappears in any of the following cases:
mount tmpfs with -o mode=777 — this will not make the mountpoint have a sticky bit;
open /tmp/x/null as O_WRONLY, but without O_CREAT option (to test this, write a program calling open("/tmp/x/null", O_WRONLY | O_CREAT) and open("/tmp/x/null", O_WRONLY), then compile and run it under strace -e trace=openat to see the returned values for each call).
I'm not sure whether this behavior should be considered a kernel bug or not, but the documentation for openat(2) clearly does not cover all the cases when this syscall actually fails with EACCES.
| Why do bind mounts of device nodes break with EACCES in root of a tmpfs? |
1,429,982,938,000 |
I'm messing around with having both /home and /var on a separate partition which will be mounted in /myhdd.
Next, I use mount --bind to mount /var on /myhdd/var and /home on /myhdd/home. With this configuration I am able to successfully install Arch Linux, but as soon as I boot to the installed system /var and /home are not mount although /myhdd is.
Due to this issue, I can't get pacman and more important stuff working. I do get a working system if I manually mount all directories, so it looks like an fstab problem, so here it is:
# /dev/sda1
UUID=f192b003-abf9-4e1a-87ee-d187d64423ce / ext4 rw,relatime,data=ordered 0 1
# /dev/sda2
UUID=b4c5571f-ddb7-440e-b591-759e888b268d /myhdd ext4 rw,relatime,data=ordered 0 2
# /mnt/myhdd/home
/mnt/myhdd/home /home none bind 0 0
# /mnt/myhdd/var
/mnt/myhdd/var /var none bind 0 0
Any ideas why fstab doesn't mount my /var and /home directories?
|
Your problem:
/myhdd ... /mnt/myhdd/... /mnt/myhdd/...
It should read either:
/mnt/myhddd ... /mnt/myhdd/... /mnt/myhdd/...
or...
/myhdd ... /myhdd/... /myhdd/...
| bind mount /var with fstab |
1,429,982,938,000 |
I was going through the Gentoo Handbook in preparation for installing Gentoo on my system.
In the Chrooting section, these commands are given:
mount --rbind /sys /mnt/gentoo/sys
mount --make-rslave /mnt/gentoo/sys
mount --rbind /dev /mnt/gentoo/dev
mount --make-rslave /mnt/gentoo/dev
These are the doubts I have regarding this section:
I'm no Linux expert but based on a little digging I did, I found out that a bind mount
takes an existing directory tree and replicates it under a different point. The directories and files in the bind mount are the same as the original. Any modification on one side is immediately reflected on the other side, since the two views show the same data.
What I don't understand is, how does making a bind mount in /mnt/gentoo/sys help? The original directory tree is in the installation medium which will be removed. So any changes made in the medium will not be reflected here. What is the purpose of using this command instead of
mount -t sysfs sysfs /mnt/gentoo/sys
What is the purpose of using rbind? Assuming that the purpose of the bind mounting was only to create a /sys file on the /mnt/gentoo and not make use of bind mount's reflective feature, why use of rbind? Again, as far as I know, rbind is used when there are mount points under the original directory being bind mounted. But there aren't any mount points under /sys are there?
|
1.) /sys is not a real on-disk filesystem: it is a representation of and a means to access kernel internal state in the form of a virtual filesystem. It is entirely RAM-based and there is no point in storing the contents of /sys on disk.
In a certain sense you might say that /sys is regenerated from scratch each time the kernel boots and hardware is detected; in another sense you might say that things in the /sys filesystem don't actually have a permanent existence at all, and are only generated on demand, whenever you attempt to access them, based on the actual kernel state they're supposed to represent.
While you're in the process of installing Gentoo, the new installation does not yet have its own kernel running, so the new installation cannot have its own separate /sys yet. But the installer environment has its own /sys, and making the bind mount makes the "system under construction" borrow the /sys filesystem tree of the installation environment. This makes certain tasks in the installation be exactly the same as when upgrading an existing system, and so the same scripts can be used for both cases: in an upgrade, they are used as-is, but during an installation they just need to be run chrooted to /mnt/gentoo.
2.) Under /sys, there may or may not be debugfs mounted as /sys/kernel/debug, efivarfs UEFI variable store pseudo-filesystem as /sys/firmware/efi/efivars, and a potentially several RAM-based filesystems for the management of various control groups under /sys/fs/cgroup/*.
Under /dev there can be at least /dev/pts, /dev/shm, /dev/hugepages and/or /dev/mqueue, all various special-purpose RAM-based filesystems.
So using rbind will clearly simplify things.
| What is the purpose of bind mounting (rbind specifically) /sys? |
1,429,982,938,000 |
In FreeBSD, man mount_nullfs states that:
The primary differences between a virtual copy of the file system and a
symbolic link are that the getcwd(3) functions work correctly in the virtual
copy, and that other file systems may be mounted on the virtual copy
without affecting the original. A different device number for the virtual
copy is returned by stat(2), but in other respects it is indistinguishable
from the original.
What is the full meaning/implication of this paragraph?
|
The primary differences between a virtual copy of the file system and a
symbolic link are that the getcwd(3) functions work correctly in the virtual
copy,
getcwd’s behaviour with symlinked directories is a fairly well-known gotcha, documented in Advanced Unix Programming for example (see this SO question for a quote): chdir and getcwd aren’t symmetric when symlinks are involved. One might expect that changing directories, using chdir, to a given directory, and then retrieving the current directory, using getcwd, would return the same value; but that’s not the case when a process changes directory using a path containing a symbolic link — getcwd returns the path obtained after de-referencing all symbolic link(s). This can have unexpected consequences when changing directories to a parent directory, when the path containing symbolic link(s) and the de-referenced path have different numbers of components.
and that other file systems may be mounted on the virtual copy
without affecting the original.
Continuing Stéphane’s example, you can mount another file system on a sub-directory of /tmp/b without affecting /some/dir, whereas mounting a file system on a sub-directory of /tmp/a will make it show up under /some/dir too.
A different device number for the virtual
copy is returned by stat(2), but in other respects it is indistinguishable
from the original.
This means that running stat on the copy, or any file thereunder, will return a different device number compared to the original, but that’s the only difference; apart from that, stat("/tmp/b/c", &buf) and stat("/some/dir/c", &buf) would return the same information.
| Meaning of statement that 'getcwd functions work correctly' in FreeBSD man page for mount_nullfs? |
1,429,982,938,000 |
I do not understand why I get ENOENT when bind-mounting after unlink:
kduda@penguin:/tmp$ echo hello > a
kduda@penguin:/tmp$ touch b c
kduda@penguin:/tmp$ sudo unshare -m
root@penguin:/tmp# mount -B a b
root@penguin:/tmp# rm a
root@penguin:/tmp# cat b
hello
root@penguin:/tmp# mount -B b c
mount: mount(2) failed: No such file or directory
This seems like a bug to me. You can even re-create "a", pointing to the same exact inode, but you get the same thing:
kduda@penguin:/tmp$ echo hello > a
kduda@penguin:/tmp$ ln a a-save
kduda@penguin:/tmp$ sudo unshare -m
root@penguin:/tmp# mount -B a b
root@penguin:/tmp# rm a
root@penguin:/tmp# ln a-save a
root@penguin:/tmp# mount -B b c
mount: mount(2) failed: No such file or directory
What in the world is going on?
|
Walking through the source code, I found exactly one ENOENT that was relevant, i.e. for an unlinked directory entry:
static int attach_recursive_mnt(struct mount *source_mnt,
struct mount *dest_mnt,
struct mountpoint *dest_mp,
struct path *parent_path)
{
[...]
/* Preallocate a mountpoint in case the new mounts need
* to be tucked under other mounts.
*/
smp = get_mountpoint(source_mnt->mnt.mnt_root);
static struct mountpoint *get_mountpoint(struct dentry *dentry)
{
struct mountpoint *mp, *new = NULL;
int ret;
if (d_mountpoint(dentry)) {
/* might be worth a WARN_ON() */
if (d_unlinked(dentry))
return ERR_PTR(-ENOENT);
https://elixir.bootlin.com/linux/v5.2/source/fs/namespace.c#L3100
get_mountpoint() is generally applied to the target, not the source. In this function, it is called because of mount propagation. It is necessary to enforce the rule that you cannot add mounts on top of a deleted file, during mount propagation. But the enforcement is happening eagerly, even if no mount propagation happens that would require this. I think it is good that the checking is consistent like this, it is just coded a bit more obscurely than I would ideally prefer.
Either way I look at it, I think it is reasonable to enforce this. So long as it helps reduce the number of weird cases to analyze, and no-one has an especially compelling counter-argument.
| Why does bind mounting a file after unlink fail with ENOENT? |
1,429,982,938,000 |
I have mounted a directory to another directory using mount --bind so that an sftp user of my server can access this directory.
mount --bind /path/share /path/home/user/stuff
I have put this in /etc/fstab and it is working great.
If I cd into the mounted directory and do pwd, it seems as if the directory is actually, physically there:
/path/home/user/stuff/share
Is there a command that shows where the 'original' directory is located
(just as symlinks: when you do ls -fsl you see the original path)?
|
I think you're looking for mount -l.
| pwd: show mountpoint |
1,429,982,938,000 |
I need the mountpoints of all disks attached to a host inside a docker container. The mount information is available in /proc/1/mounts file, but I cannot access that file on all OS.
When I run the following on Ubuntu it's working fine.
docker run -it -v /proc/1/mounts:/tmp/mounts ubuntu:16.04
But on CentOS with SELinux enabled, I cannot mount /proc/1/mounts file. It will give permission denied error.
I also tried /etc/mtab, but since it's a symlink to /proc/self/mounts, the content will change inside the docker container.
Is there any other way to obtain the mount information of the host other than /proc/1/mounts, or should a particular SELinux label be used?
I tried with docker run -it --privileged -v /proc/1/mounts:/tmp/mounts ubuntu:16.04, and it still gives the same error.
|
I am making the assumption that you do not strictly require the mounts visible to the init process (pid 1) and that the mounts visible to the docker daemon are sufficient. Normally, they should both have the same mount namespace.
Answer for CentOS docker package
(Using docker 1.13.1 from the CentOS repository)
I can reproduce your problem with /proc/1/mounts. However, using the mounts file of the docker daemon works:
$ docker run -it -v /proc/$(pidof dockerd-current)/mounts:/tmp/mounts ubuntu:16.04
In the docker container, /tmp/mounts then lists the mounts of the host.
Answer for the Docker Community Edition
(Using the external docker-ce 18.09.5 package as described here)
In addition to the problem explained above, the docker-ce package has a problem with the SE Linux context of the containerd service:
# ps xZ | grep containerd
system_u:system_r:unconfined_service_t:s0 5695 ? Ssl 0:00 /usr/bin/containerd
...
We want to have containerd labeled with the type container_runtime_t instead of unconfined_service_t. To this end, the labeling of /usr/bin/containerd has to be updated (general reference):
# ls -Z /usr/bin/dockerd-ce
-rwxr-xr-x. root root system_u:object_r:container_runtime_exec_t:s0 /usr/bin/dockerd-ce
# ls -Z /usr/bin/containerd
-rwxr-xr-x. root root system_u:object_r:bin_t:s0 /usr/bin/containerd
# semanage fcontext -a -t container_runtime_exec_t /usr/bin/containerd
# restorecon /usr/bin/containerd
# ls -Z /usr/bin/containerd
-rwxr-xr-x. root root system_u:object_r:container_runtime_exec_t:s0 /usr/bin/containerd
Next, restart the containerd daemon:
# systemctl daemon-reload
# systemctl restart containerd
# ps xZ | grep containerd
system_u:system_r:container_runtime_t:s0 6557 ? Ssl 0:00 /usr/bin/containerd
Now, the docker container can be started using the same technique as above (with dockerd instead of dockerd-current):
$ docker run -it -v /proc/$(pidof dockerd)/mounts:/tmp/mounts ubuntu:16.04
Background information
I tested this on CentOS Linux release 7.6.1810.
You can verify that init and the docker daemon have the same mount namespace (i.e. their /proc/[pid]/mounts will show the same mounts):
# readlink /proc/1/ns/mnt /proc/$(pidof dockerd-current)/ns/mnt
mnt:[4026531840]
mnt:[4026531840]
I also verified SE Linux is enabled:
# getenforce
Enforcing
When running your command with the CentOS docker package I get this error message:
$ docker run -it -v /proc/1/mounts:/tmp/mounts ubuntu:16.04
/usr/bin/docker-current: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "container init exited prematurely".
Additionally, in /var/log/audit/audit.log, I see the following AVC violation:
type=AVC msg=audit(1555530383.707:214): avc: denied { mounton } for pid=5691 comm="runc:[2:INIT]" path="/var/lib/docker/overlay2/8944062749f8ad19c3ff600e1d5286315227378174b95a952e7b0530927f4dcd/merged/tmp/mounts" dev="proc" ino=45422 scontext=system_u:system_r:container_runtime_t:s0 tcontext=system_u:system_r:init_t:s0 tclass=file permissive=0
This tells us that the SE Linux rules do not allow the source context of type container_runtime_t to do action "mounton" for target context of type "init_t". You can verify that this is the context of /proc/1/mounts, whereas the context of /proc/$(pidof dockerd-current)/mounts matches:
# ls -Z /proc/1/mounts /proc/$(pidof dockerd-current)/mounts
-r--r--r--. root root system_u:system_r:init_t:s0 /proc/1/mounts
-r--r--r--. root root system_u:system_r:container_runtime_t:s0 /proc/5476/mounts
| How to get mount information of host inside a docker container |
1,429,982,938,000 |
My objective is to have the physical storage for the Linux FHS read/write directories (/home, /srv, /tmp, /var) on a separate (logical or physical) disk from the potentially read-only rest of the root file system.
I know I can create four partitions on my second disk and use each partition for one of the beforementioned directories using mount. But I don't feel like determining the required storage space for the four directories upfront, even if I may be able to correct the sizes of the (logical or physical) partitions later.
Can this be achieved and how?
|
One option is to use a distro with a merged /usr; then you can mount /usr RO and the rest RW, and have most of the relevant stuff RO. This doesn't catch /etc, though, which you might want. Not quite a solution, more a workaround.
Another is to make a single BTRFS volume with subvolumes for all the mounts you want, then mount with -osubvol=<whatever>. These mounts can have individual mount options, but in the default configuration (without any quota setup) they'll all count against the entire BTRFS volume space-wise, such that you'll be able to put new data anywhere you like as long as the whole FS has space left.
| How to split FHS read-only and read/write directories across two disks with Linux/systemd, without partitioning the raed/write disk? |
1,429,982,938,000 |
I mount successively two points using fstab in my linux system
# Mounting apps drive
UUID=c54ca7da-117d-4cb2-8897-019ba4f6f12d /media/user/apps ext4 defaults 0 2
# Mounting opt based on apps mountpoint
/media/user/apps/opt /opt none bind
As you can see, the second mountpoint /opt is mounted on the previous mounted partition /media/user/apps/. I am not sure, whether it is safe to do like that. I am asking, if I should add some kind of condition or waiting time before I mount /opt. If the first fstab command is not yet completed and then the second command tries to bind there might be a problem, is that right?
|
/media/user/apps/opt /opt none bind,x-systemd.requires=/media/user/apps
Should do the trick.
There are two more options that help doing a safe successive mounting, because when we need to specify order dependencies between mount commands and other units.
x-systemd.after
x-systemd.before
So we can add
/media/user/apps/opt /opt none bind,x-systemd.after=/media/user/apps
But also, equivalently,
UUID=c54ca7da-117d-4cb2-8897-019ba4f6f12d /media/user/apps ext4 defaults,x-systemd.before=/opt 0 2
More information at systemd.mount
| Mounting successively in fstab: wait for partition to be mounted? |
1,429,982,938,000 |
It hasn't always behaved this way, but nowadays I get this inconsistent behaviour. Bind mounts don't copy existing mounts (unless you use --rbind), but new mounts (and unmounts) get copied automatically. It seems like a bug. What causes this?
# mount --bind / /mnt/tmp
# mount | grep /mnt
/dev/mapper/fedora-root on /mnt/tmp type ext4 (rw,relatime,seclabel,data=ordered)
# mount /var/lib/docker
# mount | grep mnt
/dev/mapper/fedora-root on /mnt/tmp type ext4 (rw,relatime,seclabel,data=ordered)
/dev/mapper/fedora-docker on /mnt/tmp/var/lib/docker type ext4 (rw,relatime,seclabel,data=ordered)
This happens on Fedora Workstation 23. I believe Debian 8 is also affected.
It doesn't happen if I boot bash with no other processes, i.e. init=/bin/bash. So it doesn't seem to be inherent to the Linux kernel.
It's annoying because this used to be the simplest way to move files from the root filesystem into a new mount point. It would be particularly convenient with SELinux (at least if you use cp?), because the files would be labeled automatically, avoiding the need for restorecon or the like.
|
You should be able to see that new mounts stop being copied, if you run mount --make-private on the mount point.
The difference when running bash as init, is that the source filesystem has been mounted as private.[*] Whereas booting the full system is effectively running --make-shared. You can see the difference by looking at findmnt -o +PROPAGATION.
Once the root filesystem is mounted as shared, any filesystem mounted directly under it will inherit the same propagation setting.
The root filesystem is being remounted as shared by systemd. This feature was added to systemd around 2012. It was discussed on the amazing Arch Linux wiki.
https://wiki.archlinux.org/index.php?title=Talk:Systemd&oldid=411350#Systemd_defaults_.2F_to_rshared.2C_gotcha
https://github.com/systemd/systemd/commit/b3ac5f8cb98757416d8660023d6564a7c411f0a0
While you're reading this, I also recommend learning how to safely disassemble a recursive bind mount. Because on shared mounts, mounts and unmounts propagate in both directions :-).
[*] Booting with init=/bin/bash, I saw the filesystems mounted as private. Even though I was still booting with Fedora's dracut initramfs, which runs systemd internally. I'm not 100% sure what was happening here.
| Mounting new filesystem affects non-recursive bind mounts? |
1,429,982,938,000 |
Why does a repeated bind mount create multiple entries in /proc/mounts?
# md -p /mnt/test-mount/{source,target}
# mount --bind /mnt/test-mount/{source,target}
# grep test-mount /proc/mounts
/dev/sda3 /mnt/test-mount/target ext4 rw,relatime 0 0
# mount --bind /mnt/test-mount/{source,target}
# grep test-mount /proc/mounts
/dev/sda3 /mnt/test-mount/target ext4 rw,relatime 0 0
/dev/sda3 /mnt/test-mount/target ext4 rw,relatime 0 0
/dev/sda3 /mnt/test-mount/source ext4 rw,relatime 0 0
After the first bind mount there was one entry mapping the source
volume to the mountpoint. After the second invocation, we have
one additional entry for the mountpoint plus one for the source
prefix.
Likewise, findmnt reports that the source is bind mounted to
itself:
# findmnt |grep test-mount
├─/mnt/test-mount/target /dev/sda3[/mnt/test-mount/source] ext4 rw,relatime
│ └─/mnt/test-mount/target /dev/sda3[/mnt/test-mount/source] ext4 rw,relatime
└─/mnt/test-mount/source /dev/sda3[/mnt/test-mount/source] ext4 rw,relatime
After another repetition, I end up with three entries for the
source, four for the target:
# mount --bind /mnt/test-mount/{source,target
# findmnt |grep test-mount
├─/mnt/test-mount/target /dev/sda3[/mnt/test-mount/source] ext4 rw,relatime
│ └─/mnt/test-mount/target /dev/sda3[/mnt/test-mount/source] ext4 rw,relatime
│ └─/mnt/test-mount/target /dev/sda3[/mnt/test-mount/source] ext4 rw,relatime
│ └─/mnt/test-mount/target /dev/sda3[/mnt/test-mount/source] ext4 rw,relatime
└─/mnt/test-mount/source /dev/sda3[/mnt/test-mount/source] ext4 rw,relatime
└─/mnt/test-mount/source /dev/sda3[/mnt/test-mount/source] ext4 rw,relatime
└─/mnt/test-mount/source /dev/sda3[/mnt/test-mount/source] ext4 rw,relatime
The progression is 1, 3, 7, 15, …, i. e. n = 1 + 2^(n-1),
causing the number of additional entries to double with each
mount operation.
What’s the reason for this?
|
Mount propagation.
This is a specific case of the "mount point explosion problem", which is explained in the "MS_UNBINDABLE example" in mount_namespaces(7)
systemd effectively enables mount propagation by default. For example, this makes it feasible to run a service in a child namespace where /home is blocked off, as per the systemd.exec option ProtectHome=yes. By allowing mounts and unmounts to propagate into the child namespace, it lets eject continue to work properly in the main namespace, and so on.
| Why do repeated bind mounts create entries for the source directory? |
1,429,982,938,000 |
While trying to create a test environment using mount --bind I was surprised to find that it sometimes fails with permissions errors because root cannot access the source directory. This only appears to affect NFS file-systems.
Is there a way to mount --bind a directory which root cannot access? Perhaps by inode number directly?
Example
I have an NFS mount which the ordinary vagrant:vagrant user can access fully:
vagrant@ubuntu-xenial:/tmp$ find nfs_mount/ -ls
4375 4 drwxr-xr-x 3 vagrant vagrant 4096 Mar 20 21:28 nfs_mount/
257090 4 drwxr-xr-x 3 vagrant vagrant 4096 Mar 20 21:28 nfs_mount/source
257091 4 drwx------ 3 vagrant vagrant 4096 Mar 20 21:28 nfs_mount/source/path
257092 4 drwx------ 3 vagrant vagrant 4096 Mar 20 21:28 nfs_mount/source/path/is
257093 4 drwx------ 2 vagrant vagrant 4096 Mar 20 21:28 nfs_mount/source/path/is/here
... but root:root cannot:
vagrant@ubuntu-xenial:/tmp$ sudo find nfs_mount/ -ls
4375 4 drwxr-xr-x 3 vagrant vagrant 4096 Mar 20 21:28 nfs_mount/
257090 4 drwxr-xr-x 3 vagrant vagrant 4096 Mar 20 21:28 nfs_mount/source
257091 4 drwx------ 3 vagrant vagrant 4096 Mar 20 21:28 nfs_mount/source/path
find: ‘nfs_mount/source/path’: Permission denied
If I attempt to mount --bind it fails:
vagrant@ubuntu-xenial:/tmp$ mkdir /tmp/bindtarget
vagrant@ubuntu-xenial:/tmp$ sudo mount --bind /tmp/nfs_mount/source/path/is/here/ /tmp/bindtarget/
mount: mount /tmp/nfs_mount/source/path/is/here/ on /tmp/bindtarget failed: Permission denied
The NFS mount at /tmp/nfs_mount is provided by localhost:/srv, and if I go directly to the source file-system the directory permissions don't pose a problem:
vagrant@ubuntu-xenial:/tmp$ sudo mount --bind /srv/source/path/is/here/ /tmp/bindtarget/
vagrant@ubuntu-xenial:/tmp$ findmnt /tmp/bindtarget
TARGET SOURCE FSTYPE OPTIONS
/tmp/bindtarget /dev/sda1[/srv/source/path/is/here] ext4 rw,relatime,data=ordered
NFS setup in case it matters:
vagrant@ubuntu-xenial:/tmp$ showmount -e localhost
Export list for localhost:
/srv *
vagrant@ubuntu-xenial:/tmp$ cat /etc/exports
/srv/ *(rw,sync,no_subtree_check)
Environment
Ubuntu 16.04 (Xenial64)
Linux ubuntu-xenial 4.4.0-116-generic #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
|
Please note that doing any mount in /tmp is hazardous, because some cleaning task might suddenly decide to do its work in /tmp and not care about mountpoints, thus wiping old files not actually belonging to /tmp. That said I'll use the /tmp examples from OP.
method 1:
If you're in full control of the NFS environment, just add the no_root_squash option to the export options: this will prevent the root user client to be mapped as nobody on the server and losing rights.
method2:
Else, here's a relatively simple solution, the one you're looking for, in the same vein as accessing a still-in-use deleted file: using /proc
For simplicity here, requires two terminals:
user terminal:
vagrant@ubuntu-xenial:/tmp$ cd /tmp/nfs_mount/source/path/is/here/
vagrant@ubuntu-xenial:/tmp/nfs_mount/source/path/is/here$ echo $$
12345
root terminal: root can get a reference to the wanted directory, still unreadable, but mountable:
# ls -l /proc/12345/cwd
lrwxrwxrwx. 1 vagrant vagrant 0 Mar 21 01:18 /proc/12345/cwd -> /tmp/nfs_mount/source/path/is/here
# ls -l /proc/12345/cwd/
ls: cannot open directory '/proc/12345/cwd/': Permission denied
# mount --bind /proc/12345/cwd /tmp/bindtarget
# ls /tmp/bindtarget
ls: cannot open directory '/tmp/bindtarget': Permission denied
That's it.
| How to create a mount --bind when root does not have permission to access the source directory? |
1,429,982,938,000 |
In a bash script I have the following lines:
TARGETS="$(findmnt -n -v -t btrfs -o TARGET --list)"
UUIDS="$(findmnt -n -v -t btrfs -o UUID --list)"
I run this script on some servers (running Arch Linux). However, it fails on NFS servers. In that case, findmnt returns multiple mount points for a given UUID (due to bind mounts on the NFS servers). A requirement of my script is that I end up with a list of one mount point for each UUID.
I found a really good answer here (Showing only “interesting” mount points / filtering non interesting types) and tried all the suggestions discussed there and I still cannot eliminate findmnt from returning multiple mount points for a given UUID -- even when the problem is narrowed to duplicates caused by bind mounts only. (Did I miss something?)
As a temporary workaround, what I have done is make a limited tab file that contains only the mounts I want to have show up, and then I use the -F option with findmnt. My custom tab file is a copy of fstab with all the bind mounts deleted.
TARGETS="$(findmnt -n -v -t btrfs -o TARGET --list -F /etc/fstab.custom)"
UUIDS="$(findmnt -n -v -t btrfs -o UUID --list -F /etc/fstab.custom)"
Obviously, this is a brittle approach that will break as soon as anything changes in /etc/fstab and my custom tab file isn't manually updated. (I also had to manually delete a few non-bind-mounts that cause duplicates from my custom file, so it definitely isn't a robust solution at this stage.)
What is a better way to achieve the desired result? I can envision that this might be solved with findmnt filters or it might be solved with external filters applied to the list returned by findmnt.
All my bind mounts start with "/srv/nfs/". Filtering those out of the list would be a good start, although that also strikes me as a somewhat brittle solution (because someone might decide to change how NFS bind mounts are organized on the server one day).
Also I'm not good enough at bash or awk to know the right way to post-process the results returned by findmnt. I thought about this:
findmnt -n -t btrfs -o UUID,TARGET --list | grep -v -E "/srv/nfs|.tapp|/var/log"
But that seems just as brittle as the custom tab file because any changes to path names will break it.
Here's an example of what is returned by findmnt -n -t btrfs -o UUID,TARGET --list on one of my systems (mount points simplified):
473c1g34-23ec-41dd-671f-c71473ad7d36 /
473c1g34-23ec-41dd-671f-c71473ad7d36 /srv/nfs/foo/wunder
473c1g34-23ec-41dd-671f-c71473ad7d36 /srv/nfs/foo/tinder
473c1g34-23ec-41dd-671f-c71473ad7d36 /.tapp
473c1g34-23ec-41dd-671f-c71473ad7d36 /var/log
473c1g34-23ec-41dd-671f-c71473ad7d36 /var/log/.tapp
13f4361e-771e-44b3-7413-a613bf4e331b /bar
13f4361e-771e-44b3-7413-a613bf4e331b /srv/nfs/bar/user1/Documents
13f4361e-771e-44b3-7413-a613bf4e331b /srv/nfs/bar/user6/Desktop
13f4361e-771e-44b3-7413-a613bf4e331b /srv/nfs/bar/user3/Documents
13f4361e-771e-44b3-7413-a613bf4e331b /srv/nfs/bar/user4/Documents
13f4361e-771e-44b3-7413-a613bf4e331b /srv/nfs/bar/user5/Documents
13f4361e-771e-44b3-7413-a613bf4e331b /srv/nfs/bar/user6/Documents
13f4361e-771e-44b3-7413-a613bf4e331b /bar/.tapp
3ac663cc-e7e4-4764-7a7a-1d3fa16b376b /foo/files
3ac663cc-e7e4-4764-7a7a-1d3fa16b376b /srv/nfs/foo/files
4c61646e-1a1d-4d67-7d47-1446e41d6341 /bar/baz
4c61646e-1a1d-4d67-7d47-1446e41d6341 /srv/nfs/bar/baz/goop/stuff
4c61646e-1a1d-4d67-7d47-1446e41d6341 /srv/nfs/bar/baz/goop/widgets
4c61646e-1a1d-4d67-7d47-1446e41d6341 /srv/nfs/bar/baz/pie
4c61646e-1a1d-4d67-7d47-1446e41d6341 /srv/nfs/bar/baz/goop/gadgets
4c61646e-1a1d-4d67-7d47-1446e41d6341 /bar/baz/.tapp
I would need to filter out all nfs bind mounts (those starting with /srv/nfs) and all mounts points containing /.tapp and the mount point for /var/log. Is there a way to do that with findmnt options? If not, how to do it in bash?
UPDATE: to keep the question focused, I would be happy with a way to exclude just the bind mounts from the findmnt results list. In order to provide an answer, please feel free to ignore the other duplicate mount points such as that created by /var/log.
UPDATE 2: here's an example of the findmnt output in json format. I don't see a way to distinguish the bind mounts from the one in this output that I would want to keep (/foo/files).
{"target": "/srv/nfs/bar/user1/Documents", "uuid": "13f4361e-771e-44b3-7413-a613bf4e331b"},
{"target": "/srv/nfs/home/user5/Desktop", "uuid": "13f4361e-771e-44b3-7413-a613bf4e331b"},
{"target": "/srv/nfs/home/user3/Documents", "uuid": "13f4361e-771e-44b3-7413-a613bf4e331b"},
{"target": "/srv/nfs/home/user4/Documents", "uuid": "13f4361e-771e-44b3-7413-a613bf4e331b"},
{"target": "/foo/files", "uuid": "3ac663cc-e7e4-4764-7a7a-1d3fa16b376b"},
|
From List only bind mounts, it seems that bind mounts cannot be distinguished from the original after mounting. While partial binds (where a subdirectory of a mount point is bind mounted somewhere) do show up differently in findmnt output, there's no distinguishing a mountpoint that was bind mounted elsewhere.
So if I did:
sudo mount -o bind / /srv
sudo mount -o bind /media /mnt
I wouldn't be able to distinguish between / and /srv in terms of mount information, but I might be able to distinguish between /media and /mnt.
So, what remains is simply removing duplicated entries from findmnt:
findmnt -n -t btrfs -o UUID,TARGET -r | awk '!a[$1]++'
Use the -r option instead of -l, which will escape special characters in the output so that you can safely handle paths:
$ findmnt -n -t ext4 -o UUID,TARGET -r
d4873b63-0956-42a7-9dcf-bd64e495a9ff /
..
d4873b63-0956-42a7-9dcf-bd64e495a9ff /srv/media
d4873b63-0956-42a7-9dcf-bd64e495a9ff /a\x20b
d4873b63-0956-42a7-9dcf-bd64e495a9ff /srv/a\x20b
Here, a b is escaped as a\x20b. You can use printf "%b" in bash to expand the escaped characters:
$ findmnt -n -t ext4 -o UUID,TARGET -r | bash -c 'while read -r uuid point; do printf "%b\n" "$point"; done'
/
...
/srv/media
/srv/a b
/a b
/srv/a b
| How to exclude bind mounts from findmnt results list? |
1,429,982,938,000 |
I have a number of ZFS sub-filesystems (so that I can granularly manage snapshots and ZFS options) like so:
tank/media
tank/media/pictures
tank/media/pictures/photos
tank/media/movies
tank/media/music
tank/media/documents
tank/media/documents/public
I am running Debian GNU/Linux 8.6 (jessie) with ZFS-on-Linux, kernel 4.4.19-1-pve. My goal is to share the parent ZFS filesystem (tank/media) with a LXC container via a bind mount and have the sub-filesystems be accessible.
If I bind mount tank/media inside the container, then the sub ZFS filesystems (E.G. tank/media/pictures) do not show up. I need to mount --make-rshared tank/media in order for the sub-mounts to also appear.
How can I make ZFS sub filesystems be mounted make-rshared by default using ZFS on Linux?
|
I have found that mounting with the rbind (rather than bind) option in the lxc mount line solves the issue (syntax for proxmox):
lxc.mount.entry: /tank/media media none rbind,create=dir,optional 0 0
Going off the RedHat documentation on sharing mounts, rbind achieves replication of mounts on the source in the bound directory (which is what we need), the difference being make-rshared allows a mount on the bind to be reflected in the source.
Just came across the issue myself, and this is the only relevant result on google, so I thought it was appropriate to give an answer despite the age of the question.
| How can I automatically make ZFS filesyatems mount shared / rshared? |
1,429,982,938,000 |
I have been experimenting with privilege escalation using the mount command and would like to know if it is possible to create a suid file owned by root without having access to any external device.
i.e. I'm trying to find a way to do one the following:
bind mount /bin/bash to another file, so that I can set the suid bit on it (and have it stay after unmount somehow). Or bind mount a suid user copy of /bin/bash to a file owned by root.
mount a squashfs, .iso, or other existing filesystem with files normally owned by root in it (example: filesystem.squashfs from an ubuntu .iso image), so that I can set the suid bit on them.
The setup is as follows:
sudo mount with any arguments is allowed
no possibility to get a root suid file onto the computer from another device
I know I can easily gain root by bind mounting /etc/group, /etc/sudoers, etc, but would like to know if other ways are possible, in particular any way to create a root suid file without having access to any external machine (or virtual machine).
|
You stipulate that you are allowed to run sudo mount with any arguments. In that case, unless I misunderstand your question, it seems to be trivially easy to gain root access: just create a disk image that contains a setuid-root binary and mount it with sudo mount -o loop! After all, anyone can create a disk image, it's just bytes...
To prove it, here's a super trivial shell script that will do it:
#!/bin/sh
# Prepare the image
mkdir imgsrc
gcc -xc -o imgsrc/runsh - <<EOF
#include <unistd.h>
int
main(int argc, char **argv)
{
execl("/bin/sh", "sh", NULL);
return 1;
}
EOF
# Create the image
fakeroot sh -c 'chown -Rh 0:0 imgsrc; chmod u+s imgsrc/runsh; mksquashfs imgsrc img'
rm -rf imgsrc
# Mount the image
mkdir mountpoint
sudo mount -r img mountpoint
After running that, you can get a root shell just by running mountpoint/runsh.
If you don't have the necessary tools like fakeroot and mksquashfs then you can simply install them, their source code is freely available. If you can't do that, then you can just create the image in advance somewhere else and copy it onto the system in question. If worse comes to worse you can even base 64 encode the image and paste it at the command line! On my system, the above script generates an image that is just 2600 bytes when gzipped (what an interesting coincidence that it should be exactly that number!), and I'm sure it would be possible to make it even smaller with just a little bit of work. In the old days (1980s, mostly) people used to manually type in larger blocks of data than that transcribed from programming magazines.
| Is it possible to mount a file with different ownership/permissions? |
1,429,982,938,000 |
Please read the following steps to understand my problem,
Execute following commands
mkdir ~/src
mkdir ~/destination
sudo mount ~/src ~/destination --bind -o ro
src folder has been bind mounted to destination folder. When I view the destination folder with nautilus it is read only. But the ll command gives same file permission for both src and destination folders.
What is the reason for this?
How can I view the actual permission of the 'destination` folder?
How does the nautilus display it as read only?
|
There are two things at play here:
Directory permissions.
Mount options.
The directory permissions are independent of the fact that the mount was read-only. Hence, ls will still list the permissions assigned to the folder, without regards for how it was mounted.
In the same way, if I mount a folder with noexec, ls will show that the executable files in there are still executable. Mounting the folder with noexec (or ro in your case) does not change the permissions on files and directories.
The file manager appears to be smarter though, and knows that the directory is mounted read-only. It obviously queries more than just the permission bits to find this out.
From comments: "In my use case I want to read the mount permission with a shell command".
The command mount, without any options, will output all the currently mounted partitions and their mount options:
$ mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=32841600k,nr_inodes=8210400,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=6572324k,mode=755)
(etc.)
The mount options are listed in parenthesis.
You may also investigate /etc/mtab for the currently mounted filesystems. This file has the same format as /etc/fstab, so you could do
awk '{ print $2, $4 }' /etc/mtab
to only get the mount points and the mount options, for example.
| ls -la doesn't display correct permission for a mount --bind folder |
1,470,320,883,000 |
I have the following set-up:
FreeBSD 10.3 with ZFS on root. A ZFS volume hierarchy (multiple volumes nested in each other, for lack of a better name) is duplicated using mount_nullfs in order to make it available to multiple jails at once.
When I try to use find as a normal user on the nullfs-mount I get the following error.
find: fts_read: Permission denied
find does find some files before failing, it seems to fail when it tries to leave a nullfs_mount. The output contains all files from the first volume it recurses.
This only happens when I run find from within the jail and as a user. It does not happen:
As root through nullfs
As root directly on the filesystem
As user directly on the filesystem
Is there some option to mount_nullfs that i'm not aware of?
|
The underlying directory that mount_nullfs mounts over is not traversable to the user. Unmount the nullfs and make sure that users are still able to traverse the directory:
chmod 755 /path/to/unmounted/nullfs
It seems that when traversing away from a filesystem using cd .., the permissions of the underlying directory are used, not the permissions of the mounted filesystem.
| find: fts_read: Permission denied through mount_nullfs |
1,470,320,883,000 |
In a Linux user namespace, as non-root, I bind mount /tmp/foo to itself. This succeeds.
Then, I try to remount /tmp/foo to be read-only. If /tmp is mounted with nosuid or nodev, then the remount fails. Otherwise, the remount succeeds.
Is there some reason why nosuid and/or nodev prevent the remount from succeeding? Is this behavior documented somewhere? I'm puzzled, as I would expect the bind mount and remount to either both succeed, or both fail.
Here is the code to reproduce the bind mount and remount:
#define _GNU_SOURCE /* unshare */
#include <errno.h> /* errno */
#include <sched.h> /* unshare */
#include <stdio.h> /* printf */
#include <string.h> /* strerror */
#include <sys/mount.h> /* mount */
#include <unistd.h> /* getuid */
int main() {
printf ( "getuid %d\n", getuid() );
int rv = unshare ( CLONE_NEWNS | CLONE_NEWPID | CLONE_NEWUSER );
printf ( "unshare %2d %s\n", rv, strerror(errno) );
rv = mount ( "/tmp/foo", "/tmp/foo", 0, MS_BIND | MS_REC, 0 ),
printf ( "mount %2d %s\n", rv, strerror(errno) );
rv = mount ( "/tmp/foo", "/tmp/foo", 0,
MS_BIND | MS_REMOUNT | MS_RDONLY, 0 ),
printf ( "remount %2d %s\n", rv, strerror(errno) );
return 0;
}
Sample output:
$ mkdir -p /tmp/foo
$ mount | grep /tmp
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,relatime,inode64)
$ gcc test.c && ./a.out
getuid 1000
unshare 0 No error information
mount 0 No error information
remount -1 Operation not permitted
$ uname -a
Linux hostname 5.12.12_1 #1 SMP 1624132767 x86_64 GNU/Linux
Whereas, if /tmp is mounted with neither nosuid nor nodev, then the bind mount and the remount will both succeed, as follows:
$ mkdir -p /tmp/foo
$ mount | grep /tmp
tmpfs on /tmp type tmpfs (rw,relatime,inode64)
$ gcc test.c && ./a.out
getuid 1000
unshare 0 No error information
mount 0 No error information
remount 0 No error information
|
I have found the answer.
As can be seen in the below excerpts from the kernel source code, if any of the flags NODEV, NOSUID, NOEXEC, and/or ATIME are already set, I will need to preserve (i.e. continue to set) them in my second call to mount().
From fs/namespace.c in the Linux kernel source code:
/*
* Handle reconfiguration of the mountpoint only without alteration of the
* superblock it refers to. This is triggered by specifying MS_REMOUNT|MS_BIND
* to mount(2).
*/
static int do_reconfigure_mnt(struct path *path, unsigned int mnt_flags)
{
struct super_block *sb = path->mnt->mnt_sb;
struct mount *mnt = real_mount(path->mnt);
int ret;
if (!check_mnt(mnt))
return -EINVAL;
if (path->dentry != mnt->mnt.mnt_root)
return -EINVAL;
if (!can_change_locked_flags(mnt, mnt_flags))
return -EPERM;
down_write(&sb->s_umount);
ret = change_mount_ro_state(mnt, mnt_flags);
if (ret == 0)
set_mount_attributes(mnt, mnt_flags);
up_write(&sb->s_umount);
mnt_warn_timestamp_expiry(path, &mnt->mnt);
return ret;
}
static bool can_change_locked_flags(struct mount *mnt, unsigned int mnt_flags)
{
unsigned int fl = mnt->mnt.mnt_flags;
if ((fl & MNT_LOCK_READONLY) &&
!(mnt_flags & MNT_READONLY))
return false;
if ((fl & MNT_LOCK_NODEV) &&
!(mnt_flags & MNT_NODEV))
return false;
if ((fl & MNT_LOCK_NOSUID) &&
!(mnt_flags & MNT_NOSUID))
return false;
if ((fl & MNT_LOCK_NOEXEC) &&
!(mnt_flags & MNT_NOEXEC))
return false;
if ((fl & MNT_LOCK_ATIME) &&
((fl & MNT_ATIME_MASK) != (mnt_flags & MNT_ATIME_MASK)))
return false;
return true;
}
| In a user namespace as non-root, on a nosuid,nodev filesystem, why does a bind mount succeed but a remount fails? |
1,470,320,883,000 |
I need to use an alternative fstab file for mounting a folder in another folder, like the command
mount --bind /folder1 /folder2
I tried the command
mount --fstab /pathToFile.fstab
as stated in the man:
-T, --fstab path
Specifies an alternative fstab file. If path is a directory then the files in the directory are sorted by strverscmp(3); files that start with . or without an .fstab extension are ignored. The option can be specified more than once. This option is mostly designed for initramfs or chroot scripts where additional configuration is specified beyond standard system configuration.
I create the file this way:
/folder1 /folder2 auto bind 0 0
but the command
mount --fstab /path
does nothing.
I added the line from the alternative file in /etc/fstab and with the
mount -a
the folder is mounted correctly.
Does anybody have experience with the --fstab option?
|
The command
mount --fstab /pathToFile.fstab
is the same as mount with no options when using the standard fstab file, i.e. "list mounted filesystems".
To actually mount all automountable filesystems specified in a custom fstab file similar to using mount -a with the standard fstab files, you'll need to use the --fstab option together with the -a option:
mount --fstab /pathToFile.fstab -a
| Mounting using alternate fstab file |
1,470,320,883,000 |
I'm trying to mount /etc/folder and /var/folder to the same external volume UUID=xyz. This external volume already has subdirectories etc_folder and var_folder and has been formatted and available to mount. I want to change fstab and achieve something like the following, before doing "mount -a":
UUID=xyz:/etc_folder /etc/folder ext4 defaults,nofail 0 2
UUID=xyz:/var_folder /var/folder ext4 defaults,nofail 0 2
But this doesn't work... what exactly should I put in fstab?
|
The following works in /etc/fstab:
UUID=xyz /mnt ext4 defaults,nofail 0 2
/mnt/var_folder /var/folder none bind 0 0
/mnt/etc_folder /etc/folder none bind 0 0
I just need to mount the whole volume to one location e.g. /mnt, keep it there and create binds (seems very much like a symlink).
| Mounting two folders to corresponding directories within external volume? |
1,470,320,883,000 |
I wish to make the following mount permanent:
[michael@devserver ~]$ findmnt | grep public
└─/home/jail/home/public/repo /dev/mapper/centos-root[/home/michael/testing/gateway/repo] xfs ro,relatime,attr2,inode64,noquota
[michael@devserver ~]$
I created this mount using the following:
sudo mkdir /home/jail/home/public/repo
sudo mount --bind /home/michael/testing/gateway/repo /home/jail/home/public/repo
sudo mount -o remount,ro,bind /home/jail/home/public/repo
My /etc/fstab currently looks like the following.
I expected that I should just add /home/michael/testing/gateway/repo /home/jail/home/public/repo xfs ro,relatime,attr2,inode64,noquota 0 0 to /etc/fstab, but upon doing so, my server chokes and I have to go in emergency mode to remove this line from /etc/fstab. What is the proper way to permanently bind mount a directory for read-only access?
[michael@devserver ~]$ cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Fri Apr 8 14:15:42 2016
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/centos-root / xfs defaults 1 1
UUID=362355d4-e5da-44de-bf5c-5ce92cf43888 /boot xfs defaults 1 2
/dev/mapper/centos-swap swap swap defaults 0 0
[michael@devserver ~]$
|
Well, your /etc/fstab file does not seem to have bind mount-point configured.
Be so kind and add the following line:
/home/michael/testing/gateway/repo /home/jail/home/public/repo none bind,ro 0 0.
Then, I would type the following command to verify, if mountpount is persistent and works.
mount /home/jail/home/public/repo
After that, you can reboot your system.
| Editing /etc/fstab to permanently bind mount directory |
1,470,320,883,000 |
Does the command mount -o bind allow mounting a folder from a different file system (vfat, ntfs) to a folder in Linux native partition?
|
Yes. Well, I've made a quick test on my system, mounting a NTFS partition from Windows onto a directory in a XFS Linux partition, and it worked okay.
You have to do this operation as root.
| Bind Mounting across different file systems |
1,470,320,883,000 |
I want to calculate a directory size with all its subdirectories. But I had made some of the subdirectories to mount from a mount point. (using mount -B/--bind)
when I use du -hks the returned size includes the mounted directories. Is there a way to eliminate their size from the result?
Edit:
The Directories I calculate size are all in the same location. There is a Main directory with shared content for all other directories (This contains all the mount points) and Directories have some individual files. The goal is to calculate the individual files size.
|
du -x (at least GNU and busybox du) is fooled by Linux bind-mounts because files have the same device-id, so you'd need to prune the mount-points by hand. With GNU du:
du -xhs --exclude=./bind/mount/point
Alternatively, you could use GNU find to find the files and print their disk usage, calling the mountpoint command to know which directories to prune (which are bind-mounts). Then use awk to do the sums (counting hardlinks only once like du does):
find . -xdev ! -name . -type d -exec mountpoint -q {} \; -prune -o \
-printf '%i %b\n' |
awk '!seen[$1]++ {s+=$2}
END{printf "%.17g\n", s * 512}' |
numfmt --to=iec
That's quite inefficient though in that it needs to run the mountpoint command for each directory (note that it's also possible to bind-mount non-directory files, we're assuming it's not done to avoid running mountpoint on each file).
| Calculating directory size without subdirectories bind-mounted from the same device |
1,470,320,883,000 |
I have 2 files: /MyDir/a and /MyDir/MySubDir/b and am running a bash script, to which I want to add code to make file /a point to file /b, but only in the current process and its descendants.
In hopes of making /MyDir/a point to /MyDir/MySubDir/b in the context of only the current process (not including its descendants, yet) I tried to first make the current process run in its own mount namespace by running a small C program in my script that performs
unshare(CLONE_NEWNS)
and then
mount --bind /MyDir/MySubDir/b /MyDir/a.
Unfortunately, this didn't work as I expected since the mount was still visible by other processes, despite the system call reporting success.
In another attempt, I tried to make the mount from the C code by calling
mount("/MyDir/a", "/MyDir/MySubDir/b", "ext3", MS_BIND, null)
But this didn't work as the mount didn't take effect at all (despite the call reporting success).
Is there a way of making /MyDir/a point to /MyDir/MySubDir/b in the context of only the current process and its descendants using a bash script?
I also read a little about chroot, but this applies only to the / directory...
Is there anything similar to chroot that applies only to a particular subdirectory?
Thanks for your time!
|
A shell-only solution would be:
For interactive shell:
# unshare --mount
# mount --bind /MyDir/MySubDir/b /MyDir/a
#
non-interactively, before a script that doesn't have to know about these settings:
# unshare --mount sh -c 'mount --bind /MyDir/MySubDir/b /MyDir/a; exec somethingelse'
The unshare manpage also warns about shared subtree mounts . If you have to disable them, consider adding for example --make-private to mount.
As Hauke told, you have to be sure to not leave the namespace just after having created it, because it will disappear.
If needed there's a method to maintain a namespace without process. Since it involves mount, it's just a bit more tricky for a mount namespace. Here's an interactive example for this:
shell1# unshare --mount
shell1# echo $$
12345
shell1#
shell2# : > /root/mntreference
shell2# mount --bind /proc/12345/ns/mnt /root/mntreference
Now as long as this reference is kept mounted, the namespace won't disappear even if there's no process using it anymore. Using nsenter --mount=/root/mntreference will enter it, so you can easily run additional scripts in it.
Using the equivalent in C shouldn't be a problem.
| Making a bind-mount take effect only in the context of the current process and its descendants |
1,470,320,883,000 |
I have an encrypted container containing an ext4 filesystem with a subdirectory which is bind-mounted at a later point in time. If I take look at /proc/self/mountinfo, the root-directory for the mount has a value I do not know the reason for.
Steps to reproduce:
cd /tmp
fallocate -l 1G container.luks
cryptsetup luksFormat container.luks
cryptsetup open --type=luks2 container.luks container
mkfs.ext4 /dev/mapper/container
mkdir /mnt/container
mount /dev/mapper/container /mnt/container/
mkdir /mnt/container/subdir
mkdir /tmp/abc
mount -o bind /mnt/container/subdir/ /tmp/abc
cat /proc/self/mountinfo
...
24 1 253:1 / / rw,noatime - ext4 /dev/dm-1 rw
...
56 24 253:5 / /mnt/container rw,relatime - ext4 /dev/mapper/container rw
57 24 253:5 /subdir /tmp/abc rw,relatime - ext4 /dev/mapper/container rw
As per man 5 proc field #4 is
root: the pathname of the directory in the filesystem
which forms the root of this mount.
Why is field #4 of the last line /subdir and not /mnt/container/subdir? Given the information for mount #57, how I am able to deduce, that mount #57 is a bind mount of a subdirectory of mount #56?
Sidenote: umount -R /mnt/container ignores mount #57.
Given the answer from Uncle Billy and several rereads of the relevant man-pages, my explanation is that /subdir is viewed from the root of a potential non-existent mount-point of device 253:5 somewhere in the system.
I hope that makes some sense.
|
56 24 253:5 / /mnt/container
57 24 253:5 /subdir /tmp/abc
Given the information for mount #57, how I am able to deduce, that mount #57 is a bind mount of a subdirectory of mount #56?
It's not. You don't deduce that.
The two mounts are only related by being mounts of the same filesystem/device (253:5); it's not that any of them is a "sub-mount" of the other or anything like that. They're independent of each other.
| Bind-mount and cryptsetup result in truncated root-path in /proc/self/mountinfo |
1,470,320,883,000 |
if i have /target mounted with suid and then make a bind-mount on /bound with mount -o bind,nosuid /target /bound, will nosuid take effect on /bound ?
(imo it should take effect but i'd still like a definite answer, and nobody else had asked yet here or so it seems)
|
yes, bind is capable of enforcing nosuid even if the target has suid. here's a test i ran:
C source code of a.out:
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
int main(){
uid_t uid=getuid(), euid=geteuid();
printf("uid: %u, euid: %u\n",uid,euid);
return 0;
}
and then
root@ratma:/# mount -o bind,nosuid /target /bound
root@ratma:/# su hans
hans@ratma:/$ stat /target/a.out
File: /target/a.out
Size: 16712 Blocks: 40 IO Block: 4096 regular file
Device: 18h/24d Inode: 194454 Links: 1
Access: (6755/-rwsr-sr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2019-12-12 07:52:45.132465174 +0000
Modify: 2019-12-12 07:52:45.132465174 +0000
Change: 2019-12-12 07:53:24.720322010 +0000
Birth: -
hans@ratma:/$ stat /bound/a.out
File: /bound/a.out
Size: 16712 Blocks: 40 IO Block: 4096 regular file
Device: 18h/24d Inode: 194454 Links: 1
Access: (6755/-rwsr-sr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2019-12-12 07:52:45.132465174 +0000
Modify: 2019-12-12 07:52:45.132465174 +0000
Change: 2019-12-12 07:53:24.720322010 +0000
Birth: -
hans@ratma:/$ id
uid=1000(hans) gid=1000(hans) groups=1000(hans),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),109(netdev)
hans@ratma:/$ /target/a.out
uid: 1000, euid: 0
hans@ratma:/$ /bound/a.out
uid: 1000, euid: 1000
success. if it didn't work, it would say "euid: 0" on /bound/a.out :)
| does nosuid work on bind-mounts to suid partitions? |
1,470,320,883,000 |
I have multiple folders that share the same path pattern which I would like to mount them all with a single command if possible. The command I tried is:
sudo mount --bind /var/my/vendor /var/www/official/*/*/vendor
However, it doesn't seem to work. I didn't get any specific error but it seems like I just used the wrong syntax or perhaps this is not supported at all?
|
mount --bind takes two arguments: the path to replicate and the location where it is to be replicated. You seem to be trying to make multiple replicas; to do this, you need to issue multiple mount --bind commands.
for d in /var/www/official/*/*/vendor; do
mount --bind /var/my/vendor "$d"
done
| How to mount multiple folders which share the same path pattern? |
1,470,320,883,000 |
In case you needed to know, I'm on a GNU+Linux distro with kernel version 5.5.5.
So, suppose I have a directory named base. Further suppose this directory only contains one empty file, named a.
Ideally, I'd like to fork that directory retaining its content into a new directory named fork. Then, I'd write something into the file a and, moreover, create a new empty file named b (inside of fork).
The expected behavior I'd like to achieve is that base directory contents remains unaltered (i.e. empty file a only), meanwhile changes made in fork directory persist.
This is the simplest example I could give you, keep in mind that base might contain a lot of files, so the purpose of this is just to avoid copying those files when possible.
Do you happen to know if this is possible? If so, how?
Thanks
|
You can take a look at OverlayFS, or on some distributions the still available aufs.
Here's the description of OverlayFS in the Linux kernel documentation:
Overlay Filesystem
This document describes a prototype for a new approach to providing
overlay-filesystem functionality in Linux (sometimes referred to as
union-filesystems). An overlay-filesystem tries to present a
filesystem which is the result over overlaying one filesystem on top
of the other.
Here's a working example with OverlayFS. It requires two additional directories, one to keep the permanent alterations: all data will be written there, so disk space will be consumed there, and an empty working directory in the same filesystem.
So let's say you have those directories that can be in three different filesystems mounted as /fs1, /fs2 and /fs3 (all can of course be on the same filesystem):
/fs1/base
/fs2/delta
/fs2/work
/fs3/fork
As documented in the previous link, you mount the final merged view (/fs3/fork) with:
mount -t overlay overlay -olowerdir=/fs1/base,upperdir=/fs2/delta,workdir=/fs2/work /fs3/fork
And that's it. You'll have to read the documentation to know about limitations (eg: when NFS is involved etc.)
| How to mount (bind) in a one-way writing fashion |
1,470,320,883,000 |
I have the following mount and automount units enabled for my external USB drive.
Mount Unit:
[Unit]
Description=Time Machine Drive Mount Service
[Mount]
What=/dev/disk/by-uuid/some-uuid
Where=/media/timemachine
Type=hfsplus
[Install]
WantedBy=multi-user.target
Automount Unit:
[Unit]
Description=Time Machine Drive Automount Service
[Automount]
Where=/media/timemachine
[Install]
WantedBy=multi-user.target
How do I tell systemd to bind the mount point to another directory every time I plug in the drive?
|
This issue for the upstream project systemd would seem to indicate that what you're trying to do is not possible, and they aren't going to add it, mainly due to limitations with how the kernel works.
Mount unit with 'bind' type does not remounted on parent remount #6542
excerpt
please note that bind mounts after they have been made are entirely independent entry points to the same file system than the original mount used to create them. This means, after creating /opt/oh as bind mounts the fact that /mnt/sda is on an automount point is entirely irrelevant for its lifecycle: the new bind mounts point directly to the effective file system, they lose any automount magic. And that's a kernel design choice and is nothing systemd can do anything about it.
Sorry, but systemd can't do what you want to do, because the kernel simply doesn't work that way!
sorry!
At any rate, you're left with alternative methods, one of which is described in this U&L Q&A titled: Bind USB drive to home directory on demand.
| How to tell systemd to create a bind mount when plugging in an automounted drive? |
1,470,320,883,000 |
I have a custom, non-default Ubuntu installation, where I use my other Linux distro's boot manager (rEFInd). As such, I don't want Ubuntu to see my EFI partition, on the principle that it has no business to what's there (which has already saved my ass last night when I did an rm -rf /*...). However, because I'm using btrfs as my file system, my /boot directory has to be in a UEFI-readable partition—like the EFI partition. So my solution to this conundrum is to shadow bind mount a subdirectory of the EFI partition, esp:\EFI\ubuntu, onto /boot through commands like these:
mount /dev/sdb2 /boot
mount --bind /boot/EFI/ubuntu /boot
This works perfectly. Ubuntu has access to a /boot partition that it can freely drop its vmlinuz and initramfs into and my boot manager automatically detects the installation. Booting and updating works as expected. The only caveat is, so far, that I needed to use the commands to mount /boot. So like any responsible sysadmin, I made an fstab entry:
UUID=XXXX-XXXX /boot vfat rw,relatime 0 0
/boot/EFI/ubuntu /boot none bind 0 0
Despite being analogous to the commands above, on boot the entire EFI partition remains mounted. The second line, performing the shadow bind mount, does not seem to execute. Is there a way to make this work in fstab and if not, what would be a reliable way to perform the bind mount as quickly as possible after the initial mount?
|
As @RamanSailopal suggested, the answer was (of course) in dmesg. The root of the problem was that systemd creates unit files from fstab entries, and for whatever reason, they must have a filename that maps to the mountpoint. In other words, multiple mounts per mountpoint are disallowed.
I worked around this by creating a systemd service file that injects itself as a dependency of local-fs.target, by all means acting like a regular systemd mount unit:
/etc/systemd/system/boot-shadow-mount.service:
# Performs the shadow bind mount to hide the ESP at /boot
# and instead expose the ubuntu subdirectory.
[Unit]
Description=/boot shadow bind mount
Requires=boot.mount
Conflicts=umount.target
[Service]
Type=oneshot
ExecStart=/bin/mount --bind /boot/EFI/ubuntu /boot
ExecStop=/bin/umount /boot
RemainAfterExit=True
[Install]
RequiredBy=local-fs.target unattended-upgrades.service
| Shadow bind mount in fstab |
1,470,320,883,000 |
Trying to use a chrooted system via
mount -B stage3 gentoo
mount -t sysfs none gentoo/sys
mount -t proc none gentoo/proc
mount -R /dev gentoo/dev
mount --make-rslave gentoo/dev
unshare --fork chroot gentoo
umount -R gentoo
After the last umount, dev, dev/pts, dev/shm, dev/mqueue, dev/hugepages were still mounted under stage3.
I have two questions,
Why they were mounted to stage3?
How could I unmount those? Every mountpoint is busy.
OS: Ubuntu Xenial. Kernel: 4.13.4, but I have got same issue with kernel like 4.10 and others.
|
Why they were mounted to stage3?
Because you bind-mounted stage3 onto gentoo and stage3 propagation flag is set to shared (verify this with: findmnt -o PROPAGATION stage3)
How could I unmount those? Every mountpoint is busy.
You've just spawned a chroot on the mounted tree. If you want to unmount the tree while the chroot command is running, make the mount namespace private to the chroot:
unshare --mount --fork chroot gentoo
| How to unmount a mountpoint with rbind and rslave? |
1,470,320,883,000 |
I was trying to attach specific USB drive to home folder of the user. I have installed vsftpd, but Kodi can't move on upper hierarchy. So he can't access /media folder, but FileZilla can.
My USB is automounted by system when I connect it,as /media/DRIVE, always with same name.
I'm trying to create symlink ln -s /media/DRIVE /home/user/DRIVE — this works for navigation, when i trying to access file this always not working, I don't know why. User has access to this folder and file, he is sudouser.
So I found the much better solution mount --bind /media/DRIVE /home/user/DRIVE — and thats works as I wanted. All fine, but after device ejected and plugged in again the system create new folder /media/DRIVE_ so this bind is not working.
I also try to bind specific device by UUID, but no result.
What I doing wrong? I googled more, and found advice to create custom systemd service for that, is this correct way, and where I can read documentation for mounting services.
I'm using Debian with systemd.
|
You could try the debian usbmount package. The script /usr/share/usbmount/usbmountis triggered by udev when a USB storage device is connected, according to the rules in /lib/udev/rules.d/usbmount.rules. It looks for e.g. the UUID of the device, and mounts according to entries in the /etc/fstab (which, of course, should have option noauto).
Or modify /etc/usbmount/usbmount.conf for the path of (dynamic) mount points (if no entry in etc/fstab). This is also supported.
If this does not match your needs, you may modify the usbmountscript, e.g. to name the dynamic mount points after the UUID of the device.
| Bind USB drive to home directory on demand |
1,470,320,883,000 |
BACKGROUND INFORMATION :
I have an init script that allows me to mount a folder to tmpfs, while bind-mounting the folder on drive to another location, so I can sync the contents (on startup, shutdown, and when needed) between the tmpfs and the original folder on system drive.
It's used mostly to move to ram the folders and stuff that is written often to avoid excessive writes in the system drive (which is a USB flash or SD card).
I have a different init script for each mountpoint I need (each is actually generated by a setup script which is not relevant here).
Each of these init scripts does (as soon as possible during boot):
bind mount of folder X to another folder called X-bindmount located somewhere else in main drive. (the folder X-bindmount is also created if needed)
mount folder X as tmpfs
move content from X-bindmount to X (which is now a tmpfs and empty)
on shutdown or when asked to it syncs from X to X-bindmount.
QUESTION :
How can I do this more or less natively with systemd?
I can cobble together a systemd service that calls a script, what I'm asking is if there is a better, native way.
|
Asked this question in the systemd-devel mailing list, and got a definitive answer from Lennart. http://lists.freedesktop.org/archives/systemd-devel/2015-November/035043.html
Pasting here the answer, for posterity.
No, there is not. And I don't really see this a strong enough usecase
to make it something native.
Sorry.
Lennart
-- Lennart Poettering, Red Hat
| migrating to systemd a startup-shutdown script that works with tmpfs and bindmounts |
1,470,320,883,000 |
Suppose I bind-mount file a atop file b...
$ echo 'line 1' > a
$ touch b
$ mount --bind a b
The initial file contents will be mirrored at both paths, as expected:
$ cat a
line 1
$ cat b
line 1
And if I concatenate to either path, the new contents will be mirrored both ways, as expected:
$ echo 'line 2' >> a
$ cat a
line 1
line 2
$ cat b
line 1
line 2
$ echo 'line 3' >> b
$ cat a
line 1
line 2
line 3
$ cat b
line 1
line 2
line 3
However, I can't overwrite b via mv:
$ echo 'totally new contents' > temp
$ mv tmp b
mv: can't rename 'tmp': Device or resource busy
Is there a way to get this to work so that the new contents are mirrored at a?
The reason I want to do this has to do with the way my system's filesystem is set up.
It's an embedded system, so most of the filesystem is mounted read-only. Certain 3rd-party services try to write to hard-coded files like /etc/machine-info or /etc/hostname, which doesn't work because they're read-only. Our normal way of working around this is to have a writable partition containing just the files that we expect to be modified, and then bind-mount those writable files onto the traditional Linux paths where the services can find them.
This works when the process opens the file for writing and modifies it in-place. But, as described above, it doesn't work when the process does the equivalent of mv.
|
Because a and b are involved in a mount point, you can't use mv.
However, you could overwrite it with cp.
Or, instead of bind mounting onto b, you could bind mount the parent directory.
| Can a file that's being supplied by bind-mount support overwriting via `mv`? |
1,470,320,883,000 |
From the proc manual it names the 4th column of mountinfo as "root", and describes it as "the pathname of the directory in the filesystem which forms the root of this mount". But how to understand it?
I thought the basic elements of a mount is the source and the target path, since the "mount source" is the 10th column and target at 5th column, then what does the root used for?
For most mount info, the root is just /, seem to be meaningless. I only find the bind mounts have a root different from /, so it's only useful in bind mounts? And in bind case, why not show the absolute path in root? For example, when bind the /run/test_dir/a to /run/test_dir/b, the root column shows /test_dir/a, why hiding the /run part?
|
It is hard to explain it with language elements (at least with my english skills) - so I decided to make an example based answer:
The root directory is often called the highest or uppest directory. This is only partially true. This directory is assumed as the highest directory. You could describe it with "from this directory I will start - I assume this is the highest directory and there is nothing above".
Some examples to clarify what "root" means:
Imagine you run a web server and set the root of a domain example.com to /var/www/html/example.com. Now you create a file /var/www/html/example.com/test.html. If you open https://example.com/test.html in your browser. you get the content of the created file. If you set /var/www/html as root, you must open https://example.com/example.com/test.html
If you chroot into the directory /home/test/testSystem/. The root of this environment would be /home/test/testSystem. If you do an ls inside the chrooted environment ls / you would get the content of /home/test/testSystem/
Mountpoint with root /
For example an USB contains:
/
├── dir1
│ ├── subfile1
│ └── subfile2
├── file1
├── file2
└── file3
If you mount this USB to /mnt you would get the normal output you expect because you use the / directory of the USB as root:
531 137 0:52 / /mnt rw,nosuid,nodev shared:75 - /dev/sdb [...]
So in the most cases, the root of mount points would be indeed /.
Mountpoint with different root than /
You can try this by yourself:
Bind two directorys in you filesystem together with
$ mount --bind /var/test1 /var/test2
The output of mountinfo would be something like:
564 29 0:26 /var/test1 /var/test2 rw,relatime shared:1 - ext4 /dev/sda rw [...]
The root of mountpoint located under /var/test2 is /var/test1. The mount source (what you have mounted) is /dev/sda
Back to the USB example:
If you now mount the content of /mnt/dir1 to something other, you would get the mount root /dir1 and the mount source would be /dev/sdb (the USB). The /mnt part is dropped here.
"Why hiding the /run part"
In short: /run is dropped because it is a tmpfs partition.
Why are those parts removed?
In the USB example we mounted dir1 of /dev/sdb to /home/test/usbmnt/. The output would be:
564 29 0:26 /dir1 /home/test/usbmnt/ rw,relatime shared:1 - ext4 /dev/sdb rw [...]
You see we mounted the content of /dir1 (from the USB and NOT from your hard drive) to a directory called usbmnt.
Maybe it is helpful to read it as /dev/sdb/dir1.
If the root would be given as /mnt/usb/dir1 we couldn't know what is the real location on the USB: It could be /dir1, /usb/dir1 or maybe /mnt/usb/dir1
| What does the 4th column (root) in /proc/.../mountinfo mean? |
1,553,373,938,000 |
my raspberry pi 3 model B, running Arch, has an issue with bluetooth. First of all:
Bluetooth has worked flawlessly previously
pi-bluetooth from the AUR is up to date
bluez and bluez-utils are up to date
The system is up to date as well (just ran pacman -Syu)
Still, when I try to use the bluetooth interface, it doesn't work.
bluetoothctl (as root), when I run "scan on", tells me
Failed to start discovery: org.bluez.Error.NotReady
wminput can't find the bluetooth interface:
No Bluetooth interface found
unable to connect
"systemctl status bluetooth" has the following output:
● bluetooth.service - Bluetooth service
Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; enabled; vendor preset: disabled)
Active: active (running) since Sat 2019-03-23 21:32:47 CET; 9min ago
Docs: man:bluetoothd(8)
Main PID: 2005 (bluetoothd)
Status: "Running"
Tasks: 1 (limit: 1404)
CGroup: /system.slice/bluetooth.service
└─2005 /usr/lib/bluetooth/bluetoothd
Mar 23 21:32:47 media.lan systemd[1]: Starting Bluetooth service...
Mar 23 21:32:47 media.lan bluetoothd[2005]: Bluetooth daemon 5.50
Mar 23 21:32:47 media.lan systemd[1]: Started Bluetooth service.
Mar 23 21:32:47 media.lan bluetoothd[2005]: Starting SDP server
Mar 23 21:32:47 media.lan bluetoothd[2005]: Bluetooth management interface 1.14 initialized
I am at my wits end here, everything seems to be fine, yet nothing works. What is going on here?
|
Okay, wow, turns out all I had to do was run
bluetoothctl power on
| bluetooth.service running, but bluetoothctl says "org.bluez.Error.NotReady" |
1,553,373,938,000 |
I am new to Fedora and recently installed Fedora 26 OS. I am trying to connect to wifi using that. I followed the youtube video Broadcom installation and tried to install the Broadcom drivers. I have downloaded the rpm file broadcom-wl-6.30.223.271-2.fc26.noarch.rpm when I ran the command rpm -ivh broadcom-wl-6.30.223.271-2.fc26.noarch.rpm it says wl-kmod >= 6.30.223.271 is needed.
I googled and found that it is the package akmod-wl-6.30.223.271-13.fc26.x86_64.rpm and when I try to install it it says wl-kmod-common >= 6.30.223.271 is needed. When I googled I found that it is package broadcom-wl-6.30.223.271-2.fc26.noarch.rpm. It seems to be a deadlock as one require each other.
broadcom-wl - which has wl-kmod(akmod-wl) as requirement
akmod-wl - which has wl-kmod-common(broadcom-wl) as requirement
I have been struck in this for 2 days. Any suggestions on this regard will be helpful.
|
There is no problem if both rpm files depend on one another; just install the two together:
rpm -ivh akmod-wl-6.30.223.271-13.fc26.x86_64.rpm broadcom-wl-6.30.223.271-2.fc26.noarch.rpm
Logically; if there are more dependencies; you can install all of them together. If you don't want to hassle with all these dependencies; try installing the rpms with a package manager (like zypper or yum).
| What to do with a circular dependency between two packages in Fedora? |
1,553,373,938,000 |
I just installed Arch, and I noticed that my wifi range is very poor. I have to be about 10 feet away from the router for it to work. I also noticed that when I boot, I get this message:
Support for cores revisions 0x17 and 0x18 disabled by module param allhwsupport=0. Try b43.allhwsupport=1
I am completely new to Linux and I have no idea what this means. I would assume that I would re-install or update my drivers, but I have no idea how to do that. I looked for about 3 hours on the Arch wiki, but no where on there does it say how to actually update the drivers. It's as if it's assumed that I know how to do it. I am using a Broadcom chip, and I would like to know if it's a simple problem, or how I can update or reinstall the drivers via the terminal. Is it done with pacman? I have no idea.
|
It seems that support for that particular chip or firmware version is still not very stable.
The message is telling you to pass an option to the b43 kernel module to activate support for your chip version. This may improve things or not. To do so, create a file /etc/modprobe.d/local-b43.conf containing the lines
# Activate experimental support for some hardware revisions
options b43 allhwsupport=1
To make the settings come into effect, turn off networking and unload then reload the module with the commands
rmmod b43
modprobe b43
Run these commands as root, i.e. with su or sudo.
Aside: Arch is a distribution for people who like a hands-on approach. If you prefer things to be done automatically, it may not be the best distribution for you.
| b43 wireless driver error |
1,553,373,938,000 |
I have a Lenovo Yoga 3 that apparently has a new Broadcom Bluetooth device.
The bluetooth is detected at boot and when I try to pair a something in gnome, I can see a list of devices but none of them pair.
How can I get this device to work?
lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 048d:8386 Integrated Technology Express, Inc.
Bus 001 Device 003: ID 5986:0535 Acer, Inc
Bus 001 Device 002: ID 0489:e07a Foxconn / Hon Hai
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
usb-devices
T: Bus=01 Lev=01 Prnt=01 Port=03 Cnt=02 Dev#= 2 Spd=12 MxCh= 0
D: Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=0489 ProdID=e07a Rev=01.12
S: Manufacturer=Broadcom Corp
S: Product=BCM20702A0
S: SerialNumber=38B1DBE337E4
C: #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=0mA
I: If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
I: If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
I: If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
I: If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=01 Driver=(none)
|
As of version 3.19, this device is supported in the Linux kernel, but you need to manually provide the device's firmware to the kernel.
Finding the Firmware:
You can find the firmware in the device's Windows driver, which you can download from Lenovo (or your computer manufacturer's website). Many drivers can just be unzipped, but for this particular computer, the driver is an .exe file and must be extracted with wine.
wine 4ab802rf.exe
Follow the "installation" instructions. The wizard will extract the .exe file and on the last step will ask to install it. Uncheck "Install Broadcom Bluetooth Driver now":
The driver file has been extracted to ~/.wine/driver_c/drivers/Broadcom Bluetooth Driver/
Identifying the right file
In my case, there are 20 - 30 firmware files in the extracted package. Which one corresponds to your device is revealed in one of the driver's inf files. Find your device ID from the output of lsusb or if that's unclear, usb-devices. In this case, it's e07a. Then grep the inf files to find out which one talks about that device:
grep -c E07A -r --include \*.inf
Win32/LD/bcbtumsLD-win7x86.inf:0
Win32/bcmhidnossr.inf:0
Win32/btwl2cap.inf:0
Win32/btwavdt.inf:0
Win32/btwrchid.inf:0
Win32/bcbtums-win8x86-brcm.inf:17
Win32/btwaudio.inf:0
Win64/LD/bcbtumsLD-win7x64.inf:0
Win64/bcmhidnossr.inf:0
Win64/btwl2cap.inf:0
Win64/btwavdt.inf:0
Win64/btwrchid.inf:0
Win64/bcbtums-win8x64-brcm.inf:17
Win64/btwaudio.inf:0
Autorun.inf:0
So in this driver, you can look in either Win32/bcbtums-win8x86-brcm.inf or Win64/bcbtums-win8x64-brcm.inf. Look through the file and find the hex file that is mentioned near E07A:
;;;;;;;;;;;;;RAMUSBE07A;;;;;;;;;;;;;;;;;
[RAMUSBE07A.CopyList]
bcbtums.sys
btwampfl.sys
BCM20702A1_001.002.014.1443.1496.hex
So the fimware is in the same directory and named BCM20702A1_001.002.014.1443.1496.hex.
Converting and Placing the Firmware
Download and compile the hex2hcd tool.
git clone https://github.com/jessesung/hex2hcd.git
cd hex2hcd
make
Convert the firmware to hcd:
hex2hcd BCM20702A1_001.002.014.1443.1496.hex firmware.hcd
Rename and move the firmware to the system's firmware subdirectory:
su -c 'mv firmware.hcd /lib/firmware/brcm/BCM20702A0-0489-e07a.hcd'
The name of this file is critical. The two sets of four characters, in this case 0489-e07a, should match your device's Vendor ID and Product ID.
Loading the Firmware
The easiest way to load the firmware is to power off your computer and turn it on again. Note that the computer should be turned off; a simple reboot may not be sufficient to reload this firmware.
| How can I get the Bluetooth working on my Lenovo Yoga 3? |
1,553,373,938,000 |
I've installed Debian Jessie to dual-boot on a Macbook Pro 12,1. So far, I haven't been able to set up my WiFi drivers correctly. I've followed the instructions here in this way:
Found my chipset using the table on the documentation above.
BCM43602 14e4:43ba
Downloaded necessary .bin files by cloning the repository and moving the files for my chipset (brcm/brcmfmac43602-pcie.bin and brcm/brcmfmac43602-pcie.ap.bin) into /etc/firmware/brcm.
I haven't done the step that reads:
For SDIO driver you need to copy the nvram for your system and place it in /lib/firmware/brcm.
The reason is because I don't think the computer would be using the SDIO driver, but rather the PCIE driver. I'm not sure about this. A secondary reason is that I could not find the nvram file in /sys/firmware/efi/efivars after mount -t efivarfs none /sys/firmware/efi/efivars.
On rebooting, the driver appears not to be working. Any ideas?
|
The notes for the chip BCM43602 say:
Supported in 3.17+.
You probably have an older kernel. Check by running:
uname -r
If this is the case, update your kernel to >= 3.17 and everything will work properly.
Updating your kernel
You can update your kernel by adding jessie-backports to your sources list. Open up /etc/apt/sources.list and add:
deb http://httpredir.debian.org/debian jessie-backports main
Save, then determine which kernel you want to install:
apt-cache -t jessie-backports search linux-image
Then, run the following, replacing VERSION with the kernel version.
apt-get update
apt-get -t jessie-backports install linux-image-VERSION
| WiFi not working with Broadcom 43ba driver |
1,553,373,938,000 |
I have a broadcom wireless card in my laptop and as far as I know, it acts as an USB device.
I also have one USB stick wireless device (TL-WN422G - uses ath9k_htc driver) which I want to use at the same time as the first (Broadcom) device.
The problem is, after I load ath9k_htc - iwconfig does not show the new USB device (the TL-WN422G - wlan1 / ath0 / whatever), but only the old one (wlan0 - Broadcom, checked by MAC).
I tried this USB device (TL-WN422G) on my other computer that has PCI wireless card in it, and they both worked just fine together after I pluged it in... I get wlan0 (Ralink) and wlan1 (TL-WN422G).
Is it some kind of a problem for the laptop that both devices are recognized as USB?
How do I make wlan1 appear on my laptop?
also, my system is fully up to date 2.6.35 kernel (Arch)
edit:
I've already downloaded the needed ar9271.fw from linuxwireless.org and I put it into /lib/firmware - something wrong in that?
dmesg gives me this on laptop:
usb 1-5: new high speed USB device using ehci_hcd and address 9
usb 1-5: ath9k_htc: Firmware - ar9271.fw not found
ath9k_hif_usb: probe of 1-5:1.0 failed with error -22
and this on the computer that does work:
usb 1-5: new high speed USB device using ehci_hcd and address 4
usb 1-5: ath9k_htc: Transferred FW: ar9271.fw, size: 51280
ath: EEPROM regdomain: 0x809c
ath: EEPROM indicates we should expect a country code
ath: doing EEPROM country->regdmn map search
ath: country maps to regdmn code: 0x52
ath: Country alpha2 being used: CN
ath: Regpair used: 0x52
cfg80211: Calling CRDA for country: CN
Registered led device: ath9k-phy1::radio
Registered led device: ath9k-phy1::assoc
Registered led device: ath9k-phy1::tx
Registered led device: ath9k-phy1::rx
usb 1-5: ath9k_htc: USB layer initialized
usbcore: registered new interface driver ath9k_hif_usb
|
for some reason the ar9721.fw file was empty… downloaded the file again – put it into /lib/firmware and now it works…
| Multiple USB wireless devices? |
1,553,373,938,000 |
I have a problem similar to this:
Unable to get Broadcom wireless drivers working on Arch Linux
But in my case, loading the broadcom-wl-dkms driver did not work. I am new to this, so maybe the solution is quite simple (hopefully).
What I did so far:
I installed various drivers with yaourt and pacman, ending up with the broadcom-wl-dkms driver.
When I list the available internet devices with ip link I still only get two results, the lo and the chipset of my motherboard (where the LAN´s plugged in and works just fine).
With lsmod I thought I would get a list of all active drivers, but the broadcom-wl-dkms is not shown there.
What do I have to do in order to get the drivers all set up and running?
Ah, running wifi-menu gives me returns in bright red INVALID INTERFACE SPECIFICATIONS but I'm guessing that's just because it can't see any wireless networking devices.
I read quite a lot of posts but nothing really helped so far (And yes, I checked the Arch Wiki beforehand).
Does it have something to do with the driver being restrictively licensed drivers?
Output of lspci -knn | grep net -A2 :
00:1f.6 Ethernet controller [0200]: Intel Corporation Ethernet
Connection (2) I219-V [8086:15b8] (rev 31) Subsystem: Micro-Star
International Co., Ltd. [MSI] Ethernet Connection (2) I219-V
[1462:7a12] Kernel driver in use: e1000e Kernel modules: e1000e
Fascinating: output of lspci -knn|grep Net -A2:
07:00.0 Network controller: Broadcom Limited BCM4360 802.11ac Wireless
Network Adapter (rev 03)
Running lsmod | grep wl produces no result. How do I load the driver?
|
I finally got it working.
My working environment: 4.16.5-1-ARCH [rname -r]
My Desktop: GNOME
My Network-Env.: network-manager-applet 1.8.11dev+12+ga37483c1-1
My Wlan-Card: Broadcom Limited BCM4360 802.11ac Wireless Network Adapter [14e4:43a0] [lspci -vnn -d 14e4:]
What I did:
I looked at https://wireless.wiki.kernel.org/en/users/Drivers/b43#Supported_devices[/url:2j8cyqph] to find compatible drivers, which in my case turned out to be none but the wl package (install with pacman -S broadcom-wl). Make sure everything is up-to-date with sudo pacman -Sy, after that make sure your filesystem is all good with sudo pacman filesystem linux (which it wasn't in my case ;)). Check if your systems version uname -r && pacman -Q linux. Reboot. This already solved it, as the new kernel update brought some changes to
b43-firmware broadcom-wl nvidia
rmmod b43 b43legacy bcm43xx bcma brcm80211 brcmfmac brcmsmac ssb wl 117
modprobe wl
did change nothing for me, but you can try /(as mentioned in the wiki ->https://wiki.archlinux.org/index.php/Broadcom_wireless)
You might have to restart Network Manager: systemctl restart NetworkManager.service
What might have helped was installing linux headers: sudo pacman -S linux-headers
I don't know for sure what changed it to working, I guess it was the kernel update.
| Broadcom Wireless PCI Card BMC4360 14e4:43a0 cannot get drivers working |
1,553,373,938,000 |
I just installed Debian Wheezy stable. I am now facing the problem, that I am not able to activate the WiFi. I use a HP-Pavilion DM1 notebook with a button (F12 and wlan button) to activate the WiFi. However pressing it does not cause any reaction.
Furthermore ifconfig -a does not list wlan0.
The computer is equipped with a Broadcom BCM4313 Wireless LAN controller, so I installed the firmware-brcm80211 driver.
As a network manager I installed WICD since I use the XFCE desktop.
Does anybody have a clue what is going on?
|
I found a solution for my problem. I tested different drivers that were mentioned for the Broadcom Chip. The first success was a slow wifi connection. The thing is to have a look that sometimes more than one driver module can be disturbing for the driver. Driver modules can be unloaded with modprobe -r followed by the module name. They can be loaded by the same command without the -r.
Still the connection was slow. I found the solution on this debian wiki page. The driver described here is the vendor driver wl from Broadcom.
This one is seen skeptical by the debian community because it is not open-source and seems to cause problems sometimes. However it works good for me so far.
What I did was (as superuser):
$ apt-get update
$ apt-get install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,') broadcom-sta-dkms
$ modprobe -r b44 b43 b43legacy ssb brcmsmac #That's where 5 unneeded modules are unloaded...
$ modprobe wl #...and the right one is loaded this way
Note that non-free repositories need to be enabled. For more info see provided link (above).
Edit:
If anybody has the same issue: Be careful! I don't know if this is related to the previous problem, but one day later I try to boot the laptop and booting doesn't work anymore. I just get something that seems to be a kernel panic error. Maybe the two problems are not related, but who knows! Maybe this is one of the problems of the wl module why the debian community hates proprietary drivers.
Edit 2:
The two problems are definitely related. A possible solution can be found on this page. In summary the proposed solution is:
Make sure the interfering modules are blacklisted at /etc/modprobe.d/broadcom-sta-dkms.conf
Add hp_wmi, lib80211 and lib80211_crypt_tkip to the initramfs by writing them into /etc/initramfs-tools/modules.
This works for me, I guess. No problem since nearly one week!
Update 24.03.2014: Still no problems
| Debian: Unable to activate wifi on HP Pavilion Dm1-4055sg (with Broadcom BCM4313) |
1,553,373,938,000 |
I know Broadcom does not play nice with Fedora, I've been dealing with this for several years and versions. In the past, installing kmod-wl or akmod-wl was usually enough to get everything up and running (after blacklisting b43 and b43 legacy and long time ago).
Details:
Lenovo Thinkpad Twist s230u
uname -r
4.9.5-200.fc25.x86_64
lspci -vnn -d 14e4:
03:00.0 Network controller [0280]: Broadcom Limited BCM43228 802.11a/b/g/n [14e4:4359]
Subsystem: Broadcom Limited Device [14e4:0607]
Flags: bus master, fast devsel, latency 0, IRQ 11
Memory at f1d00000 (64-bit, non-prefetchable) [size=16K]
Capabilities: <access denied>
Kernel modules: bcma
rpm -qa | grep -e kernel -e broadcom-wl -e kmod-wl | sort
abrt-addon-kerneloops-2.9.0-1.fc25.x86_64
akmod-wl-6.30.223.271-7.fc25.x86_64
broadcom-wl-6.30.223.271-1.fc24.noarch
kernel-4.8.6-300.fc25.x86_64
kernel-4.9.5-200.fc25.x86_64
kernel-core-4.8.6-300.fc25.x86_64
kernel-core-4.9.5-200.fc25.x86_64
kernel-debug-devel-4.9.5-200.fc25.x86_64
kernel-headers-4.9.5-200.fc25.x86_64
kernel-modules-4.8.6-300.fc25.x86_64
kernel-modules-4.9.5-200.fc25.x86_64
kernel-modules-extra-4.8.6-300.fc25.x86_64
kernel-modules-extra-4.9.5-200.fc25.x86_64
kmod-wl-6.30.223.271-7.fc25.x86_64
libreport-plugin-kerneloops-2.8.0-1.fc25.x86_64
I restarted Network Manager to no avail. Rebooted, no change.
ifconfig
enp4s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.170 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::dbf:6e57:4c52:2a14 prefixlen 64 scopeid 0x20<link>
ether 20:89:84:d2:7b:2c txqueuelen 1000 (Ethernet)
RX packets 274564 bytes 389721772 (371.6 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 73269 bytes 6440437 (6.1 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1 (Local Loopback)
RX packets 192 bytes 14760 (14.4 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 192 bytes 14760 (14.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 52:54:00:e1:8a:4d txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
but iwconfig
virbr0-nic no wireless extensions.
virbr0 no wireless extensions.
lo no wireless extensions.
enp4s0 no wireless extensions.
modprobe with any wl (akmod-wl; kmod-wl; broadcom-wl) I've used before returns:
modprobe: FATAL: Module ______ not found in directory /lib/modules/4.9.5-200.fc25.x86_64`
When I installed using dnf did the modules end up in the wrong place? We're digging deeper into this and how Linux actually works that I've ever gone before. Is it an issue that the broadcom-wl ends in fc24.noarch in stead of fc25.something? Anything, please.
EDIT TO ADD
sudo akmods --force
Checking kmods exist for 4.9.5-200.fc25.x86_64 [ OK ]
Files needed for building modules against kernel
4.9.5-200.fc25.x86_64 could not be found as the following directories are missing:
/usr/src/kernels/4.9.5-200.fc25.x86_64/
/usr/lib/modules/4.9.5-200.fc25.x86_64/build/Is the correct kernel-devel package installed?
EDIT TO ADD (2):
sudo dnf install kernel devel leads to this:
[Kennedy@Shield_Generator ~]$ sudo dnf install kernel-devel
[sudo] password for Kennedy:
google-chrome 26 kB/s | 3.7 kB 00:00
Fedora 25 - x86_64 - Updates 18 MB/s | 17 MB 00:00
Last metadata expiration check: 0:00:11 ago on Tue Jan 31 19:43:34 2017.
Package kernel-debug-devel-4.9.5-200.fc25.x86_64 is already installed, skipping.
Dependencies resolved.
================================================================================
Package Arch Version Repository Size
================================================================================
Skipping packages with conflicts:
(add '--best --allowerasing' to command line to force their upgrade):
kernel-devel x86_64 4.9.6-200.fc25 updates 11 M
Transaction Summary
================================================================================
Skip 1 Package
Nothing to do.
Complete!
sudo akmods --force
[Kennedy@Shield_Generator ~]$ sudo akmods --force
Checking kmods exist for 4.9.5-200.fc25.x86_64 [ OK ]
Files needed for building modules against kernel
4.9.5-200.fc25.x86_64 could not be found as the following
directories are missing:
/usr/src/kernels/4.9.5-200.fc25.x86_64/
/usr/lib/modules/4.9.5-200.fc25.x86_64/build/Is the correct kernel-devel package installed? [FAILED]
sudo dnf install -y broadcom-wl kernel-devel
[Kennedy@Shield_Generator ~]$ sudo dnf install -y broadcom-wl kernel-devel
Last metadata expiration check: 0:44:34 ago on Tue Jan 31 19:43:34 2017.
Package broadcom-wl-6.30.223.271-1.fc24.noarch is already installed, skipping.
Package kernel-debug-devel-4.9.5-200.fc25.x86_64 is already installed, skipping.
Package kernel-debug-devel-4.9.6-200.fc25.x86_64 is already installed, skipping.
Dependencies resolved.
Nothing to do.
Complete!
So they're installed, but not found in the correct directories? Whisky Tango Foxtrot, over.
ETA (3)
$ rpm -qa | grep -e kernel-debug
[Kennedy@Shield_Generator ~]$ rpm -qa | grep -e kernel-debug
kernel-debug-devel-4.9.5-200.fc25.x86_64
kernel-debug-devel-4.9.6-200.fc25.x86_64
rpm -qa | grep -e kernel-devel
[Kennedy@Shield_Generator ~]$ rpm -qa | grep -e kernel-devel
[Kennedy@Shield_Generator ~]$
[Kennedy@Shield_Generator ~]$
|
I have exactly the same issue, I installed kernel-devel
sudo dnf install kernel-devel-4.9.6-200.fc25.x86_64
then I followed the same steps that Xenox mentioned in his answer and now wifi is working fine
| Fedora 25 Broadcom Wireless BCM43228 No WiFi |
1,553,373,938,000 |
I'm currently searching for the right driver for my Broadcom BCM4313 network/wifi device.
At first no network was recognized at all, now I managed to connect, but the connection is really slow. I read that it can be helpful to unload some driver modules with modprobe since they can disturb each other. To find the right driver I'm thinking of trying to unload all of them and then activate each one alone.
Is there a possibility to find out which modules are activated and is there a command to unload all wifi modules at once?
Any other hints concerning my troubleshooting are welcome as well.
Edit:
To prevent misunderstanding: From the comments I assume that screening the modules is not a good way to find the right driver. I was still looking for a way to find the active modules to get a deeper understanding of which module is active and ergo doing something and which is not.
|
To unload modules you can use these 2 commands, lsmod and rmmod. lsmod will list what modules are loaded, while rmmod will remove a given module from the Kernel, assuming it was dynamically built so that it can/could be dynamically loaded.
$ sudo lsmod | head -5
Module Size Used by
bluetooth 89276 0
cpufreq_powersave 1154 0
tcp_lp 2111 0
aesni_intel 12131 1
To remove a module simply do this:
$ sudo rmmod bluetooth
To reload it:
$ modprobe bluetooth
I have to agree with @Patrick though, there isn't really anything that this will do, sounds like someone doesn't quite understand the function/role the modules play and what loading/unloading them even means.
My Wireless Modules
I will say that I've had issues with my WiFi drivers and have had to unload them and reload them from time to time, so perhaps this is what someone meant and it got misinterpreted?
These are my WiFi drivers that I once every 1-2 months have to to unload them:
$ lsmod | grep iw
iwlagn 209751 0
iwlcore 195714 1 iwlagn
mac80211 229095 2 iwlagn,iwlcore
cfg80211 134981 3 iwlagn,iwlcore,mac80211
I'm on Fedora 14 with a Thinkpad T410.
What driver is hardware X using?
You can use the tool lshw as one of the other answers provides as an example. You can also use the tool hwinfo to find out this info too:
$ hwinfo | less
...
...
63: None 00.0: 1070a WLAN
[Created at net.124]
Unique ID: XXX.QXn1l67XXXX
Parent ID: XXX.OmvKrXXXXXX
SysFS ID: /class/net/wlan0
SysFS Device Link: /devices/pci0000:00/0000:00:1c.1/0000:03:00.0
Hardware Class: network interface
Model: "WLAN network interface"
Driver: "iwlagn"
Driver Modules: "iwlagn"
Device File: wlan0
HW Address: 45:12:12:32:7a:02
Link detected: yes
Config Status: cfg=new, avail=yes, need=no, active=unknown
Attached to: #35 (WLAN controller)
So in my case my WiFi adapter is using the module, iwlagn. hwinfo is another package that you may need to install. The package name is, you guessed it, hwinfo. So check with your distro's package management software to see if you have it available as well.
| Testing which modules are unloaded with modprobe |
1,553,373,938,000 |
I am trying to load the bwn driver as a module as mentioned in the man page.
However, when I attempted to edit /boot/defaults/loader.conf I could not write the changes to the file, this was attempted as root.
Then I read that this file is not to be edited. How can I load this driver as a module?
|
You need to put if_bwn_load="yes" in /boot/loader.conf. If you don't have a /boot/loader.conf file on your system, just create it. As with the /etc/defaults/rc.conf file, /boot/defaults/loader.conf contains default values that can be overridden in a per-system fashion.
Of course, you'll need to either reboot the system to pick up the new setting, or load the module manually the first time with kldload if_bwn.
| Enabling bwn in FreeBSD |
1,553,373,938,000 |
I've installed Ubuntu 12.04 on my 8 gb USB stick, and got it running. It seems like I don't have the full Ubuntu OS on the stick though, and that was my intention. Anyway, I can run a "demo" version it seems, and it looks like the normal installation of Ubuntu but with a installer package on the desktop.
The issue surfaces when i try to download the driver for my wireless card, it downloads it for a bit, then throws some error, and if I press anything after that my screen basically looks like a graphic card meltdown. ( lines in different colors all over the screen ).
All I want to do is have the USB being able to use the computers wireless card. It does not even have to be Ubuntu, just a basic OS i can access the internet with, and save files to the local hard drive. (A basic text editor aswell)
Does anyone have any idea?
EDIT:
This is how it happens
I choose "Try Ubuntu" in the UNetBootin bootloader
It loads Ubuntu (without the files i made last time i tried this)
It tells me I'm missing a driver, in this case Broadcom Wireless driver.
I press install and about 2/3 in i get this error:
BUG: Unable to handle kernel NULL pointer dereference at (null)
and log of the call stack, but i didn't manage to write it down before the screen are unreadable
Note: One of my attempts it installed the driver just fine and asked me to restart. I did, and noticed the Wireless button was blue (on my laptop). However, just before i added my home network, it froze and i had to restart. Driver was gone, and i was back to scratch.
|
I am pretty sure that has something to do with the fact that you don't have the full install, just a 'test' version.
And this test version doesn't have all default applications installed, or doesn't have all software sources enabled.
I would suggest installing an actual Ubuntu install to the disk, not just the live CD version.
Basically the way to do this is first get all files that you care about off of your disk, (make a backup).
Boot into a live CD/DVD of Ubuntu, or another live USB stick that isn't the one you plan to install onto.
Go into try Ubuntu mode, and open up GParted. Wipe the USB stick that you want to install Ubuntu onto, and create a fat file system for Ubuntu.
'Install Ubuntu' from your secondary live cd/dvd/usb onto the USB stick you want to install to. Be sure not to install to the hard disk at this point.
If you are running Ubuntu on a native file system on any machine, then you can use this(https://askubuntu.com/a/54388/115738) method of installing using a virtual box. You will still want to back up your files before doing this.
| Running Ubuntu of a USB stick. Can't install wireless driver |
1,553,373,938,000 |
Just installed Fedora 18 and I can't get the wireless to work.
What do I have and what have I done?
I have a Broadcom BCM4312 which is supported by the broadcom-wl driver. (link)
lspci | grep Network
00:19.0 Ethernet controller: Intel Corporation 82567LM Gigabit Network Connection (rev 03)
0c:00.0 Network controller: Broadcom Corporation BCM4312 802.11b/g LP-PHY (rev 01)
I have installed the driver and the kernel modules for it:
rpm -qa | grep -e '-wl' | sort
akmod-wl-5.100.82.112-7.fc18.4.i686
broadcom-wl-5.100.82.112-4.fc18.noarch
kmod-wl-3.7.4-204.fc18.i686-5.100.82.112-7.fc18.8.i686
The kernel:
uname -r
3.7.4-204.fc18.i686
I have loaded the module
modprobe wl
lsmod | sort | grep wl
cfg80211 171182 1 wl
lib80211 13684 1 wl
wl 2465403 0
And even removed the ssb module, which I read on couple forums.
Restarted the service, and even rebooted:
service NetworkManager restart
After all these, the wireless card is still not visible. What am I missing?
|
I was originally running kernel 3.7.4-204.fc18.i686 with kmod-wl-3.7.4-204.fc18.i686-5.100.82.112-7.fc18.8.i686 and the wireless had issues. After 2 more updates of the kernel it just works fine.
So this is what I have running and working good now:
sly@localhost ~$ uname -r
3.7.6-201.fc18.i686
sly@localhost ~$ rpm -qa | grep -e '-wl' | sort
akmod-wl-5.100.82.112-7.fc18.4.i686
broadcom-wl-5.100.82.112-4.fc18.noarch
kmod-wl-3.7.6-201.fc18.i686-5.100.82.112-7.fc18.10.i686
sly@localhost ~$ lsmod | sort | grep wl
cfg80211 171182 1 wl
lib80211 13684 2 wl,lib80211_crypt_tkip
wl 2465403 0
| Fedora 18 No Wireless |
1,553,373,938,000 |
Some recent Bluetooth chipsets from Intel and Broadcom need to run the btattach command in user-space for Bluetooth to be enabled properly (it "attaches" the BT chipset and triggers the loading of the required firmware if needed).
Such an example is the Broadcom BCM43241 rev B5 chipset found on Lenovo ThinkPad 8 tablets which needs the following command # btattach --bredr /dev/ttyS1 -P bcm but this is applicable to many other Bluetooth chipsets connected to an UART controller.
Q: What is the best recommended way to trigger the required btattach command during boot to have Bluetooth enabled automatically?
P.S. The idea would be to contribute such a modification to Linux distributions starting to package the btattach command (like Debian), since right now many recent devices simply don't have Bluetooth working out-of-the-box. This would be especially useful for tablets that have no or few full-size USB ports.
|
A more refined approach consists in creating a udev rule, triggered only when the right hardware is present, to launch the needed btattach command from a systemd service. This is merging the concepts of the 2 earlier answers.
For the specific chipset mentioned in the question, the udev rule looks simply like this:
$ cat /etc/udev/rules.d/99-bluetooth-btattach.rules
KERNEL=="BCM2E55:00", RUN+="/bin/systemctl --no-block start btattach-broadcom-ttyS1.service"
with BCM2E55:00 being the hardware ACPI identifier of the corresponding Bluetooth chipset.
The systemd service, compatible only with chipsets appearing as a child of the ttyS1 device node (visible via sysfs in /sys/devices/platform/80860F0A:00/tty/ttyS1/device/BCM2E55:00$), can remain very simple like this:
$ cat /etc/systemd/system/btattach-broadcom-ttyS1.service
[Unit]
Description=Start btattach, needed to enable Bluetooth for some UART-based Bluetooth Broadcom chipsets
[Service]
Type=simple
# A delay is needed, 1s seems enough
ExecStartPre=/bin/sleep 1s
ExecStart=/usr/bin/btattach --bredr /dev/ttyS1 -P bcm
This systemd service will work as-is for other Broadcom chipsets (hence the -P bcm parameter) appearing as a child of ttys1 (hence the /dev/ttyS1); only the udev rule needs to be completed to include the ACPI identifiers of other chipset variants.
For Broadcom chipsets attaching to a different ttyS* node, another similar systemd service can be created to cover this case (or maybe the right parameters could be shared from the udev rule to the systemd service).
Rebooting the tablet shows that the btattach command is properly executed at boot:
$ ps auxw | grep btattach
root 2059 0.0 0.0 6372 720 ? Ss 23:17 0:00 /usr/bin/btattach --bredr /dev/ttyS1 -P bcm
and Bluetooth is actually enabled and working! The Gnome Bluetooth settings does list connected and scanned devices and running $ bluetoothctl from a command line properly shows the controller.
Surprisingly, when removing the initial 1s sleep command used to simply delay the real command, Bluetooth isn't working at all and not properly enabled despite btattach still appearing to be running correctly in the list of background processes.
Not sure to understand what's happening exactly quite yet: there is a timing issue at stake and certainly a required dependency to wait for, before being supposed to launch btattach...
| How to enable Bluetooth *automatically at boot* for recent Intel and Broadcom chipsets relying on btattach? |
1,553,373,938,000 |
It seems to be that the drivers are installed for BCM43142 on my laptop:
lspci -k
02:00.0 Network controller: Broadcom Corporation BCM43142 802.11b/g/n (rev 01)
Subsystem: Dell Wireless 1704 802.11n + BT 4.0
Kernel driver in use: bcma-pci-bridge
kernel modules: bcma
However, there seems to be no wireless interface associated with this device:
ip link
doesn't output any information for a wireless device. I've looked at the Archlinux docs and it doesn't say how to attach an interface (i.e. wlan0) to the wireless device. Any idea how I would go about correcting this issue?
dmesg| grep bcma
Update : I am getting the following dmesg output
[ 11.069453] IPv6: ADDRCONF(NETDEV_UP): wlp2s0: link is not ready
[ 11.561403] ERROR @wl_cfg80211_scan : WLC_SCAN error (-22)
[ 12.718246] r8169 0000:01:00.0 enp1s0: link up
[ 12.718274] IPv6: ADDRCONF(NETDEV_CHANGE): enp1s0: link becomes ready
[ 15.017434] ERROR @wl_cfg80211_scan : WLC_SCAN error (-22)
[ 38.022260] ERROR @wl_cfg80211_scan : WLC_SCAN error (-22)
[ 71.026835] ERROR @wl_cfg80211_scan : WLC_SCAN error (-22)
[ 114.025121] ERROR @wl_cfg80211_scan : WLC_SCAN error (-22)
[ 148.297435] ERROR @wl_dev_intvar_get : error (-1)
[ 148.297440] ERROR @wl_cfg80211_get_tx_power : error (-1)
[ 167.028256] ERROR @wl_cfg80211_scan : WLC_SCAN error (-22)
[ 230.049349] ERROR @wl_cfg80211_scan : WLC_SCAN error (-22)
[ 293.054357] ERROR @wl_cfg80211_scan : WLC_SCAN error (-22)
[ 356.117637] ERROR @wl_cfg80211_scan : WLC_SCAN error (-22)
[ 356.125132] ERROR @wl_cfg80211_scan : WLC_SCAN error (-22)
[ 419.109201] ERROR @wl_cfg80211_scan : WLC_SCAN error (-22)
[ 482.052441] ERROR @wl_cfg80211_scan : WLC_SCAN error (-22)
[ 545.067170] ERROR @wl_cfg80211_scan : WLC_SCAN error (-22)
[ 550.596770] ERROR @wl_cfg80211_scan : WLC_SCAN error (-22)
[ 608.087644] ERROR @wl_cfg80211_scan : WLC_SCAN error (-22)
[ 671.100683] ERROR @wl_cfg80211_scan : WLC_SCAN error (-22)
[ 671.108110] ERROR @wl_cfg80211_scan : WLC_SCAN error (-22)
[ 674.041554] ERROR @wl_dev_intvar_get : error (-1)
[ 674.041564] ERROR @wl_cfg80211_get_tx_power : error (-1)
[ 734.132416] ERROR @wl_cfg80211_scan : WLC_SCAN error (-22)
[ 797.080622] ERROR @wl_cfg80211_scan : WLC_SCAN error (-22)
[ 860.126435] ERROR @wl_cfg80211_scan : WLC_SCAN error (-22)
[ 923.084072] ERROR @wl_cfg80211_scan : WLC_SCAN error (-22)
[ 986.177109] ERROR @wl_cfg80211_scan : WLC_SCAN error (-22)
[ 986.184353] ERROR @wl_cfg80211_scan : WLC_SCAN error (-22)
[ 1011.528205] ERROR @wl_dev_intvar_get : error (-1)
[ 1011.528216] ERROR @wl_cfg80211_get_tx_power : error (-1)
[ 1049.095516] ERROR @wl_cfg80211_scan : WLC_SCAN error (-22)
[ 1112.124821] ERROR @wl_cfg80211_scan : WLC_SCAN error (-22)
[ 1175.102042] ERROR @wl_cfg80211_scan : WLC_SCAN error (-22)
[ 1238.133483] ERROR @wl_cfg80211_scan : WLC_SCAN error (-22)
[ 1301.125476] ERROR @wl_cfg80211_scan : WLC_SCAN error (-22)
[ 1364.117876] ERROR @wl_cfg80211_scan : WLC_SCAN error (-22)
[ 1427.121597] ERROR @wl_cfg80211_scan : WLC_SCAN error (-22)
[ 1490.152334] ERROR @wl_cfg80211_scan : WLC_SCAN error (-22)
[ 1553.171802] ERROR @wl_cfg80211_scan : WLC_SCAN error (-22)
Update2:
lspci -k
02:00.0 Network controller: Broadcom Corporation BCM43142 802.11b/g/n (rev 01)
Subsystem: Dell Wireless 1704 802.11n + BT 4.0
Kernel driver in use: wl
Kernel modules: bcma, wl
sudo iwlist scan
wlp2s0 Interface doesn't support scanning : Invalid argument
ifconfig
wlp2s0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 76:24:fe:f7:5e:ce txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 17
|
Install the broadcom-wl-dkms package.
You can Install it from AUR using yaourt (deprecated use yay instead) please see the complete list on AUR helpers:
yaourt -S broadcom-wl-dkms
Unload conflicting modules.
rmmod b43
rmmod ssb
rmmod bcma
Load the wl module:
modprobe -r wl
modprobe wl
| broadcom 43142 on archlinux: no interface |
1,553,373,938,000 |
I'm new to FreeBSD, it's working fine one my Laptop. Only problem is, that my wifi device isn't in ifconfig so I can't use it. I tried a lot of reading but I couldn't get it to work. How can I get my Broadcom chip to work?
Model: Acer Aspire 5820TG
# uname -a
FreeBSD rindtop 10.2-RELEASE-p7 FreeBSD 10.2-RELEASE-p7 #0: Mon Nov 2 14:19:39 UTC 2015
[email protected]:/usr/obj/usr/src/sys/GENERIC amd64
# pciconf -lv
none3@pci0:3:0:0: class=0x028000 card=0xe021105b chip=0x435714e4 rev=0x01 hdr=0x00
vendor = 'Broadcom Corporation'
device = 'BCM43225 802.11b/g/n'
class = network
# dmesg
...
pcib3: <PCI-PCI bridge> at device 28.5 on pci0
pcib3: failed to allocate initial I/O port window: 0x1000-0x1fff
pci3: <PCI bus> on pcib3
pci3: <network> at device 0.0 (no driver attached)
...
# ifconfig
alc0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=c3198<VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MCAST,WOL_MAGIC,VLAN_HWTSO,LINKSTATE>
ether 60:eb:69:4b:fa:0c
inet 192.168.0.58 netmask 0xffffff00 broadcast 192.168.0.255
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
media: Ethernet autoselect (1000baseT <full-duplex>)
status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
inet 127.0.0.1 netmask 0xff000000
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
# cat /boot/loader.conf
if_bwn_load="YES"
if_bwi_load="YES"
wlan_wep_load="YES"
wlan_ccmp_load="YES"
wlan_tkip_load="YES"
fuse_load="YES"
# cat /etc/rc.conf
ifconfig_alc0="inet 192.168.0.58 netmask 255.255.255.0"
defaultrouter="192.168.0.1"
font8x8="cp437-8x8"
hald_enable="YES"
dbus_enable="YES"
fusefs_enable="YES"
...
I tried to provide as much relevant information as I could. You will probably recognize some things I tried. Thanks for your help!
Update
It turnes out the Broadcom card isn't supported by FreeBSD as of 02.01.2016... :(
|
Broadcom has always ignored FreeBSD and fail to supply drivers so we choose to use other wifi devices, mostly Atheros. As of a year ago, I don't see anyone getting that chip to work and can't find it in the FreeBSD hardware compatibility list.
You'll find far more responses and questions about this on the FreeBSD wifi mailing list or the FreeBSD forum than here on SO.
| FreeBSD Broadcom BCM43225 Setup |
1,553,373,938,000 |
I have been having WiFi trouble for months now, and I've tried all manner of solutions with no change.
Hardware: Mid 2012 MacBook Pro unibody, 16gb RAM and 500gb Samsung SSD
OS: Kali Linux 2021.2 with weekly updates to all software. Running Live with Persistence from a USB drive.
Driver: Broadcom BCM 4331
Problem: Linux will connect to my iPhone hotspot with no problems and no connection lag, but when connecting to my university's WiFi or home WiFi, it either will not make the connection at all, or establish a connection for about half an hour, then stop working. Webpages pull up a "connection timed out" or "could not reach the server" errors. Currently I have a decent connection to my university's WiFi, but about a half-hour prior, I could not connect at all.
Attempted:
uninstalling and reinstalling NetworkManager
Manually filling out WiFi router details in the nm-applet
Uninstalling and reinstalling OS
Adding wifi.scan-rand-mac-address=no to /etc/NetworkManager/NetworkManager.conf
addressing router directly, both with the default address 192.168.1.1 and the gateway address that appears after running route in the terminal
-Edited /etc/network/interfaces and added wlan0
Numerous NetworkManager restarts.
when a connection is established, even if no webpages are loading, the command ping still shows that there is a connection with no packet loss
set DNS servers to 8.8.8.8 and 8.8.4.4 in the IPv4 settings in NetworkManager
module bcma is listed when running command sudo lsmod, used by b43 which is my driver
added deb http://http.deb/debian.org/debian bullseye-backports main contrib non-free and deb http://us.debian.org/debian bullseye main non-free to /etc/apt/sources.list, updated and upgraded with these sources
manually installed linux-headers-amd64, linux-image-amd64, and linux-kbuild-5.10
ran apt install broadcom-sta-dkms followed by modprobe-r b43 b43legacy ssb brcmsmac bcma and modprobe wl, after reboot, WiFi seems to be working again
Various other attempts were made to fix the problem but I can't remember what all I tried. At the moment, all edits to /etc/network and /etc/NetworkManager files have been removed, all NetworkManager settings are the default.
|
Solved my own problem! The solution was to:
Add
deb http://deb.debian.org/debian bullseye-backports main contrib non-free
and
deb http://deb.debian.org/debian bullseye main non-free
to /etc/apt/sources.list.d/deb.list.
Run apt update and apt upgrade as well as apt dist-upgrade to add all the new dependencies and packages from the sources you added above.
Manually install linux-headers-amd.64, linux-image-amd64, and linux-kbuild-5.10, all of which were listed as "not upgraded" after completing the update & upgrade.
Install broadcom-sta-dkms.
Run modprobe -r b43 b43legacy ssb brcmsmac bcma to remove all of these driver files and packages.
Run modprobe wl to activate only the wl driver.
After this, NetworkManager wouldn't find wireless connections at all,
but after a reboot, I discovered the problem had disappeared
and I'm now on day three of stable WiFi.
** Edited to reflect recommendations from the Kali Linux documentation, which discourages adding additional repositories to the /etc/apt/sources.list file. The two new repositories bullseye backports and bullseye main have been moved to a new file called deb.list (https://www.kali.org/docs/general-use/kali-linux-sources-list-repositories/#non-kali-repositories).
[Note from third-party editor "infamous_spy"]
*** Edited the sources listed in deb.list since they were the ones that worked for me. By the way, the solution works. Wlan connection is faster and stable.
| Persistent WiFi connectivity problems in Kali Linux |
1,553,373,938,000 |
After upgrading the mint 18 kernel to 4.4.0-87-generic I no longer have wireless. My wired device still works, but my wireless nic has disappeared from ifconfig -a.
It does show up for lspci:
02:00.0 Network controller: Broadcom Corporation BCM4352 802.11ac Wireless Network Adapter (rev 03)
iwlist scan; lshw -c net
*-network UNCLAIMED
description: Network controller
product: BCM4352 802.11ac Wireless Network Adapter
vendor: Broadcom Corporation
physical id: 0
bus info: pci@0000:02:00.0
version: 03
width: 64 bits
clock: 33MHz
capabilities: cap_list
configuration: latency=0
resources: memory:f7200000-f7207fff memory:f7000000-f71fffff
It also shows up in "Driver Manager", so I chose the following:
Broadcom Corporation: BCM4352 802.11ac Wireless network Adapater:
bcmwl-kernel-source (recommended)
Version 6.30.223.271 +bdcom-Oubuntu1~1.1
Broadcom 201.11 Linux STA wireless driver source
I tried rebooting and even booting into an earlier kernel, but still my wireless device is "unclaimed" and does not show up for ipconfig.
|
this might be useful, basically...
sudo apt-get install firmware-b43-installer
and if something like "An unsupported BCM4312 Low-Power (LP-PHY) device was found." comes out, then:
sudo apt-get install firmware-b43-lpphy-installer
| Linux mint:Wireless Device Unclaimed after Upgrade |
1,553,373,938,000 |
I am attempting to enable my wireless interface in Slax Linux, so far, I know the driver I need is brcmsmac, since I have a broadcom card; and this work in Slackware.
The driver is available and does not show any errors when I load it with:
# modprobe brcmsmac
But no new interface is loaded.
Here is I've tried:
# lspci | grep Network
03:00.0 Network controller: Broadcom Corporation BCM4313 802.11b/g/n Wireless LAN Controller (rev 01)
# ifconfig -a
eth0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether e8:11:32:5f:ff:5e txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 41 base 0xc000
lo: flags=8<LOOPBACK> mtu 16436
loop txqueuelen 0 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Any suggestions?
I am sorry @slm, here's dmesg output
# dmesg | grep brcmsmac
brcmsmac bcma0:0: mfg 4bf core 812 rev 24 class 0 irq 16
ieee80211 phy0: brcmsmac: fail to load firmware brcm/bcm43xx-0.fw
ieee80211 phy0: brcmsmac: Failed to find firmware usually in /lib/firmware/brcm
brcmsmac: brcms_bcma_probe: brcms_attach failed!
|
Given the output from dmesg I would suggest downloading the firmware from the broadcom site. Check out that link, there are pretty detailed instructions on how to download and install the firmware that the dmesg error message is mentioning.
general steps
1. download firmware file: http://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git
2. copy brcm/bcm43xx-0.fw and brcm/bcm43xx_hdr-0.fw to /lib/firmware/brcm
3. Use the nvram file installed in your system and copy it to /lib/firmware/brcm/brcmfmac-sdio.txt The firmware can be found in the linux-firmware repository.
NOTE:
For 4329: cp brcm/brcmfmac4329.bin /lib/firmware/brcm/brcmfmac-sdio.bin
For 4330: cp brcm/brcmfmac4330.bin /lib/firmware/brcm/brcmfmac-sdio.bin
4. Run modprobe brcmsmac (or something like that)
I may be missing steps but it will be something along those lines. Again consult the broadcom link I mentioned above for further details.
| brcmsmac does not work |
1,553,373,938,000 |
I am dual booting arch linux on my mac mini 3,1. Am trying to get the WiFi to work and have hit a block.
Following these instructions. I have identified my card as BCM4321, which from the tables I read I can use the b43 driver/module (is a driver really just a module?) which is already in the kernel. I ran lsmod and sure enough can see that b43 is loaded. Checked iwconfig and can see wlan0 IEE 802 ect.
If I run ip link set wlan0 up (which i'm guessing turns on the card/wifi?) I'm notified about the need for some firmware. Ok so reading the instructions from the above website I need to get this firmware which I am pretty sure would solve the aforementioned issue, but my main problem is how do I get the firmware without physically connecting the mac to router via ethernet.
I have a laptop that I'm currently using with W7 and F16 on and a pendrive which currently has the arch installation media on it, I am hoping i can stick the firmware on a pendrive and load from there if so how?
Whilst writing this I have thought that I should just be able to wget the tarballs from here, put those on the pendrive and then try loading transferring them into arch, will still ask this question in case of failure :-)
|
I should just be able to wget the tarballs from http://linuxwireless.sipsolutions.net/en/users/Drivers/b43/ those on the pen drive and then try loading transferring them into arch
That is exactly what to do. Unfortunately, Broadcom does not provide distribution licensing for the firmware, so you have to download their full proprietary driver from their website, then extract the firmware from it. This can be done on any system. There are directions on the site you linked about how to do this. At one point, it has you download a different driver version depending on what kernel version you have. Archlinux systems usually have the latest kernel, but if you just installed from an installation medium, it may be older; do uname -a on the Arch system to find out what kernel version you have. Once you have it, place it in the /lib/firmware/ directory of your Arch system.
| getting wifi up and running in Arch Linux on Mac Mini 3,1 |
1,553,373,938,000 |
I have a fresh install of Linux Mint Mate 64 on an old iMac (late 2008).
I can not connect using a network cable so I need to use wlan.
I've installed broadcom drivers, the network managers shows the wi-fi connection and everything seems fine... but I cannot connect to anything except localhost.
I've tried to reduce the problem and I believe I've a problem connecting to the router. If I ping it, I get 100% packet lost. If I ping broadcast I receive replies from the router!
$ ping 192.168.10.1
PING 192.168.10.1 (192.168.10.1) 56(84) bytes of data.
From 192.168.10.111 icmp_seq=1 Destination Host Unreachable
$ ping -b 192.1168.10.255
WARNING: pinging broadcast address
PING 192.168.10.255 (192.168.10.255) 56(84) bytes of data.
64 bytes from 192.168.10.1: icmp_seq=3 ttl=255 time=299ms
...
Please note that DHCP works, since the machine is correctly identified as 192.168.10.111 in the first ping command.
EDIT 1: more info
$ arp -a
Address HWtype HWaddress Flags Mask Iface
192.168.10.104 (incomplete) wlan0
192.168.10.112 ether 38:c9:86:24:d6:88 C wlan0
192.168.10.1 (incomplete) wlan0
# arp -d 192.168.10.1
no reply, the command returns without any output.
$ route -an
the "a" flag was not recognized.
$ route -n
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.10.1 0.0.0.0 UG 1024 0 0 wlan0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 wlan0
192.168.10.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
please note that I've successfully removed 169.254.0.0 route previously, but it re-appeared after re-starting network manager.
END OF EDIT 1
EDIT 2
on a different machine, in the same network (using wi-fi connection as well) arp -a returns the following:
$ arp -a
? (169.254.221.46) at c8:ff:28:46:52:c5 on en1 [ethernet]
router.local (192.168.10.1) at 0:a0:a2:62:c1:dc on en1 ifscope [ethernet]
nas.local (192.168.10.104) at 0:11:32:38:e:1 on en1 ifscope [ethernet]
? (192.168.10.105) at a8:86:dd:a5:8d:37 on en1 ifscope permanent [ethernet]
? (192.168.10.255) at ff:ff:ff:ff:ff:ff on en1 ifscope [ethernet]
The machine is a mac, so the route command does not provide a list of routes but I've tried a different command
$ netstat -nr
Routing tables
Internet:
Destination Gateway Flags Refs Use Netif Expire
default 192.168.10.1 UGSc 61 0 en1
127 127.0.0.1 UCS 0 0 lo0
127.0.0.1 127.0.0.1 UH 70 30572605 lo0
169.254 link#5 UCS 1 0 en1
169.254.221.46 c8:ff:28:46:52:c5 UHLSW 0 0 en1
192.168.10 link#5 UCS 2 0 en1
192.168.10.1/32 link#5 UCS 11 0 en1
192.168.10.1 0:a0:a2:62:c1:dc UHLWIir 51 393 en1 1149
192.168.10.104 0:11:32:38:e:1 UHLWIi 5 81773 en1 733
192.168.10.105/32 link#5 UCS 1 0 en1
192.168.10.105 a8:86:dd:a5:8d:37 UHLWI 0 1138657 lo0
192.168.10.255 ff:ff:ff:ff:ff:ff UHLWbI 0 16 en1
I'm still investigating on the origin of 169.254.x.x routes, but they does not seems to cause any issues on other machines.
END EDIT 2
EDIT 3
$ arping -I wlan 0:a0:a2:62:c1:dc
arping: unknown host 0:a0:a2:62:c1:dc
Trying to ping/arping other machines returns "Destination Host Unreachable" for every machine in the arp list, using both IPv6 and IPv4 addresses
END EDIT 3
I have no idea how to "debug" this connection issue. I've searched forums, I've tried to set BSSID manually (it was empty), I've set DNS to 192.168.10.1,8.8.8.8 (and restarting everything so many times) but with no luck. What should I try?
|
To solve the problem I've selectively disabled all possibile drivers for my wifi card.
$ sudo modprobe -r b43 ssb wl brcmfmac brcmsmac bcma
I've also deleted all the connections shown in the network-manager taskbar icon.
At this point I've started re-enabling every driver separately. Every time I had to wait for a wile to the network-manager to re-connect. Here is an example:
$ sudo modprobe -r wl
(wait for network-manager to re-connect to the WLAN)
$ ping 192.168.10.1
(ping unable to connect, so I'll remove the driver again)
$ modprobe -r wl
I did this until I've found that b43 is the correct driver. At this point I've purged/blacklisted all other drivers from apt and now everything works like a charm.
This document was enlightening: https://help.ubuntu.com/community/WifiDocs/Driver/bcm43xx
| Unable to ping router but broadcast ping returns response from it |
1,519,213,760,000 |
I always upgraded the linux kernel of my machine to the latest stable version, but, with any version later than the 4.14.8 WiFI doesn't work anymore, how can i solve this?
Info about my wireless card:
description: Wireless interface
product: BCM43142 802.11b/g/n
vendor: Broadcom Corporation
physical id: 0
bus info: pci@0000:03:00.0
logical name: wlo1
version: 01
serial: 74:29:af:e9:36:35
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
configuration: broadcast=yes driver=wl0 driverversion=6.30.223.271 (r587334) ip=10.0.34.196 latency=0 multicast=yes wireless=IEEE 802.11
resources: irq:43 memory:f0c00000-f0c07fff
|
Apparently, they took the wl driver, which is what's used to run Broadcom wifi chips, out of the linux kernel starting at 4.14.8 . This only hit me now, when my Ubuntu box upgraded to kernel 4.15, and I suddenly didn't have wifi.
You need to install a DKMS version of the driver, which is broadcom-sta-dkms in debian based systems, and broadcom-wl-dkms in Arch. The source for the driver is here on github, if that's necessary.
| WiFi not working with kernel later than 4.14.8 |
1,519,213,760,000 |
My cellphone connects just fine to the 5Ghz network, so I know it is up and functioning properly. My Dell Inspiron though, running elementary OS Loki which is based on Ubuntu 16.04, refuses to do so and instead connect to the 2.4GHz network which has a much lower signal strength.
Here's the iwlist output, which confirms it actually sees the 5Ghz channels:
$ iwlist wlp18s0 freq
wlp18s0 32 channels in total; available frequencies :
Channel 01 : 2.412 GHz
Channel 02 : 2.417 GHz
Channel 03 : 2.422 GHz
Channel 04 : 2.427 GHz
Channel 05 : 2.432 GHz
Channel 06 : 2.437 GHz
Channel 07 : 2.442 GHz
Channel 08 : 2.447 GHz
Channel 09 : 2.452 GHz
Channel 10 : 2.457 GHz
Channel 11 : 2.462 GHz
Channel 36 : 5.18 GHz
Channel 38 : 5.19 GHz
Channel 40 : 5.2 GHz
Channel 42 : 5.21 GHz
Channel 44 : 5.22 GHz
Channel 46 : 5.23 GHz
Channel 48 : 5.24 GHz
Channel 52 : 5.26 GHz
Channel 56 : 5.28 GHz
Channel 60 : 5.3 GHz
Channel 64 : 5.32 GHz
Channel 100 : 5.5 GHz
Channel 104 : 5.52 GHz
Channel 108 : 5.54 GHz
Channel 112 : 5.56 GHz
Channel 116 : 5.58 GHz
Channel 120 : 5.6 GHz
Channel 124 : 5.62 GHz
Channel 128 : 5.64 GHz
Channel 132 : 5.66 GHz
Channel 136 : 5.68 GHz
Current Frequency:2.437 GHz (Channel 6)
I've tried setting power management to OFF as explained here, I've set the domain to US as explained here (I'm in the US right now). I've tried forcing the network manager to use the 5GHz channels, but it just won't work.
These are my card specs ($ sudo lshw -C network):
BCM4313 802.11bgn Wireless Network Adapter (Broadcom Corporation)
Any ideas will be greatly appreciated.
|
The BCM4313 WiFi chipset is a single frequency 2.4GHz chipset. It is capable of going to a theoretical speed of around 150Mbps.
You might also suspect by the lsusb output, in the 802.11bgn string, it does not support 5GHz (802.11b, 802.11g are not in the 5GHz band*, and in 802.11n the 5GHz band support is optional). So there is already here a hint iwlist is showing too many channels. (it is showing 802.11ac channels)
To check it out for sure, we should have a look at the product page from Broadcom itself Broadcom - BCM4313
Single-chip, single-band, IEEE 802.11n MAC/PHY/Radio system-on-a-chip (SoC).
MAC (Media Access Control), baseband and radio for 2.4 GHz IEEE
802.11n applications
So obviously, your BCM4313 won't ever connect to any 5GHz channel.
iwlist either is showing all the frequencies the command accepts, or most probably, lying.
Maybe the driver/firmware is common with later models. Maybe it is bug. Nevertheless, the hardware won´t support 5GHz frequencies.
The chipset is also obsolete as we speak, and (in)famous for being problematic. I also have several reasons to suspect it is a 802.11n DRAFT card (e.g. before the protocol was totally defined as it is today).
I would also warn you before you trying to substitute the actual WiFi card, that Dell engages in device whitelisting, and you can only buy another WiFi card "compatible" with your notebook model.
See also an aliexpress listing of your present card. Notice the "only compatible with Dell" wording and again:
Wi-Fi Supported Frequency:2.4G
I would search if your particular Inspiron model/firmware supports a 5GHz "Dell compatible" card, and might try to switch it. As there is whitelisting involved, upgrading to a later version of the BIOS/firmware might support more Wi-Fi chipsets.
Nonetheless, typically new 5GHz cards might need a different type of antenna(s) and an extra antenna (they are inside the machine body).
So your best bet at the end of the day might be getting a 5GHz USB stick. Select it wisely before buying.
See related Wi-Fi problems using ASUS USB-N13 adapter for comments and suggestions about WiFi technology.
| Dell laptop won't connect to 5GHz network |
1,519,213,760,000 |
I need to test some signals off. I use Debian and need to inject packets which the broadcom chipset inside this would not allow or maybe I don't know how to ( I mean, if I run "wash" tool it doesn't provide me any results and gave some kind of error, which on googling seemed to be the "packet injection inability".). So, is there any ways I can solve this?
|
For packet injection abilities you have to buy a wifi chipset that does support the functionality; Broadcom is not certainly one of them.
Some chipsets support monitor mode, and even a stricter small set does support injection capabilities; shame is that in several ethical hacking courses, that limitation is not mentioned.
You will have better results with a few Atheros chipset cards, search/Google around for a good USB pen. It won't came cheap, but it is worth every penny.
Beware of buying internal Wifi replacements for your notebook, as a few brands do hardware whitelisting (Lenovo, Dell, HP, Compaq) and if not bought directly to the brand for the specific notebook model, the equipment will reject it. (I have already noticed it is a Mac -- go with the USB pen).
see related thread Wi-Fi problems using ASUS USB-N13 adapter
| Is there any way that I can make packet injection to work on my MBA 2015 11"s Wireless NIC (Broadcom)? |
1,519,213,760,000 |
I have a MacBook Pro 16, and decided to install Pop!_OS on it.
My system info is:
OS: Pop!_OS 22.04 LTS x86_64
Host: MacBookPro16,2 1.0
Kernel: 6.2.6-76060206-generic
My Network controller is a Broadcom Wireless Network Adapter (Broadcom Inc. and subsidiaries BCM4364 802.11ac Wireless Network Adapter). I found the a helpful page on the ArchWiki.
Running sudo lspci -vnn -d 14e4: to figure out which drivers I need yields the following:
e5:00.0 Network controller [0280]: Broadcom Inc. and subsidiaries BCM4364 802.11ac Wireless Network Adapter [14e4:4464] (rev 04)
Subsystem: Apple Inc. BCM4364 802.11ac Wireless Network Adapter [106b:07bf]
Flags: fast devsel, IRQ 255
Memory at 81400000 (64-bit, non-prefetchable) [disabled] [size=32K]
Memory at 81000000 (64-bit, non-prefetchable) [disabled] [size=4M]
Capabilities: [48] Power Management version 3
Capabilities: [58] MSI: Enable- Count=1/16 Maskable- 64bit+
Capabilities: [68] Vendor Specific Information: Len=44 <?>
Capabilities: [ac] Express Endpoint, MSI 00
Capabilities: [100] Advanced Error Reporting
Capabilities: [13c] Device Serial Number 1d-b9-fb-ff-ff-ba-3c-22
Capabilities: [150] Power Budgeting <?>
Capabilities: [160] Virtual Channel
Capabilities: [1b0] Latency Tolerance Reporting
Capabilities: [220] Physical Resizable BAR
Capabilities: [240] L1 PM Substates
Kernel modules: brcmfmac, wl
To Quote the archwiki:
The kernel contains two built-in open-source drivers: brcmfmac for native FullMAC and brcmsmac for mac80211-based SoftMAC. They should be automatically loaded when booting.
So it should work (?) But it doesn't.
When looking at the blacklisted kernel modules, I found brcmfmac to be blacklisted.
pop-os:~$ cat /etc/modprobe.d/blacklist-bcm43.conf
# Warning: This file is autogenerated by bcmwl. All changes to this file will be lost.
blacklist b43
blacklist b43legacy
blacklist ssb
blacklist bcm43xx
blacklist brcm80211
blacklist brcmfmac
blacklist brcmsmac
blacklist bcma
I commented it out, saved, and ran sudo update-initramfs -u, but didn't help.
Because the Network Card seems to accept the wl driver, I checked if it is loaded ($ lsmod | grep wl), and it seems to be loaded.
wl 6488064 0
cfg80211 1241088 1 wl
brcmfmac however, is not loaded ($ lsmod | grep brcmfmac yields nothing).
running $ sudo modprobe brcmfmac loads the module.
$ lsmod | grep brcmfmac
brcmfmac 503808 0
brcmutil 20480 1 brcmfmac
cfg80211 1241088 2 wl,brcmfmac
That's certainly cool, my wifi still doesn't work though.
At this point I have no more idea what to do.
Here some more detailed network information:
$ sudo lshw -c network
*-network UNCLAIMED
description: Network controller
product: BCM4364 802.11ac Wireless Network Adapter
vendor: Broadcom Inc. and subsidiaries
physical id: 0
bus info: pci@0000:e5:00.0
version: 04
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress cap_list
configuration: latency=0
resources: memory:81400000-81407fff memory:81000000-813fffff
*-network
description: Ethernet interface
physical id: 7
bus info: usb@2:1.4
logical name: enx00e04c680604
serial: 00:e0:4c:68:06:04
size: 1Gbit/s
capacity: 1Gbit/s
capabilities: ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8152 driverversion=v1.12.13 duplex=full firmware=rtl8153a-4 v2 02/07/20 ip=192.168.0.129 link=yes multicast=yes port=MII speed=1Gbit/s
And that's how the not working wifi looks in the settings:
|
Ok so turns out, the mac book I was using has a T2 chip. I don't know why, but it causes problems. Some people patched the kernel and fixed the wifi.
All of those models have this chip
If you have mac os still installed besides your linux installation, follow this guide. Credits to this answer If you don't, it will be a bit harder.
If you have this issue, and use Ubuntu or an Ubuntu based distro, you can change the Kernel, to a version that supports the T2 chip.
Here are the instructions to do so.
After installing the new Kernel, you need to boot in this, using you're boot manager. For me it was systemd-boot, so I could simply change the default boot entry. I don't know how you do it in grub, but it should be straight forward.
After a reboot, check if the kernel name contains T2, mine looks like this: 6.1.40-t2-jammy
If it doesn't work after swapping your Kernel you can try to manually load the driver with sudo modprobe brcmfmac. If this works, you should check if you blacklisted brcmfmac in /etc/modprobe.d/blacklist-bcm43.conf. If you did, unblacklist it and run sudo update-initramfs -u. If it doesn't work then after a reboot, your hardware will be different to mine.
After you've loaded the new Kernel, you might want to check if you have brcmfmac blacklisted. Just comment it out. For me it was blacklisted in /etc/modprobe.d/blacklist-bcm43.conf. Run sudo update-initramfs -u after you unblacklisted it, and then pray.
If this fixed your wifi, but it is unstable, you can find a fix here.
| MacBook Pro's wifi doesn't work on a fresh Pop!_OS install |
1,519,213,760,000 |
I'm new to linux & I'm trying to add external ethernet NIC to hpe dl380 gen9 server, the os is ubuntu 20.04.
I can't find the NICs using ifconfig, and after some googling I used
lshw -C network and it's appearing as network unclaimed
full description:
Broadcom Inc. and subsidiaries NetXtreme II BCM57810 10 Gigabit Ethernet [14e4:168e] (rev 11)
|
You need to install linux-firmware and linux-modules, the kernel driver is bnx2x.ko.
sudo apt install linux-firmware linux-modules-$(uname -r)
sudo modprobe -v bnx2x
In debian is packaged under firmware-bnx2x, here is the description:
This package contains the binary firmware for Broadcom NetXtreme II 10Gb network adapters supported by the bnx2x driver.
| Broadcom NetXtreme II BCM57810 10 Gigabit Ethernet appearing as unclaimed on ubuntu 20.04 |
1,519,213,760,000 |
I installed broadcom-sta-common and it caused WiFi to not work , i purged it but i still need to run sudo modprobe brcmsmac manually after boot to make WiFi work.
How can i make it work automatically like before ?
some outputs :
rahman@debian:~$ sudo rfkill list
0: hp-wifi: Wireless LAN
Soft blocked: no
Hard blocked: no
1: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
rahman@debian:~$ uname -a
Linux debian 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u3 (2017-08-06) x86_64 GNU/Linux
rahman@debian:~$ lspci -nn -d 14e4:
44:00.0 Network controller [0280]: Broadcom Limited BCM4313 802.11bgn Wireless Network Adapter [14e4:4727] (rev 01)
rahman@debian:~$ cat /var/lib/NetworkManager/NetworkManager.state
[main]
NetworkingEnabled=true
WirelessEnabled=true
WWANEnabled=true
rahman@debian:~$ cat /etc/modprobe.d/blacklist.conf
blacklist brcmsmac
Update :
While using wl module
rahman@debian:~$ sudo iw list | grep "Supported interface modes" -A12
Supported interface modes:
* IBSS
* managed
Band 1:
Bitrates (non-HT):
* 1.0 Mbps
* 2.0 Mbps (short preamble supported)
* 5.5 Mbps (short preamble supported)
* 11.0 Mbps (short preamble supported)
* 6.0 Mbps
* 9.0 Mbps
* 12.0 Mbps
* 18.0 Mbps
While using brcmsmac module :
rahman@debian:~$ sudo iw list | grep "Supported interface modes" -A12
Supported interface modes:
* IBSS
* managed
* AP
* AP/VLAN
* monitor
Band 1:
Capabilities: 0x70
HT20
Static SM Power Save
RX Greenfield
RX HT20 SGI
RX HT40 SGI
|
it works on startup now after adding brcmsmac to /etc/modules
| How to make WiFi work automatically? |
1,519,213,760,000 |
I am trying to get Wifi working on my Arch Linux installation so I have installed broadcom-wl-dkms, but it still does not seem to work. I noticed that one every startup I got this message:
Support for cores revisions 0x17 and 0x18 disabled by module param allhwsupport=0. Try b43.allhwsupport=1
So I enabled them as it said, but still the Wifi doesn't work.
During the broadcom-wl-dkms installation I was told to run the following commands or reboot (neither worked):
rmmod b43 b43legacy ssb bcm43xx brcm80211 brcmfmac brcmsmac bcma wl
modprobe wl
Upon running the first one I got this output:
rmmod: ERROR: Module b43legacy is not currently loaded
rmmod: ERROR: Module bcm43xx is not currently loaded
rmmod: ERROR: Module brcm80211 is not currently loaded
rmmod: ERROR: Module brcmfmac is not currently loaded
rmmod: ERROR: Module wl is not currently loaded
And the second gave this output:
modprobe: FATAL: Module wl not found in directory /lib/modules/4.11.0-1-hardened
I have also noticed that on Kernel updates I get messages like this:
==> dkms remove broadcom-wl/6.30.223.271 -k 4.11.0-1-hardened
Error! There is no instance of broadcom-wl 6.30.223.271
for kernel 4.11.0-1-hardened (x86_64) located in the DKMS tree.
And this:
==> dkms install broadcom-wl/6.30.223.271 -k 4.11.0-2-hardened
Error! Bad return status for module build on kernel: 4.11.0-2-hardened (x86_64)
Consult /var/lib/dkms/broadcom-wl/6.30.223.271/build/make.log for more information.
So I assume that something has gone wrong. What has gone wrong? And how can I fix this and get the Wifi working?
This is a Lenovo B590 laptop.
|
OP has a Broadcom BCM4313 chipset, which is not supported by the b43 driver, so enabling the core revisions listed in the warning will have no effect. Further, this particular chipset is not fully supported by the brcmsmac driver, leaving only Broadcom's own (restrictively-licensed) broadcom-wl driver, specifically the broadcom-wl-dkms variant.
However, at the time the Q was posted, the broadcom-wl driver (at least in the Arch repositories) was not yet updated to support kernels 4.11-rc1 or later. These newer kernels changed a bit of the interface to network devices, including removing the last_rx field from struct net_device.
As of 10 May 2017, version 6.30.223.271-12 of the broadcom-wl-dkms driver was made available through these repositories, allowing compilation against the 4.11 series kernels.
| Unable to get Broadcom wireless drivers working on Arch Linux |
1,519,213,760,000 |
I'm trying to get the WiFi working on a Banana PI M2M using the mainline kernel.
The device tree definition of the banana pi m2m is very incomplete sun8i-r16-bananapi-m2m.dts I successfully managed to get SPI working but I am now struggling to get the WiFi drivers working as they should.
The banana pi M2M uses the AP6212 chip which from the looks of it uses a BRCM4329 chip.
The AP6212 is connected through the SDIO1 to the allwinner A33, PL6 is connected WL_PMU_EN and PL7 is connected to WL-WAKE-AP. (https://drive.google.com/file/d/0B4PAo2nW2KfndHY1VF9UWXl2Rm8/view?usp=sharing)
I've modified the dts with the following:
&mmc1 {
pinctrl-names = "default";
pinctrl-0 = <&mmc1_pg_pins>;
vmmc-supply = <®_aldo1>;
mmc-pwrseq = <&wifi_pwrseq>;
bus-width = <4>;
non-removable;
status = "okay";
brcmf: wifi@1 {
reg = <1>;
compatible = "brcm,bcm4329-fmac";
interrupt-parent = <&r_pio>;
interrupts = <0 7 IRQ_TYPE_LEVEL_LOW>; /* PL7 */
interrupt-names = "host-wake";
};
};
I've enabled in the kernel 80211, the bcrm-fmac driver and brcm-fmac-sdio. In buildroot I've added the wireless-regdb package. I've also copied from the bananapi official image (kernel 3.4) the /lib/firmware/brcm to get the firmware and config.
At the point I can load the driver with modprobe but I get a timeout issue and not too sure where to look from here...
# modprobe brcmfmac
[ 67.440758] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[ 67.513578] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[ 67.595615] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
# [ 68.745996] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): clkctl 0x50
[ 69.767856] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): clkctl 0x50
My guess (but it's really just a guess) is that i'm missing some steps to properly wake up the wifi chip but measuring on the board it looks like the different rails are at the right level.
Has anyone by any chance got a recent kernel working with the different drivers on a banana pi m2m?
Thanks for any answers or tips!
|
I have same board and also want to use mainline Linux.
I found this line in 3.4 kernel log of Banana pi m2m bsp:
[ 14.519605] DHD: dongle ram size is set to 524288(orig 524288) at 0x0
[ 14.535387] dhd_conf_read_others: ccode = CN
[ 14.535623] dhd_conf_read_others: regrev = 0
[ 14.535763] Final fw_path=/lib/firmware/ap6212/fw_bcm43438a1.bin
[ 14.535959] Final nv_path=/lib/firmware/ap6212/nvram.txt
So, copy /lib/firmware/ap6212/fw_bcm43438a1.bin to /lib/firmware/brcm/brcmfmac43430-sdio.bin
and copy /lib/firmware/ap6212/nvram.txt to /lib/firmware/brcm/brcmfmac43430-sdio.sinovoip,bananapi-m2m.txt
and it works.
I have got working Wi-Fi now.
| Banana PI M2M (allwinner A33/R16) WiFI drivers in mainline kernel |
1,519,213,760,000 |
After a fresh install of Fedora 27, the wifi card is not detected after the running the first system update. After some lengthy troubleshooting online I am still no closer to the solution.
uname -r
4.14.5-300.fc27.x86_64
lspci -vnn -d 14e4:
04:00.0 Network controller [0280]: Broadcom Limited BCM4356 802.11ac Wireless Network Adapter [14e4:43ec] (rev 02)
Subsystem: Lenovo Device [17aa:0777]
Flags: bus master, fast devsel, latency 0, IRQ 18
Memory at f1400000 (64-bit, non-prefetchable) [size=32K]
Memory at f1000000 (64-bit, non-prefetchable) [size=4M]
Capabilities: <access denied>
Kernel modules: brcmfmac, wl
rpm -qa | grep -e kernel -e broadcom-wl -e kmod-wl | sort
abrt-addon-kerneloops-2.10.5-1.fc27.x86_64
akmod-wl-6.30.223.271-15.fc27.x86_64
broadcom-wl-6.30.223.271-3.fc27.noarch
kernel-4.13.9-300.fc27.x86_64
kernel-4.14.5-300.fc27.x86_64
kernel-core-4.13.9-300.fc27.x86_64
kernel-core-4.14.5-300.fc27.x86_64
kernel-debug-devel-4.14.5-300.fc27.x86_64
kernel-devel-4.13.9-300.fc27.x86_64
kernel-devel-4.14.5-300.fc27.x86_64
kernel-headers-4.14.5-300.fc27.x86_64
kernel-modules-4.13.9-300.fc27.x86_64
kernel-modules-4.14.5-300.fc27.x86_64
kernel-modules-extra-4.13.9-300.fc27.x86_64
kernel-modules-extra-4.14.5-300.fc27.x86_64
kmod-wl-4.13.9-300.fc27.x86_64-6.30.223.271-15.fc27.x86_64
kmod-wl-4.14.5-300.fc27.x86_64-6.30.223.271-15.fc27.x86_64
libreport-plugin-kerneloops-2.9.3-1.fc27.x86_64
I have installed the correct kernel-devel package:
sudo dnf install kernel-devel-4.13.9-300.fc27.x86_64
Along with enabling RPM-fusion:
sudo dnf install -y https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-27.noarch.rpm https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-27.noarch.rpm
Installed broadcom-wl and kmod-wl
sudo dnf install -y broadcom-wl kmod-wl
Run the akmods command:
sudo akmods --force --kernel 4.13.9-300.fc27.x86_64 --akmod w
Checking kmods exist for 4.13.9-300.fc27.x86_64 [ OK ]
Run depmod:
sudo depmod -a
(No errors)
And finally modprobe on wl:
sudo modprobe wl
(No errors)
All without success. Does anyone know how to solve this problem? I have seen a few older threads documenting similar issues but none of the accepted solutions appear to work in my case.
Edit 1
After some more searching, I've discovered the kernel module I should be loading for my card is brcmfmac4356.
Running:
modprobe -r brcmfmac
And
modprobe brcmfmac
Produces no output but brcmfmac fails to show up after invoking lsmod. Checking dmesg reveals:
[ 8488.780453] brcmfmac: brcmf_fw_map_chip_to_name: using brcm/brcmfmac4356-pcie.bin for chip 0x004356(17238) rev 0x000002
[ 8488.782147] brcmfmac 0000:04:00.0: Direct firmware load for brcm/brcmfmac4356-pcie.txt failed with error -2
[ 8491.291361] brcmfmac: brcmf_msgbuf_query_dcmd: Timeout on response for query command
[ 8491.291376] brcmfmac: brcmf_c_preinit_dcmds: Retreiving cur_etheraddr failed, -5
[ 8491.291383] brcmfmac: brcmf_bus_started: failed: -5
[ 8491.291398] brcmfmac: brcmf_pcie_attach_bus: dongle is not responding
I am not sure what to make of this but will supply a further update when I have time to dig a little deeper.
Edit 2 and ugly fix
I now have a working wireless interface by hunting down the allegedly missing file brcm/brcmfmac4356-pcie.txt here, pasting it into /lib/firmware/brcm/ and running:
modprobe brcmfmac
This feels like a hack and I have to wonder why brcm/brcmfmac4356-pcie.txt was absent. Is this a bug and the wrong file was being sourced?
While I now have a working WiFi connection I would very much like to understand the source of the problem.
Edit 3
The above fix is not persistent after reboot and requires me to execute modprobe brcmfmac before the wireless interface becomes visible.
|
I had the same problem when I upgraded my Thinkpad X260 from Fedora 26 to 27 (the chipset is BCM4356 too). I solved it thanks to this bug report at RH Bugzilla
I downgraded to linux-firmware-20171009-78.gitbf04291.fc27
I had taken before the same steps installing broadcom-wl package. I commented brcmfmac module in the /usr/lib/modprobe.d/broadcom-wl-blacklist.conf file so the module loaded automatically at boot. But I finally removed the broadcom-wl package as it's no needed anymore.
Next optional step would be to fix the linux-firmware version in order to avoid updates until the issue is solved.
Easy steps ;-)
sudo dnf remove broadcom-wl
sudo dnf install linux-firmware-20171009-78.gitbf04291.fc27
And edit /etc/dnf/dnf.com adding the next line:
exclude=linux-firmware*
| Broadcom wireless undetected in Fedora 27 |
1,519,213,760,000 |
I have a new Kali Rolling set up and am having numerous problems attempting to install WiFi drivers for a broadcom 14e4:43a0 device (TP LINK Archer T8E). I am currently USB tethering from my phone.
Searching online gave me results that I should install the bcmwl-kernel-source package for the drivers but whenever I attempt to apt-get bcmwl-kernel-source I get E: Unable to locate package bcmwl-kernel-source.
I have tried to download this package straight from the web and installing from a local folder but still get the same error.
I then proceeded to continue to search for solutions, many to do with updating the /etc/apt/sources.list list. I have tried messing with those with no prevail and have since defaulted those changes back.
It seems every package that I try to install (can install but) doesn't help me setting up WiFi.
No WLAN devices show up in ifconfig or iwconfig.
Using modprobe wl returns a fatal error, something about wl not being found (currently not at work to access machine).
Any further help, ideas and suggestions will be much appreciated.
Thanks
|
The bcmwl-kernel-source isn't available on kali repository the alternative package is the broadcom-sta-dkms
with the regularly kali-linux repository, your /etc/apt/sources.list should contain only this URL:
deb http://http.kali.org/kali kali-rolling main contrib non-free
the apt-cache search broadcom-sta will show you:
broadcom-sta-common - Common files for the Broadcom STA Wireless driver
broadcom-sta-dkms - dkms source for the Broadcom STA Wireless driver
broadcom-sta-source - Source for the Broadcom STA Wireless driver
To install the driver for the BCM4360 (14e4:43a0) wireless card run the following command:
apt-get update && apt-get upgrade && apt-get dist-upgrade
Reboot and install the linux-headers package (run apt-cache search linux-headers to get the available linux-headers) then run:
apt-get install broadcom-sta-dkms
modprobe -r b44 b43 b43legacy ssb brcmsmac bcma
modprobe wl
| Installing WiFi drivers for 14e4:43a0 rev 3 broadcom pcie device - can't find bcmwl-kernel-source package |
1,519,213,760,000 |
I need to install the driver as it was not recognised automatically when installing Kali Linux on my MacBook Pro. If I type iwconfig then I get only lo and no wlan0. There is no ethernet port on the new MacBooks so I needed to find a way to connect to the internet in order to download stuff without using the USB method. I used my phone's connection over Bluetooth.
The following terminal command gives me the Wireless Network Adapter make. I went to kernel.org and looked this up in the Drivers table. It shows that it wasn't supported and I needed to use something called wl.
root@kali:~# lspci -knn | grep Net -A2
03:00.0 Network controller [0280]: Broadcom Corporation BCM4360 802.11ac Wireless Network Adapter [14e4:43a0] (rev 03)
Subsystem: Apple Inc. BCM4360 802.11ac Wireless Network Adapter [106b:0134]
Kernel modules: bcma
04:00.0 Multimedia controller [0480]: Broadcom Corporation 720p FaceTime HD Camera [14e4:1570]
I am having trouble configuring my network card in my MacBook Pro to work on Kali Linux. When I try:
apt-get install broadcom-sta-dkms
I get the error:
Error! Bad return status for module build on kernel: 4.6.0-kali1-amd64 (x86_64)
Consult /var/lib/dkms/broadcom-sta/6.30.223.248/build/make.log for more information.
The other problem some people are having is with:
modprobe wl
|
I eventually fixed this by doing the following:
1) Making sure these were in /etc/apt/sources.list
deb http://http.kali.org/kali kali-rolling main contrib non-free
# For source package access, uncomment the following line
deb-src http://http.kali.org/kali kali-rolling main contrib non-free
2) Making sure everything was ready
apt-get update && apt-get dist-upgrade
3) Rebooting the kernel
reboot
4) Finding out my version:
root@kali:~# uname -a
Linux kali 4.6.0-kali1-amd64 #1 SMP Debian 4.6.4-1kali1 (2016-07-21) x86_64 GNU/Linux
5) Finding out which network card I had
root@kali:~# lspci | grep Wireless
03:00.0 Network controller: Broadcom Corporation BCM4360 802.11ac Wireless Network Adapter (rev 03)
6) Running this:
root@kali:~# apt-get update; apt-get install broadcom-sta-dkms; apt-get install linux-image-$(uname -r|sed 's,[^-]*-[^-]*-,,') linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,') broadcom-sta-dkms
7) Then:
root@kali:~# modprobe -r b44 b43 b43legacy ssb brcmsmac bcma
and
root@kali:~# sudo modprobe wl
Finally you can check that it's worked by using iwconfig and you should see that now you have wlan0 recognised by Kali Linux. Go to settings and connect to wi-fi.
| Internal Wireless Card setup Mac Dual Boot 2016 Kali Linux |
1,519,213,760,000 |
My issue looks similar to this one.
I configure my Broadcom BCM4311 802.11b/g device on FreeBSD 10.3-STABLE like this:
sudo kldload if_bwn
sudo kldload bwn_v4_ucode
sudo kldload bwn_v4_lp_ucode
#
# Now, interface `bwn0` is available
#
sudo ifconfig wlan0 create wlandev bwn0
sudo ifconfig wlan0 up # at this moment, laptop WiFi LED light turns on
sudo ifconfig wlan0 scan # I can see my wireless router SSID
sudo wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf
sudo ifconfig wlan0 list sta
sudo dhclient wlan0
#
# Optionally, rather than dhclient run:
#
sudo ifconfig wlan0 inet 192.168.1.103 netmask 0xffffff00
ifconfig shows wireless network status as associated:
$ ifconfig
bge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=8009b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LINKSTATE>
ether 00:15:c5:ad:63:9c
inet 192.168.1.101 netmask 0xffffff00 broadcast 192.168.1.255
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
inet 127.0.0.1 netmask 0xff000000
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
bwn0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 2290
ether 00:18:f3:38:a0:36
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
media: IEEE 802.11 Wireless Ethernet autoselect mode 11g
status: associated
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
ether 00:18:f3:38:a0:36
inet 192.168.1.103 netmask 0xffffff00 broadcast 192.168.1.255
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
media: IEEE 802.11 Wireless Ethernet OFDM/48Mbps mode 11g
status: associated
ssid Mine channel 11 (2462 MHz 11g) bssid e8:de:27:6b:3e:67
country US authmode WPA2/802.11i privacy ON deftxkey UNDEF
TKIP 2:128-bit txpower 30 bmiss 7 scanvalid 60 bgscan bgscanintvl 300
bgscanidle 250 roam:rssi 7 roam:rate 5 protmode CTS wme roaming MANUAL
$
I disconnect laptop Ethernet cable to check the wireless connection to router by following methods:
Wireless router shows that my laptop is listed among "Current Connected Wireless Clients":
ID MAC
1 00:18:F3:38:A0:36
Wireless router has a diagnostic ping tool by which I can ping to my laptop, when I do that, timed out message is received:
IP Address/Domain Name: 192.168.1.103
Request timed out
From my laptop I ping to router:
$ ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1): 56 data bytes
ping: sendto: No route to host
ping: sendto: No route to host
ping: sendto: No route to host
ping: sendto: No route to host
ping: sendto: No route to host
^C
--- 192.168.1.1 ping statistics ---
5 packets transmitted, 0 packets received, 100.0% packet loss
$
arp -an output:
$ arp -an
? (192.168.1.103) at 00:18:f3:38:a0:36 on wlan0 permanent [ethernet]
? (192.168.1.1) at e8:de:27:6b:3e:67 on bge0 expires in 803 seconds [ethernet]
? (192.168.1.101) at 00:15:c5:ad:63:9c on bge0 permanent [ethernet]
$
netstat -r output:
$ netstat -r
Routing tables
Internet:
Destination Gateway Flags Netif Expire
default 192.168.1.1 UGS bge0
localhost link#2 UH lo0
192.168.1.0 link#4 U wlan0
192.168.1.101 link#1 UHS lo0
192.168.1.103 link#4 UHS lo0
Internet6:
Destination Gateway Flags Netif Expire
:: localhost UGRS lo0
localhost link#2 UH lo0
::ffff:0.0.0.0 localhost UGRS lo0
fe80:: localhost UGRS lo0
fe80::%lo0 link#2 U lo0
fe80::1%lo0 link#2 UHS lo0
ff01::%lo0 localhost U lo0
ff02:: localhost UGRS lo0
ff02::%lo0 localhost U lo0
$
dmesg output from creating wlan0 interface up to dhclient command:
wlan0: Ethernet address: 00:18:f3:38:a0:36
bwn0: firmware version (rev 410 patch 2160 date 0x751a time 0x7c0a)
wlan0: ieee80211_new_state_locked: pending INIT -> SCAN transition lost
bwn0: status of RF switch is changed to OFF
bwn0: please turn on the RF switch
bwn0: firmware version (rev 410 patch 2160 date 0x751a time 0x7c0a)
bwn0: status of RF switch is changed to OFF
bwn0: please turn on the RF switch
wlan0: link state changed to UP
bwn0: need multicast update callback
bwn0: need multicast update callback
bwn0: need multicast update callback
Configuration files
I don't use /etc/rc.conf, I do everything manually. I use following wpa_supplicant configuration:
$ cat /etc/wpa_supplicant.conf
network={
ssid="Mine"
psk=79a174594e2ec3563ff4c35c1a82a006b19df646fa020aaf53078d34d09ed962
}
$
I wonder if anybody can give a hand.
UPDATE:
Now, I'm using /etc/rc.conf like this:
#
# Kernel modules to load after local disks are mounted
#
kld_list="linux nvidia if_bwn bwn_v4_ucode bwn_v4_lp_ucode fuse"
#
# DELL LATITUDE | D820
#
hostname="D820"
#
# $ sudo ifconfig wlan0 create wlandev bwn0
#
wlans_bwn0="wlan0"
#
# $ sudo ifconfig wlan0 up
# $ sudo ifconfig wlan0 scan
# $ sudo wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf
# $ sudo dhclient wlan0
#
wpa_supplicant_conf_file="/etc/wpa_supplicant.conf"
ifconfig_wlan0="WPA DHCP"
#
# gnome3-lite desktop environment services
#
#dbus_enable="YES"
#hald_enable="YES"
#gdm_enable="YES" # GDM will start automatically when the system boots
#gnome_enable="YES"
#linux_enable="YES"
##
## To enable the tor server
##
#tor_enable="YES"
##
## web proxy of choice
##
#polipo_enable="YES"
#privoxy_enable="YES"
##
##For Linux compatibility to be enabled at boot time
##
linux_enable="YES"
|
When you booted your laptop and configured the wired bge0 interface via dhclient, it became the default route (as seen in the rightmost column in the output of netstat -r). When you later configured your wireless bwn0 interface and disconnected the wired interface, it wasn't set to be the default route. When you tried to access the network (or reply to requests), traffic was trying to use bge0 but it was disconnected.
Rebooting your laptop you can just configure the wireless interface and not have this problem.
If you want to move from wired to wireless in the future, I believe you can do the following:
route change default -iface wlan0
route change default 192.168.1.1
This sets the default route interface to the wireless one, which resets the router address, so we re-add it in the second line.
| Configure wireless network on FreeBSD: router shows wireless device is connected, but cannot ping |
1,519,213,760,000 |
i've install gentoo on a raspberry Pi 3. The version of the kernel sources is 4.1.20-v7+. All works fine except for the wifi.
When i load the module brcmfmac, it is loaded without complaint but the wifi chips isn't recognize nor detected.
For the kernel config, i use the one from the latest raspbian /proc/config.gz.
As with the raspbian, the chip is detected, i know it works.
I get the several firmware from the package linux-firmware and i've got the one i need /lib/firmware/brcm/brcmfmac43430-sdio.bin
the result of the lsmod is:
Module Size Used by
brcmfmac 177627 0
brcmutil 5493 1 brcmfmac
ipv6 338946 18
cfg80211 405047 1 brcmfmac
rfkill 16028 1 cfg80211
iptable_mangle 1326 0
iptable_nat 1593 0
nf_nat_ipv4 4784 1 iptable_nat
nf_nat 12056 1 nf_nat_ipv4
nf_log_ipv4 3720 3
nf_log_common 2780 1 nf_log_ipv4
xt_LOG 1177 3
xt_limit 1613 2
ipt_REJECT 1257 1
nf_reject_ipv4 2230 1 ipt_REJECT
nf_conntrack_ipv4 12664 11
nf_defrag_ipv4 1275 1 nf_conntrack_ipv4
xt_tcpudp 2097 8
xt_conntrack 3023 10
nf_conntrack 75577 4 nf_nat,nf_nat_ipv4,xt_conntrack,nf_conntrack_ipv4
iptable_filter 1237 1
ip_tables 11409 3 iptable_filter,iptable_mangle,iptable_nat
x_tables 12603 8 ip_tables,xt_tcpudp,xt_limit,xt_conntrack,xt_LOG,iptable_filter,ipt_REJECT,iptable_mangle
binfmt_misc 6228 1
squashfs 29028 1
bcm2708_rng 953 0
snd_soc_bcm2708_i2s 6662 0
snd_soc_pcm512x_i2c 2083 0
snd_soc_pcm512x 15581 1 snd_soc_pcm512x_i2c
snd_soc_wm8804_i2c 1384 0
regmap_mmio 2834 1 snd_soc_bcm2708_i2s
snd_soc_wm8804 7115 1 snd_soc_wm8804_i2c
snd_soc_tas5713 5088 0
snd_soc_core 128253 4 snd_soc_pcm512x,snd_soc_wm8804,snd_soc_tas5713,snd_soc_bcm2708_i2s
snd_compress 7681 1 snd_soc_core
snd_pcm_dmaengine 3223 1 snd_soc_core
regmap_i2c 2676 3 snd_soc_pcm512x_i2c,snd_soc_wm8804_i2c,snd_soc_tas5713
snd_pcm 73466 4 snd_soc_pcm512x,snd_soc_wm8804,snd_soc_core,snd_pcm_dmaengine
snd_timer 18840 1 snd_pcm
snd 50771 4 snd_soc_core,snd_timer,snd_pcm,snd_compress
spi_bcm2708 5030 0
i2c_bcm2708 4912 0
The result of wireless-info tool from ubuntu:
########## wireless info START ##########
Report from: 06 Apr 2016 02:46 CEST +0200
Booted last: 06 Apr 2016 00:00 CEST +0200
Script from: 27 Sep 2015 00:34 UTC +0000
##### release ###########################
./wireless-info: line 155: lsb_release: command not found
##### kernel ############################
Linux 4.1.20-v7+ #1 SMP Tue Apr 5 00:28:37 CEST 2016 armv7l unknown BCM2709 GNU/Linux
dma.dmachans=0x7f35, bcm2708_fb.fbwidth=1920, bcm2708_fb.fbheight=1200, bcm2709.boardrev=0xa02082, bcm2709.serial=0xa9f651a3, smsc95xx.macaddr=<MAC address>, bcm2708_fb.fbswap=1, bcm2709.uart_clock=48000000, vc_mem.mem_base=0x3dc00000, vc_mem.mem_size=0x3f000000, dwc_otg.lpm_enable=0, console=ttyS0,115200, kgdboc=ttyAMA0,115200, console=tty0, rootfstype=ext4, elevator=deadline, rootwait
##### desktop ###########################
sed: can't read /root/.dmrc: No such file or directory
Could not be determined.
##### lspci #############################
pcilib: Cannot open /proc/bus/pci
lspci: Cannot find any working access method.
##### lsusb #############################
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
##### PCMCIA card info ##################
'pccardctl' is not installed (package "pcmciautils").
##### rfkill ############################
./wireless-info: line 192: rfkill: command not found
##### lsmod #############################
brcmfmac 177627 0
brcmutil 5493 1 brcmfmac
cfg80211 405047 1 brcmfmac
rfkill 16028 1 cfg80211
##### interfaces ########################
sed: can't read /etc/network/interfaces: No such file or directory
##### ifconfig ##########################
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet XX.XX.XX.XX netmask 255.255.255.0 broadcast XX.XX.XX.XX
inet6 XXXXXXXXXXXXXXXXXXXXXXXXX prefixlen 64 scopeid 0x20<link>
inet6 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX prefixlen 64 scopeid 0x0<global>
ether <MAC address> txqueuelen 1000 (Ethernet)
RX packets 196 bytes 18362 (17.9 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 170 bytes 20021 (19.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 0 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
##### iwconfig ##########################
lo no wireless extensions.
eth0 no wireless extensions.
##### route #############################
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 XX.XX.XX.XX 0.0.0.0 UG 2 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
XX.XX.XX.XX 0.0.0.0 255.255.255.0 U 2 0 0 eth0
##### resolv.conf #######################
nameserver XX.XX.XX.XX
##### network managers ##################
Installed:
>~~~None found.
Running:
>~~~None found.
##### NetworkManager info ###############
NetworkManager is not installed (package "network-manager").
##### NetworkManager.state ##############
cat: /var/lib/NetworkManager/NetworkManager.state: No such file or directory
##### NetworkManager.conf ###############
grep: /etc/NetworkManager/NetworkManager.conf: No such file or directory
##### NetworkManager profiles ###########
No NetworkManager profiles found.
##### iw reg get ########################
'iw' is not installed (package "iw").
##### iwlist channels ###################
lo no frequency information.
eth0 no frequency information.
##### iwlist scan #######################
./wireless-info: line 302: sudo: command not found
Acquisition of admin privileges failed.
##### module infos ######################
[brcmfmac]
filename: /lib/modules/4.1.20-v7+/kernel/drivers/net/wireless/brcm80211/brcmfmac/brcmfmac.ko
license: Dual BSD/GPL
description: Broadcom 802.11 wireless LAN fullmac driver.
author: Broadcom Corporation
firmware: brcm/brcmfmac4354-sdio.txt
firmware: brcm/brcmfmac4354-sdio.bin
firmware: brcm/brcmfmac43455-sdio.txt
firmware: brcm/brcmfmac43455-sdio.bin
firmware: brcm/brcmfmac43430-sdio.txt
firmware: brcm/brcmfmac43430-sdio.bin
firmware: brcm/brcmfmac4339-sdio.txt
firmware: brcm/brcmfmac4339-sdio.bin
firmware: brcm/brcmfmac43362-sdio.txt
firmware: brcm/brcmfmac43362-sdio.bin
firmware: brcm/brcmfmac4335-sdio.txt
firmware: brcm/brcmfmac4335-sdio.bin
firmware: brcm/brcmfmac43341-sdio.txt
firmware: brcm/brcmfmac43341-sdio.bin
firmware: brcm/brcmfmac43340-sdio.txt
firmware: brcm/brcmfmac43340-sdio.bin
firmware: brcm/brcmfmac4334-sdio.txt
firmware: brcm/brcmfmac4334-sdio.bin
firmware: brcm/brcmfmac4330-sdio.txt
firmware: brcm/brcmfmac4330-sdio.bin
firmware: brcm/brcmfmac4329-sdio.txt
firmware: brcm/brcmfmac4329-sdio.bin
firmware: brcm/brcmfmac43241b4-sdio.txt
firmware: brcm/brcmfmac43241b4-sdio.bin
firmware: brcm/brcmfmac43241b0-sdio.txt
firmware: brcm/brcmfmac43241b0-sdio.bin
firmware: brcm/brcmfmac43143-sdio.txt
firmware: brcm/brcmfmac43143-sdio.bin
firmware: brcm/brcmfmac43569.bin
firmware: brcm/brcmfmac43242a.bin
firmware: brcm/brcmfmac43236b.bin
firmware: brcm/brcmfmac43143.bin
srcversion: F50C49C88C2DEA498C4EAC7
depends: brcmutil,cfg80211
intree: Y
vermagic: 4.1.20-v7+ SMP mod_unload modversions ARMv7.
parm: txglomsz:maximum tx packet chain size [SDIO] (int)
parm: firmware_path:string
parm: debug:level of debug output (int)
parm: fcmode:mode of firmware signalled flow control (int)
parm: roamoff:do not use internal roaming engine (int)
[brcmutil]
filename: /lib/modules/4.1.20-v7+/kernel/drivers/net/wireless/brcm80211/brcmutil/brcmutil.ko
license: Dual BSD/GPL
description: Broadcom 802.11n wireless LAN driver utilities.
author: Broadcom Corporation
srcversion: AE9B4BBC6D82855B9265054
depends:........
intree: Y
vermagic: 4.1.20-v7+ SMP mod_unload modversions ARMv7.
[cfg80211]
filename: /lib/modules/4.1.20-v7+/kernel/net/wireless/cfg80211.ko
description: wireless configuration support
license: GPL
author: Johannes Berg
srcversion: 6610E9DB7046B562928123C
depends: rfkill
intree: Y
vermagic: 4.1.20-v7+ SMP mod_unload modversions ARMv7.
parm: ieee80211_regdom:IEEE 802.11 regulatory domain code (charp)
parm: cfg80211_disable_40mhz_24ghz:Disable 40MHz support in the 2.4GHz band (bool)
##### module parameters #################
[brcmfmac]
debug: 0
fcmode: 0
roamoff: 0
[cfg80211]
cfg80211_disable_40mhz_24ghz: N
ieee80211_regdom: 00
##### /etc/modules ######################
grep: /etc/modules: No such file or directory
##### modprobe options ##################
[/etc/modprobe.d/aliases.conf]
alias char-major-10-175>agpgart
alias char-major-10-200>tun
alias char-major-81>bttv
alias char-major-108>~~~ppp_generic
alias /dev/ppp>~>~~~ppp_generic
alias tty-ldisc-3>~~ppp_async
alias tty-ldisc-14>~ppp_synctty
alias ppp-compress-21>~~bsd_comp
alias ppp-compress-24>~~ppp_deflate
alias ppp-compress-26>~~ppp_deflate
alias loop-xfer-gen-0>~~loop_gen
alias loop-xfer-3>~~loop_fish2
alias loop-xfer-gen-10>~loop_gen
alias cipher-2>~>~~~des
alias cipher-3>~>~~~fish2
alias cipher-4>~>~~~blowfish
alias cipher-6>~>~~~idea
alias cipher-7>~>~~~serp6f
alias cipher-8>~>~~~mars6
alias cipher-11>>~~~rc62
alias cipher-15>>~~~dfc2
alias cipher-16>>~~~rijndael
alias cipher-17>>~~~rc5
alias char-major-89 i2c-dev
[/etc/modprobe.d/i386.conf]
alias parport_lowlevel parport_pc
alias char-major-10-144 nvram
alias binfmt-0064 binfmt_aout
alias char-major-10-135 rtc
##### rc.local ##########################
grep: /etc/rc.local: No such file or directory
##### pm-utils ##########################
find: ‘/etc/pm/*.d’: No such file or directory
##### udev rules ########################
grep: /etc/udev/rules.d/*net*.rules: No such file or directory
##### dmesg #############################
[ 1.874541] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-bcm2708_usb-1.1, smsc95xx USB 2.0 Ethernet, <MAC address>
[ 11.320439] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[ 12.924555] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
########## wireless info END ############
thanks for your help.
|
I had the same problem, but as it all worked on raspian, I copied ALL the files from /lib/firmware/brcm on raspian to my gentoo system on the theory that if they were not required they would not be loaded.
The problem was solved!
| wifi chipset not detected on rPi 3 with gentoo |
1,519,213,760,000 |
I recently installed Ubuntu 14.04 on a computer with a Broadcom BCM4312 802.11b/g LP-PHY wireless card. After installing the proprietary drivers available from the Ubuntu repositories, I was able to see other wifis (my neighbours') APs, but not mine. I tried several drivers without success. I decided then to try Fedora, but after installing kmod-wl from the RPM Fusion repositories, I found the same problem. Of course, I also tried rebooting and resetting the router many times between installations and configuration changes...
The strange thing is that I am able to connect to the router from a different computer and from a mobile phone, but still I can't see the router's ESSID from this computer with the BC card, while I do see my neighbours' ESSIDs. What could be the problem?
|
Although searching on the internet will lead you to instructions like: reboot/reset your router, reinstall "this" or "that" driver version or make sure your ESSID is not configured to be hidden, the problem may be the channel.
Having a look at the 2.4 GHz (802.11b/g/n) specification (my router can only use de 2.4 GHz band), it seems that countries apply their own regulations and, although most of the world use channels 1 to 11 (frequencies between 2412 and 2462 MHz) some (as in North America), do not use channels 12 and 13. Japan, for example, uses channel 14 too, at 2484 MHz.
So, before giving up, try to change the channel configuration in your router and use one in the [1, 11] range and see if it works. In my case, the channel was set to "Auto", but the router was always selecting 13. If the new channel works, it is a good sign.
Now, you can just keep that channel configuration in your router or you can try and see if you have the correct configuration in your computer. Make sure the iwlist chan command lists the channel you want to use:
# iwlist chan
[...]
Channel 11 : 2.462 GHz
Channel 12 : 2.467 GHz
Channel 13 : 2.472 GHz
Channel 14 : 2.484 GHz
[...]
If it does not, then you may need to change the regulatory domain configuration with the iw command:
iw reg set XX
Where XX would be the ISO 3166-1 alpha-2 country code, or 00 as a special non-alpha2 usable entry for World Regulatory domain.
| Broadcom: not able to see my wifi |
1,519,213,760,000 |
I have a Dell 710 with Quad Bcom NetExtreme 5709s. In the name of expediency, I'm trying to boot off the Squeeze live CD, but the Broadcom drivers are in non-free, so they don't come up when you boot.
No problem, I think to myself. I will sneaker-net the bnx2-firmware deb and all is good.
I can see the interfaces in lspci, I have unpacked the deb and successfully executed modprobe bnx2; however I still can't see the interfaces in ip link show. What else should I do to bring these interfaces up without a reboot?
EDIT
I have old entries in /var/log/kern.log about the failure to load bnx2 at boot, but the modprobe completes successfully with no other log entries...
$ lsmod | grep bnx
bnx2 57385 0
|
The firmware must be present at the time you load the driver. So be sure to unload the module and reload it:
# <install firmware>
rmmod bnx2
modprobe bnx2
For some drivers (I don't know about this one), you may need to unload auxiliary modules that it's using. lsmod | grep bnx2 will show what modules bnx2 uses. Call rmmod on all of them in reverse dependency order.
Most modules emit some log messages when they're loaded and they find a potential device, sometimes even if they don't find a potential device. These logs would be on /var/log/kern.log, at least on Debian and Ubuntu.
| Debian Live - modprobe failed to bring up Broadcom ethernet interfaces |
1,519,213,760,000 |
I've update my kernel version from 4.11 to 5.4.3-g9c2490ac8-dirty #3 SMP PREEMPT Sun Aug 8 12:11:16 UTC 2021 armv7l GNU/Linux
I have an issue with brcmfmac kernel module. I have enabled brcmfmac debug and enables all messages types in debug message.
you can see the dmesg output when I put this command insmod /<path to ko file>/brcmfmac.ko debug=0x1FFFF
:
[ 2526.159218] brcmfmac: brcmfmac_module_init No platform data available.
[ 2526.168959] brcmfmac: brcmf_ops_sdio_probe Enter
[ 2526.168979] brcmfmac: brcmf_ops_sdio_probe Class=0
[ 2526.168991] brcmfmac: brcmf_ops_sdio_probe sdio vendor ID: 0x02d0
[ 2526.169001] brcmfmac: brcmf_ops_sdio_probe sdio device ID: 0xa962
[ 2526.169011] brcmfmac: brcmf_ops_sdio_probe Function#: 1
[ 2526.169347] brcmfmac: brcmf_ops_sdio_probe Enter
[ 2526.169362] brcmfmac: brcmf_ops_sdio_probe Class=0
[ 2526.169372] brcmfmac: brcmf_ops_sdio_probe sdio vendor ID: 0x02d0
[ 2526.169383] brcmfmac: brcmf_ops_sdio_probe sdio device ID: 0xa962
[ 2526.169392] brcmfmac: brcmf_ops_sdio_probe Function#: 2
[ 3249.364285] brcmfmac: brcmf_sdio_exit Enter
I don't see wlan0 name when execute ifconfig -a !
I have placed appropriate .bin and .txt files in path /lib/firmware/brcm/
ls /lib/firmware/brcm/ -l
-rwxr--r-- 1 root root 219557 Jun 2 12:28 brcmfmac43362-sdio.bin
-rwxr--r-- 1 root root 1121 Jun 2 12:28 brcmfmac43362-sdio.txt
|
the issue resolved.
I have add compatible property to usdhc in dts file.
&usdhc1 {
#address-cells = <1>;
#size-cells = <0>;
pinctrl-names = "default";
max-frequency = <50000000>;
pinctrl-0 = <&pinctrl_usdhc1_alt>;
bus-width = <4>;
no-1-8-v; /* force 3.3V VIO */
non-removable;
pm-ignore-notify;
cap-power-off-card;
// /delete-property/ wakeup-source;
status = "okay";
brcmf: bcrmf@1 {
reg = <1>;
compatible = "brcm,bcm4329-fmac";
};
};
as I remember the older version of brcmfmac was not sensitive to this property.
| brcmfmac, brcmfmac_module_init No platform data available |
1,519,213,760,000 |
Whenever I try to connect to my 5 GHz network, my KDE Network Manager takes a while on "configuring interface", where then I am prompted to enter a password. I enter the network password, but the whole process repeats. I am running Manjaro Linux, and additional information is below.
$ sudo lspci -vvvnnk -d 14e4:
02:00.0 Network controller [0280]: Broadcom Limited BCM43228 802.11a/b/g/n [14e4:4359]
DeviceName: Wireless LAN
Subsystem: Broadcom Limited BCM43228 802.11a/b/g/n [14e4:05e2]
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin A routed to IRQ 17
Region 0: Memory at b2400000 (64-bit, non-prefetchable) [size=16K]
Capabilities: [40] Power Management version 3
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot+,D3cold+)
Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=2 PME-
Capabilities: [58] Vendor Specific Information: Len=78 <?>
Capabilities: [48] MSI: Enable- Count=1/1 Maskable- 64bit+
Address: 0000000000000000 Data: 0000
Capabilities: [d0] Express (v1) Endpoint, MSI 00
DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s <4us, L1 unlimited
ExtTag+ AttnBtn- AttnInd- PwrInd- RBE+ FLReset- SlotPowerLimit 10.000W
DevCtl: CorrErr- NonFatalErr- FatalErr- UnsupReq-
RlxdOrd- ExtTag+ PhantFunc- AuxPwr- NoSnoop-
MaxPayload 128 bytes, MaxReadReq 512 bytes
DevSta: CorrErr- NonFatalErr- FatalErr- UnsupReq- AuxPwr+ TransPend-
LnkCap: Port #0, Speed 2.5GT/s, Width x1, ASPM L1, Exit Latency L1 <64us
ClockPM- Surprise- LLActRep+ BwNot- ASPMOptComp-
LnkCtl: ASPM L1 Enabled; RCB 64 bytes Disabled- CommClk+
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 2.5GT/s (ok), Width x1 (ok)
TrErr- Train- SlotClk+ DLActive+ BWMgmt- ABWMgmt-
Capabilities: [100 v1] Advanced Error Reporting
UESta: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
UEMsk: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
UESvrt: DLP+ SDES- TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
CESta: RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr-
CEMsk: RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr+
AERCap: First Error Pointer: 00, ECRCGenCap+ ECRCGenEn- ECRCChkCap+ ECRCChkEn-
MultHdrRecCap- MultHdrRecEn- TLPPfxPres- HdrLogCap-
HeaderLog: 00000000 00000000 00000000 00000000
Capabilities: [13c v1] Virtual Channel
Caps: LPEVC=0 RefClk=100ns PATEntryBits=1
Arb: Fixed- WRR32- WRR64- WRR128-
Ctrl: ArbSelect=Fixed
Status: InProgress-
VC0: Caps: PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
Arb: Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
Ctrl: Enable+ ID=0 ArbSelect=Fixed TC/VC=ff
Status: NegoPending- InProgress-
Capabilities: [160 v1] Device Serial Number 00-00-b3-ff-ff-d7-30-10
Capabilities: [16c v1] Power Budgeting <?>
Kernel driver in use: bcma-pci-bridge
Kernel modules: bcma
$ iwlist wlp2s0b1 freq
wlp2s0b1 20 channels in total; available frequencies :
Channel 01 : 2.412 GHz
Channel 02 : 2.417 GHz
Channel 03 : 2.422 GHz
Channel 04 : 2.427 GHz
Channel 05 : 2.432 GHz
Channel 06 : 2.437 GHz
Channel 07 : 2.442 GHz
Channel 08 : 2.447 GHz
Channel 09 : 2.452 GHz
Channel 10 : 2.457 GHz
Channel 11 : 2.462 GHz
Channel 36 : 5.18 GHz
Channel 40 : 5.2 GHz
Channel 44 : 5.22 GHz
Channel 48 : 5.24 GHz
Channel 149 : 5.745 GHz
Channel 153 : 5.765 GHz
Channel 157 : 5.785 GHz
Channel 161 : 5.805 GHz
Channel 165 : 5.825 GHz
Current Frequency:2.437 GHz (Channel 6)
Driver
I'm using the b43 module.
|
This card, according to the Broadcom Wiki, does support only the abgn networks.
You probably meant that the a stands for ac, which is nowadays 5 GHz standard.
I am sorry, but this card simply does not support ac networking.
| Can't connect to 5GHz network on Broadcom BCM43228 802.11a/b/g/n [14e4:4359] |
1,519,213,760,000 |
A few hours ago I installed Puppy Linux on to the quoted machine and have been pulling my hair out trying to configure the wifi.
Reasonably sure my machine needs the broadcom driver/pack but have no clue how to fix it.
I've laboriously looked through previous posts but the only solutions i could find used shell commands not available in Puppy.
Please help before this netbook goes out the window.
|
From your desktop clic connect
Next step clic Load module
Choose b43 or b43-legacy then press Load
If the tow modules doesn't work , you can choose Ndiswrapper then select the .inf file (of the windows driver)
| Unable to configure wifi on Packard Bell Dot S |
1,519,213,760,000 |
I am having some troubles with the WIFI on my Macbook using Tails (USB). I encountered a problem similar once when setting up an Arch Linux USB system but I as able to find the necessary drivers and install them properly (Arch doc is very well done).
However I have absolutely no idea how to do this in Tails (or Debian in general). I don't have ethernet so I need to download manually the packages and install them manually on the system after.
The device is Broadcom 14e4:43a0.
How should I achieve that?
Thanks!
|
I took the time to dig into this. We need to install the wl driver for the 14E4:43A0 chip.
Here are the steps :
Enable non-free in the /etc/apt/sources.list file
apt-get install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,') broadcom-sta-dkms
modprobe -r b44 b43 b43legacy ssb brcmsmac to remove drivers that may conflict
modprobe wl to enable the driver
On Tails OS, this won't be saved after reboot.
IMPORTANT EDIT :
You should not do this.
| Install wifi driver for Macbook 11.1 under Tails |
1,475,223,652,000 |
I have installed fedora 23 and have dual boot with Windows 10 on Dell Inspiron 1545. The system doesn't recognize the wireless card with is Broadcom BCM4312.
I downloaded several rpms and tried to install them but failed.
I managed to install rfkill but
rfkill list wifi
gives nothing
rfkill list all
gives nothing as well.
What I have is
rpmfusion-free-release-23.noarch.rpm
pmfusion-nonfree-release-23.noarch.rpm
kmod-wl-4.2.3-300.fc23.x86_64-6.30.223.271-4.fc23.x86_64.rpm
kmod-wl-6.30.223.271-4.fc23.x86_64.rpm
broadcom-wl-6.30.223.271-1.fc23.noarch.rpm
When I tried to install them via 'sudo dnf ' it failed because it tried to download updates which is not possible since there is no connection with the Internet.
I managed to install
rpmfusion-free-release-23.noarch.rpm
pmfusion-nonfree-release-23.noarch.rpm
by running 'sudo rpm -ivh ' but when I run
sudo rpm -ivh kmod-wl-6.30.223.271-4.fc23.x86_64.rpm
I get
warning: kmod-wl-6.30.223.271-4.fc23.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID 5ca6c469: NOKEY
error: Failed dependencies:
kmod-wl-4.2.3-300.fc23.x86_64 >= 6.30.223.271-4.fc23 is needed by kmod-wl-6.30.223.271-4.fc23.x86_64
I tried to run
sudo rpm -ivh kmod-wl-4.2.3-300.fc23.x86_64-6.30.223.271-4.fc23.x86_64.rpm
but I got
warning: kmod-wl-4.2.3-300.fc23.x86_64-6.30.223.271-4.fc23.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID 5ca6c469: NOKEY
error: Failed dependencies:
wl-kmod-common >= 6.30.223.271 is needed by kmod-wl-4.2.3-300.fc23.x86_64-6.30.223.271-4.fc23.x86_64
I wanted to connect with the internet via android smartphone but I didn't find an option to establish a connection via usb.
I there a way to install the packeges kmod and broadcom-wl? Can anybody suggest a solution?
Thanks in advance...
|
I was advised to put all three rpm packages in one directory and run one command and so I did and it worked.
So I put
kmod-wl-4.2.3-300.fc23.x86_64-6.30.223.271-4.fc23.x86_64.rpm
kmod-wl-6.30.223.271-4.fc23.x86_64.rpm
broadcom-wl-6.30.223.271-1.fc23.noarch.rpm
in a new directory and ran
sudo rpm -ivh *.rpm
It worked and after rebooting the system I was able to find available wireless connections and connect.
| Cannot install driver for BCM4312 with Fedora 23, no internet connection |
1,475,223,652,000 |
My keyboard's wifi LED should normally be orange when turned off , blue when turned on, but it's always orange and that makes me uncomfortable.
Here are some outputs I think are useful:
root@Machine:~# uname -a
Linux Machine 4.9.0-kali4-amd64 #1 SMP Debian 4.9.30-2kali1 (2017-06-22) x86_64 GNU/Linux
root@Machine:~# lspci | grep Wireless
44:00.0 Network controller: Broadcom Limited BCM4313 802.11bgn Wireless Network Adapter (rev 01)
root@Machine:~# ifconfig
eth0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether a2:b2:d6:d5:4a:b0 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 20 memory 0xd4800000-d4820000
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
loop txqueuelen 1 (Local Loopback)
RX packets 236821 bytes 65224834 (62.2 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 236821 bytes 65224834 (62.2 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.6 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::7670:459e:2cde:75ea prefixlen 64 scopeid 0x20<link>
inet6 fd9c:c172:b03b:ce00:204c:8ad8:2f5:d85b prefixlen 64 scopeid 0x0<global>
ether 26:26:10:c2:d4:f0 txqueuelen 1000 (Ethernet)
RX packets 111523 bytes 113324698 (108.0 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 112290 bytes 26144479 (24.9 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
root@Machine:~# iwconfig
wlan0 IEEE 802.11 ESSID:"3bdo"
Mode:Managed Frequency:2.422 GHz Access Point: 9C:C1:72:B0:3B:D4
Bit Rate=65 Mb/s Tx-Power=19 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality=60/70 Signal level=-50 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:275 Invalid misc:1391 Missed beacon:0
lo no wireless extensions.
eth0 no wireless extensions.
PS: I have installed broadcom-sta-dkms, broadcom-sta-common and broadcom-sta-source before, but I removed them because they were very problematic (keeps asking for wifi password over and over making me unable to access any router, doesn't open monitor mode).
|
The issue was the module I use, changing the module from brcmsmac to wl will resolve the problem; by running the following (after adding deb http://httpredir.debian.org/debian/ stretch main contrib non-free to /etc/apt/sources.list)
:
apt-get update
apt-get install linux-image-$(uname -r|sed 's,[^-]*-[^-]*-,,') linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,') broadcom-sta-dkms
modprobe -r b44 b43 b43legacy ssb brcmsmac bcma
modprobe wl
| keyboard's wifi LED doesn't work properly |
1,475,223,652,000 |
I'm using Mint 21 on an HP 17-y002na laptop. It's been connected via ethernet cable for much of the time since I updated to 21, but has had wifi capability at times. Last week I noticed that the symbol showing ethernet connection was absent from my panel, but wired connection still works. Unplugged, I get no wifi options or connection
Since then I have tried to sort it to no avail, and I think I may be doing more harm than good, so I'm asking for help. Current situation is:
iwconfig returns
lo no wireless extensions.
eno1 no wireless extensions.
wlo1 IEEE 802.11 ESSID:off/any
Mode:Managed Access Point: Not-Associated
Retry short limit:7 RTS thr:off Fragment thr:off
Power Management:off
lspci -nnk | grep 0280 -A4 returns
03:00.0 Network controller [0280]: Broadcom Inc. and subsidiaries BCM43142 802.11b/g/n [14e4:4365] (rev 01)
DeviceName: WLAN Broadcom 43142 bgn 1x1
Subsystem: Hewlett-Packard Company BCM43142 802.11b/g/n [103c:804a]
Kernel driver in use: wl
Kernel modules: bcma, wl
'rfkill list all' returns
0: hci0: Bluetooth
Soft blocked: yes
Hard blocked: no
The bluetooth unblocks when I select 'Turn Bluetooth On' in the panel, and the above command does then show 'Soft blocked: no'
'dmesg | grep wl' gives me
[ 13.649275] wl: loading out-of-tree module taints kernel.
[ 13.649291] wl: module license 'MIXED/Proprietary' taints kernel.
[ 13.660611] wl: module verification failed: signature and/or required key missing - tainting kernel
[ 13.877253] wlan0: Broadcom BCM4365 802.11 Hybrid Wireless Controller 6.30.223.271 (r587334)
[ 14.674777] wl 0000:03:00.0 wlo1: renamed from wlan0
Wifi is (still) enabled in my BIOS/UEFI set up. Safe boot is disabled
Driver Manager shows I am using bcmwl-kernel-source version 6.30.223.271+bdcom-0ubuntu10~22.04.1
I do want to be able to use the laptop without having to be ethernet connected
Any information, advice or guidance appreciated. Thank you in advance,
Phil
Edit 1 - replaced output of all commands with current output
Edit 2 - I neglected to include all of the linux-header* i had showing as installed. These were:
linux-headers-5.15.0-79
linux-headers-5.15.0-79-generic
linux-headers-5.15.0-82
linux-headers-5.15.0-82-generic
linux-headers-6.2.0-31-generic
linux-headers-generic
linux-headers-generic-hwe-20.04
linux-headers-generic-hwe-20.04-edge
linux-headers-generic-hwe-22.04
linux-headers-generic-hwe-22.04-edge
I have now uninstalled each of the 5.15.0-79* and 5.15.0-82* headers, as well as the linux-headers-generic-hwe-20.04* headers, and rebooted. Software manager informed me I needed to install 5.15.0-82* again, so I did, and uninstalled linux-headers-6.2.0-31-generic, which automatically removed the linux-headers-generic-hwe-22.04*. Rebooted again, and this time Software Manager didn't flag anything up. Still no wifi, but possibly getting closer to a solution?
|
After running
sudo apt remove bcmwl-kernel-source && sudo apt install --reinstall broadcom-sta-dkms
sudo modprobe -rv bcma wl
and
sudo modprobe -v wl,
then rebooting, still no wifi icon or connection, but I hit on the idea of running terminal commands to see what could be seen
nmcli dev wifi
listed networks I could try connecting to, then
nmcli dev wifi connect <name> password <password>
(put a space at the start of the command to not store details in bash history ) with the appropriate details got me connected and working
Still no icon in the panel, and I don't know if it will survive a reboot, but this is definite progress and I'm going to mark this as solved. I'll add more if I find a) a more persistent solution is needed, and b) a more persistent solution
edit - nmcli con up <network> works if authentication details are already present, and is persistent
| Linux Mint 21 - Broadcom 43142 - wifi stopped working |
1,475,223,652,000 |
I'm running Debian 11 5.10.0-9-amd64. I've got an A10Networks Thunder TPS 4435 Network Appliance with 16 SFP+ Ports that are connected to one Broadcom network chip. In the original software, the interfaces are detected, but I've removed it from the disk so I can't check which driver it uses for the NIC.
Results of lspci :
0c:00.0 Ethernet controller: Broadcom Inc. and subsidiaries Device b844 (rev 02)
Subsystem: Broadcom Inc. and subsidiaries Device b844
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin A routed to IRQ 11
Region 0: Memory at f8200000 (64-bit, non-prefetchable) [size=256K]
Capabilities: [48] Power Management version 3
Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot+,D3cold+)
Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=1 PME-
Capabilities: [50] Vital Product Data
pcilib: sysfs_read_vpd: read failed: Input/output error
Not readable
Capabilities: [58] MSI: Enable- Count=1/8 Maskable- 64bit+
Address: 0000000000000000 Data: 0000
Capabilities: [ac] Express (v2) Endpoint, MSI 00
DevCap: MaxPayload 512 bytes, PhantFunc 0, Latency L0s <64ns, L1 <1us
ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset- SlotPowerLimit 10.000W
DevCtl: CorrErr- NonFatalErr- FatalErr- UnsupReq-
RlxdOrd- ExtTag- PhantFunc- AuxPwr+ NoSnoop+
MaxPayload 128 bytes, MaxReadReq 512 bytes
DevSta: CorrErr+ NonFatalErr- FatalErr- UnsupReq+ AuxPwr+ TransPend-
LnkCap: Port #0, Speed 5GT/s, Width x2, ASPM L0s L1, Exit Latency L0s <2us, L1 <2us
ClockPM- Surprise- LLActRep- BwNot- ASPMOptComp-
LnkCtl: ASPM Disabled; RCB 64 bytes, Disabled- CommClk+
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 5GT/s (ok), Width x1 (downgraded)
TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
DevCap2: Completion Timeout: Range ABCD, TimeoutDis+ NROPrPrP- LTR-
10BitTagComp- 10BitTagReq- OBFF Not Supported, ExtFmt- EETLPPrefix-
EmergencyPowerReduction Not Supported, EmergencyPowerReductionInit-
FRS- TPHComp- ExtTPHComp-
AtomicOpsCap: 32bit- 64bit- 128bitCAS-
DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis- LTR- OBFF Disabled,
AtomicOpsCtl: ReqEn-
LnkCtl2: Target Link Speed: 5GT/s, EnterCompliance- SpeedDis-
Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-
Compliance De-emphasis: -6dB
LnkSta2: Current De-emphasis Level: -6dB, EqualizationComplete- EqualizationPhase1-
EqualizationPhase2- EqualizationPhase3- LinkEqualizationRequest-
Retimer- 2Retimers- CrosslinkRes: unsupported
Capabilities: [100 v1] Device Serial Number 00-00-00-00-00-00-00-00
Capabilities: [110 v1] Advanced Error Reporting
UESta: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
UEMsk: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
UESvrt: DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
CESta: RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr-
CEMsk: RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr+
AERCap: First Error Pointer: 00, ECRCGenCap+ ECRCGenEn- ECRCChkCap+ ECRCChkEn-
MultHdrRecCap- MultHdrRecEn- TLPPfxPres- HdrLogCap-
HeaderLog: 00000000 00000000 00000000 00000000
Capabilities: [150 v1] Power Budgeting <?>
Capabilities: [160 v1] Virtual Channel
Caps: LPEVC=0 RefClk=100ns PATEntryBits=1
Arb: Fixed- WRR32- WRR64- WRR128-
Ctrl: ArbSelect=Fixed
Status: InProgress-
VC0: Caps: PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
Arb: Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
Ctrl: Enable+ ID=0 ArbSelect=Fixed TC/VC=01
Status: NegoPending- InProgress-
Loading the bnx2 kernel module does nothing, and I can't find anything about a Broadcom b844 Chip. Has someone got any hint on this?
|
The Broadcom page of the PCI ID Repository does not know about product ID b844 either.
But it would seem that the ID falls within the group of IDs used apparently exclusively for the BCM56xxx series of switch ASIC chips. Of course this is nothing more than an educated guess.
| Searching for Broadcom Inc. and subsidiaries Device b844 (rev 02) driver |
1,475,223,652,000 |
About 2 weeks ago I installed an antivirus (ESET nod32) on my Mint 20.1 server. However, after discovering that it is not at all optimized for Linux (blocked basically all my ports + connections and provided no firewall manager), I uninstalled it and my connections began working again. Recently, after toying around with setting up a Squid proxy server, my ethernet connection has stopped working again. Some diagnostics have shown that the server is detecting the connection, my driver is working just fine, and other devices connected to that router are having no issues; so I suspect it's a configuration issue. It's also worth noting that at the moment I am able to get a temporary connection with a USB wifi adapter.
Here's my output of inxi -Fxz:
System:
Kernel: 5.4.0-66-generic x86_64 bits: 64 compiler: gcc v: 9.3.0
Desktop: Cinnamon 4.8.6 Distro: Linux Mint 20.1 Ulyssa
base: Ubuntu 20.04 focal
Machine:
Type: Server System: Dell product: PowerEdge T320 v: N/A serial: <filter>
Mobo: Dell model: 0W7H8C v: A03 serial: <filter> BIOS: Dell v: 1.5.1
date: 03/08/2013
Battery:
Device-1: hidpp_battery_1 model: Logitech Wireless Mouse Dell WM514
charge: 55% (should be ignored) status: Discharging
CPU:
Topology: Quad Core model: Intel Xeon E5-2407 0 bits: 64 type: MCP
arch: Sandy Bridge rev: 7 L2 cache: 10.0 MiB
flags: avx lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 17600
Speed: 1200 MHz min/max: 1200/2200 MHz Core speeds (MHz): 1: 1200 2: 1200
3: 1200 4: 1200
Graphics:
Device-1: Matrox Systems G200eR2 vendor: Dell driver: mgag200 v: kernel
bus ID: 06:00.0
Display: x11 server: X.Org 1.20.9 driver: modesetting unloaded: fbdev,vesa
resolution: 1600x900~60Hz
OpenGL: renderer: llvmpipe (LLVM 11.0.0 256 bits) v: 4.5 Mesa 20.2.6
direct render: Yes
Audio:
Message: No Device data found.
Network:
Device-1: Broadcom and subsidiaries NetXtreme BCM5720 2-port Gigabit
Ethernet PCIe
vendor: Dell driver: tg3 v: 3.137 port: ecc0 bus ID: 01:00.0
IF: eno1 state: up speed: 100 Mbps duplex: full mac: <filter>
Device-2: Broadcom and subsidiaries NetXtreme BCM5720 2-port Gigabit
Ethernet PCIe
vendor: Dell driver: tg3 v: 3.137 port: ecc0 bus ID: 01:00.1
IF: eno2 state: down mac: <filter>
Device-3: NetGear type: USB driver: mt76x2u bus ID: 1-1.2:6
IF: wlx3894edc5d6e1 state: up mac: <filter>
Drives:
Local Storage: total: 1.46 TiB used: 12.68 GiB (0.9%)
ID-1: /dev/sda vendor: Dell PowerEdge RAID Card model: PERC H710
size: 278.88 GiB
ID-2: /dev/sdb vendor: Dell PowerEdge RAID Card model: PERC H710
size: 278.88 GiB
ID-3: /dev/sdc vendor: Dell PowerEdge RAID Card model: PERC H710
size: 931.00 GiB
ID-4: /dev/sdd type: USB vendor: Dell model: Internal Dual SD
size: 1.90 GiB
RAID:
Hardware-1: Broadcom / LSI MegaRAID SAS 2208 [Thunderbolt]
driver: megaraid_sas v: 07.713.01.00-rc1 bus ID: 08:00.0
Partition:
ID-1: / size: 273.00 GiB used: 12.68 GiB (4.6%) fs: ext4 dev: /dev/sda5
Sensors:
System Temperatures: cpu: 31.0 C mobo: N/A
Fan Speeds (RPM): N/A
Info:
Processes: 229 Uptime: 1h 24m Memory: 15.59 GiB used: 1.46 GiB (9.4%)
Init: systemd runlevel: 5 Compilers: gcc: 9.3.0 Shell: bash v: 5.0.17
inxi: 3.0.38
As well as the output for ethtool eno1:
Settings for eno1:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Supported FEC modes: Not reported
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Advertised pause frame use: Symmetric
Advertised auto-negotiation: Yes
Advertised FEC modes: Not reported
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Link partner advertised pause frame use: Symmetric
Link partner advertised auto-negotiation: Yes
Link partner advertised FEC modes: Not reported
Speed: 100Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
MDI-X: on
Supports Wake-on: g
Wake-on: d
Current message level: 0x000000ff (255)
drv probe link timer ifdown ifup rx_err tx_err
Link detected: yes
Any ideas?
|
After examining the output of of sudo journalctl -b 0 -u NetworkManager as suggested by @waltinator, resulting in:
<info> [...] device (eno1): carrier: link connected
<warn> [...] dhcp4 (eno1): request timed out
I finally realized that it may be helpful to check the wifi extender that my server is connected to via ethernet (gross, I know, but it works for the layout of my computers). After a quick WPS reset everything was back in working order again.
| Ethernet Not Connecting on Linux Mint |
1,475,223,652,000 |
I've installed Debian 10.5 few days ago, after playing with drives and packages I was able to set up required broadcom drivers and was able to connect to wifi.
Because I've accomplished my mission I was quite happy thus I went sleep that day. Tho in the morning I saw that wifi connection is not there any more. It shown up as valid and I can see all wifi connections around, but no luck in connection to any. It keep saying that "Authentication Required by Wifi network".
$sudo lspci | grep controller
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 6000 (rev 09)
00:14.0 USB controller: Intel Corporation Wildcat Point-LP USB xHCI Controller (rev 03)
00:15.0 DMA controller: Intel Corporation Wildcat Point-LP Serial IO DMA Controller (rev 03)
00:15.4 Serial bus controller [0c80]: Intel Corporation Wildcat Point-LP Serial IO GSPI Controller #1 (rev 03)
00:16.0 Communication controller: Intel Corporation Wildcat Point-LP MEI Controller #1 (rev 03)
00:1f.6 Signal processing controller: Intel Corporation Wildcat Point-LP Thermal Management Controller (rev 03)
02:00.0 Multimedia controller: Broadcom Limited 720p FaceTime HD Camera
03:00.0 Network controller: Broadcom Limited BCM4360 802.11ac Wireless Network Adapter (rev 03)
04:00.0 SATA controller: Samsung Electronics Co Ltd Device a801 (rev 01)
$sudo iwconfig
wlp3s0 IEEE 802.11 ESSID:off/any
Mode:Managed Access Point: Not-Associated Tx-Power=200 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
enx1c4bd6b517a2 no wireless extensions
$ sudo nano /etc/NetworkManager/NetworkManager.conf
[main]
plugins=ifupdown,keyfile
[ifupdown]
managed=false
[connection]
wifi.cloned-mac-address=random
[connection]
ethernet.cloned-mac-address=random
[device]
wifi.scan-rand-mac-address=no
If any additional information required, I'll be happy to provide it.
|
So I figured out that somehow issue was behind mac dual-boot system.
My build was like this: MAC OS on main SSD and Debian 10 on external SSD.
From time to time I was booting between MAC OS and DEB, and it affects the network card on Debian site.
Not sure how to fix it, so I uninstalled MAC OS from main SSD and install Deb there as well. As for now I have no issues with networking (i've reinstalled all drivers, with no MAC OS on main SSD that solve an issue for me)
| I'm not able to connect to wifi on Debian 10 |
1,475,223,652,000 |
Since debian is a second OS on a dual booted mac, there is always problems with Wi-Fi. On this decice, my driver is BCM43224, which is supported by the Broadcom Wl driver. Upon installation, the Wi-Fi worked perfectly for half a day.
However then, the power cable got disconnected and the mac shutdown forcefully. There was seemingly no data corruption as I could run normally, but the Wi-Fi stopped working once again.
The lsmod command shows wl and a driver that wl uses, and the lines say:
Module Size Used by
wl 6299053 0
cfg80211 405538 1 wl
I also noticed that the wlan0 interface has suddenly disappeared.
I tried removing, and re-adding with modprobe, without success, even upon restarting. How can I fix this problem with Wi-Fi?
Debian 8 (Jessie) KDE, on a Mac Mini.
|
Ostensibly, the problem got fixed by restoring /etc/network/interfaces back to default. I added a wlan0 in there earlier as it wasnt there before, but wlan0 now also shows in ifconfig
| Problems with Wi-Fi on Debian |
1,478,650,619,000 |
It seems like every application from the terminal gives warnings and error messages, even though it appears to run fine.
Emacs:
** (emacs:5004): WARNING **: Couldn't connect to accessibility bus:
Failed to connect to socket /tmp/dbus-xxfluS2Izg: Connection refused
Evince:
** (evince:5052): WARNING **: Couldn't connect to accessibility bus:
Failed to connect to socket /tmp/dbus-xxfluS2Izg: Connection refused
(evince:4985): Gtk-CRITICAL **: gtk_widget_show: assertion
'GTK_IS_WIDGET (widget)' failed
(evince:4985): Gtk-CRITICAL **: gtk_widget_show: assertion
'GTK_IS_WIDGET (widget)' failed
Firefox:
(process:5059): GLib-CRITICAL **: g_slice_set_config: assertion
'sys_page_size == 0' failed
The list goes on. Is this behavior common or is there something wrong with my system? How I fix these issues?
|
Unfortunately, GTK libraries (used in particular by GNOME) tend to emit a lot of scary-looking messages. Sometimes these messages indicate potential bugs, sometimes they're totally spurious, and it's impossible to tell which is which without delving deep into the code. As an end user, you can't do anything about it. You can report those as bugs (even if the program otherwise behaves correctly, emitting spurious error messages is a bug), but when the program is basically working, these bugs are understandably treated as very low priority.
The accessibility warning is a known bug with an easy workaround if you don't use any accessibility feature:
export NO_AT_BRIDGE=1
In my experience, Gtk-CRITICAL bugs are completely spurious; while they do indicate a programming error somewhere, they shouldn't be reported to end-users, only to the developer who wrote the program (or the underlying library — often the developer of the program itself can't do anything about it because it's a bug in a library that's called by a library that's called by a library that's used in the program).
| X applications warn "Couldn't connect to accessibility bus:" on stderr |
1,478,650,619,000 |
Since this bug affects so many platforms, we might learn something from the process by which this vulnerability was found: was it an εὕρηκα (eureka) moment or the result of a security check?
Since we know Stéphane found the Shellshock bug, and others may know the process as well, we would be interested in the story of how he came to find the bug.
|
To reassure a few, I didn't find the bug by observing exploits, I have
no reason to believe it's been exploited before being disclosed
(though of course I can't rule it out). I did not find it by
looking at bash's code either.
I can't say I remember exactly my train of thoughts at the time.
That more or less came from some reflection on some behaviours of
some software I find dangerous (the behaviours, not the
software). The kind of behaviour that makes you think: that
doesn't sound like a good idea.
In this case, I was reflecting on the common configuration of
ssh that allows passing environment variables unsanitised from
the client provided their name starts with LC_. The idea is so
that people can keep using their own language when sshing into
other machines. A good idea until you start to consider
how complex localisation handling is especially when UTF-8 is
brought into the equation (and seeing how badly it's handled by
many applications).
Back in July 2014, I had already reported a vulnerability in
glibc localisation handling which combined with that sshd
config, and two other dangerous behaviours of the bash shell
allowed (authenticated) attackers to hack into git servers
provided they were able to upload files there and bash was
used as the login shell of the git unix user (CVE-2014-0475).
I was thinking it was probably a bad idea to use bash as the login
shell of users offering services over ssh, given that it's quite
a complex shell (when all you need is just parsing a very simple command line) and has inherited most of the misdesigns of ksh.
Since I had already identified a few problems with bash being
used in that context (to interpret ssh ForceCommands), I was
wondering if there were potentially more there.
AcceptEnv LC_* allows any variable whose name starts
with LC_ and I had the vague recollection that bash exported
functions (a dangerous albeit at time useful feature) were
using environment variables whose name was something like
myfunction() and was wondering if there was not something
interesting to look at there.
I was about to dismiss it on the ground that the worst thing one
could do would be to redefine a command called LC_something
which could not really be a problem as those are not existing
command names, but then I started to wonder how bash
imported those environment variables.
What if the variables were called LC_foo;echo test; f() for instance? So I decided to have a closer look.
A:
$ env -i bash -c 'zzz() { :;}; export -f zzz; env'
[...]
zzz=() { :
}
revealed that my recollection was wrong in that the variables
were not called myfunction() but myfunction (and it's the
value that starts with ()).
And a quick test:
$ env 'true;echo test; f=() { :;}' bash -c :
test
bash: error importing function definition for `true;echo test; f'
confirmed my suspicion that the variable name was not sanitized,
and the code was evaluated upon startup.
Worse, a lot worse, the value was not sanitized either:
$ env 'foo=() { :;}; echo test' bash -c :
test
That meant that any environment variable could be a vector.
That's when I realised the extent of the problem, confirmed that it was
exploitable over HTTP as well (HTTP_xxx/QUERYSTRING... env vars), other ones like mail processing services, later DHCP (and probably a long list) and
reported it (carefully).
| How was the Shellshock Bash vulnerability found? |