date int64 1,220B 1,719B | question_description stringlengths 28 29.9k | accepted_answer stringlengths 12 26.4k | question_title stringlengths 14 159 |
|---|---|---|---|
1,509,513,280,000 |
I just installed Mint 16 and I see that root user is not available at login screen. I log in from normal user and went to "Login Window" option and there I set "Allow root login". Then I restarted the PC and still I don't see root user in login window.
I also did the below but it also didn't work.
sudo passwd root
sud... |
Linux Mint 16 uses the Mint-X theme by default which only displays the password box for chosen non-root users. In order to enable the User entry field (from which you will be able to specify root) do this. From Menu ==> Administration ==> Login Window ==> Theme choose Clouds and logout.
| Enable root login from GUI |
1,509,513,280,000 |
To meet my security needs I set up quite long user password on my notebook. But when I am at home or other secure location, typing it down is cumbersome.
It would be nice to let the gdm (or: mdm, since I am using Mint 13 with Mate) search for a specific file (on a pendrive), and when it is present, treat is as a secu... |
You want to use pam_usb.
Read more here:
http://pamusb.org/
| Mint 13: Is it possible to skip standard login password dialog in presence of a pendrive with the key |
1,509,513,280,000 |
I've edited /etc/gdm/custom.conf to show the following:
[daemon]
AutomaticLoginEnable=true
AutomaticLogin=username
Where username is obviously the username I'd like to automatically log into.
I don't know if it matters or not, but I do have multiple users. In mind this should not matter, however, since we're specifyi... |
I'm not an expert in this but I would suggest first to make sure gdm is actually your current display manager and that you're using the correct file: check the output of cat /etc/sysconfig/desktop and take a look if there are other .conf files in /etc/gdm/. Maybe trying renaming the file to gdm.conf.
Also, did you tr... | Automatic login still doesn't work after editing custom.conf |
1,509,513,280,000 |
I have always used text+console boot without graphic interface. This includes the login, that is also text only since I do some sync stuff at login time, specifically on tty1 where I have an autologin script, that executes the following command through the file /etc/systemd/system/[email protected]/override.conf:
/usr... |
That cannot get controlling tty: Operation not permitted error by agetty is returned by agetty when the TIOCSCTTY ioctl() it makes so the terminal device becomes the controlling terminal of agetty's session fails.
It issues that ioctl() if the terminal currently doesn't control any session, or if it controls a session... | Text boot without text console: agetty problem in Fedora 36 |
1,509,513,280,000 |
I configured AutoLogin on my Linux Mint Mate system because I am using it as a small home server for file sharing, etc. And some app don't work well if the user is not logged in. But I don't want the system to be unprotected, someone can access it if it logins automatically. So how to AutoLock immediately after AutoLo... |
Answering my own question:
I was trying some commands on startup like:
mate-screensaver-command -l
but it was not working as mate-screensaver could not be running yet
So I tried:
mate-screensaver
sleep 1
mate-screensaver-command -l
but with no success either, so I discovered that the problem was that on starting the ... | How to AutoLock after AutoLogin |
1,509,513,280,000 |
I am thinking about doing an Ubuntu installation with their mini ISO, which comes only with the barebones system without a desktop environment/GUI.
I remember being given the option to set up automatic login when doing a full Ubuntu desktop installation, but how to I enable that for the mini ISO install? Did I miss so... |
You might find some ideas in this thread of linuxquestions.org
| Auto login for Ubuntu (or other Linux) without GUI? |
1,509,513,280,000 |
I could use some help with what I think is a basic request on the newest edition of Linux Mint (which I think would also be applicable to Ubuntu).
I have a home system with 3GB of RAM and accounts for family members (4 of them). As the initial login process takes 15-20 seconds and kids are impatient, I'd like a way to... |
Assuming you already have one user that auto-logs in, you can probably use a script that runs after logging in (use gnome-session-properties) that:
gets a list of users to auto-login from some file
checks for each of those users if they are logged in yet
if one is not, use xdotool to switch to the first user (by sim... | Auto-start multiple background user sessions in Linux Mint |
1,509,513,280,000 |
I have Linux Mint 14 Xfce (4.10) and have also installed LXDE desktop, so I can choose between these sessions if I want. Normally I would set one as default and at startup I am not asked for username&password and am logged in automatically as intended.
(Under Settings/Login Window/Security - "Enable automatic login" i... |
Trying many possible combinations of settings I solved it but the conclusion is that there is something amiss with Xfce's session manager settings or GUI.
What I have verified is:
As stated in the question, when this problem happens, under Settings/Login Window/Security - "Enable automatic login" is checked, like so:... | How to enter/choose session after logout without password in (Linux Mint) Xfce? |
1,509,513,280,000 |
When I opened wireshark (fresh install of live usb kali with persistence) for the first time it complained about me being root. This is what I found in googling it:
Yes it's recommended and advisable not to run such tools in super user or high permission account. Giving root to such tools can go sideways should the t... |
There are a few different important points here. But the first one is, Kali is not a good first Linux distribution to start off with. If you're not familiar with account permissions, and especially if you don't want to use the command line, then Kali isn't right for you. I'd recommend Ubuntu instead. Anything you can ... | Kali Linux Can't Log in as non-root user and wireshark complaining about root |
1,509,513,280,000 |
Question 1
On Centos 6.5, I have a username called admin. How can I make it so the system logs in automatically?
Question 2
How can I configure system to login as root user when there are other users on the system?
Please don't bother me with security risks as this is a testbed station. There is no sensitive informa... |
For Question 1:
Just edit /etc/gdm/custom.conf with your favorite editor. Then, under the [daemon] section, add 2 lines so it looks like the code below (change username to the username you want to use):
[daemon]
AutomaticLoginEnable=true
AutomaticLogin=username
| How do I remove login password for Centos6.5? |
1,509,513,280,000 |
Running ubuntu server, I've reconfigured /lib/systemd/system/[email protected] to
[Service]
# the VT is cleared by TTYVTDisallocate
# ##ADDED THIS HERE##
ExecStart=-/sbin/agetty -a diagnosticuser --noclear %I $TERM
Type=idle
Restart=always
RestartSec=0
UtmpIdentifier=%I
TTYPath=/dev/%I
TTYReset=... |
Create a new file for terminal 1 '/lib/systemd/system/[email protected]' and copy into it the config you defined above.
In /lib/systemd/system/[email protected] use the following:
ExecStart=-/sbin/agetty --noclear %I $TERM
Console 1 will autologin as diagnosticuser all other consoles will prompt for credentials.
| How to configure agetty to autologon on only one terminal |
1,509,513,280,000 |
I was trying to setup tty auto login for FreeBSD, I copied the P|Pc|Pc part and made a change:
Pcal console:\
:al=root:ht:np:sp#9600
And modify the tty for ttyv0:
ttyv0 "/usr/libexec/getty Pcal" xterm on secure
But now if I do init q, I get:
|
Try changing:
Pcal|Pcal console:\
:al=root:ht:np:sp#9600
ttyv0 "/usr/libexec/getty Pcal" xterm on secure
Now Pcal will be the gettytab entry. | is used as a separator. This to enter alternative names (not sure about that I'm not a gettytab expert ;) ). The last entry until :\ looks like a "human readable"... | Setting up tty autologin on FreeBSD |
1,498,678,510,000 |
I've been troubleshooting an issue with a sysVinit service not coming online properly at boot within a systemd environment. What I've found is that when no service file or overrides are present in /etc/systemd/system/ for the said service, it autostarts properly. In this case, as I understand it, systemd should be d... |
I've now found that the issue was that the service file automatically generated by systemd-sysv-generator lacks an install section with a WantedBy option. I added the following to my generated file at /etc/systemd/system/programexample.service which allowed me to properly enable the service:
[Install]
WantedBy = mul... | init service failing to enable once a systemd service file is generated |
1,498,678,510,000 |
I installed telegram-desktop via Flatpak and would like to auto start the messenger when logging into Gnome 3 (or Unity as a fact). Is there a way to robustly do so?
|
Starting from the answer given by @intika I found a solution I like more.
Instead of replicating the content of the existing desktop-file in /var/lib/flatpak/exports/share/applications/org.telegram.desktop.desktop I linked it inside my personal ~/.config/autostart/. Works like a charm :-)
| How to add a Flatpak's app to Gnome 3 auto-starts? |
1,498,678,510,000 |
These don't work: sudo update-rc.d kdeconnectd disable sudo systemctl disable kdeconnectd.service
There is no script for it in /etc/init.d/ and the /usr/share/dbus-1/services/org.kde.kdeconnect.service file only has Exec=/usr/lib/x86_64-linux-gnu/libexec/kdeconnectd set
sysv-rc-conf, rcconf and bum don't list kdeconne... |
I have had the same problem, I have solved it by deleting two files: "/usr/share/dbus-1/services/org.kde.kdeconnect.service" and "/etc/xdg/autostart/org.kde.kdeconnect.daemon.desktop". I don't know if it's the proper way to fix it, but it worked for me.
| How to prevent kdeconnectd from starting automatically? |
1,498,678,510,000 |
I am using an embedded linux with busybox. I would like to automatically run my app called "myApplication" (runlevel 5 after boot all the services are up).
What I have done so far:
I made a script under /etc/init.d/ called S90myscript
Then I added this line to the inittab:
::sysinit:/etc/init.d/S90myscript
The scri... |
Found the solution.
I placed myApplication in /usr/sbin/
Created a symlink named myApp to the script located in /etc/init.d/S99myAppScript
(notice that there is no .sh and I had to run sudo chmod 755 on this script)
Added the following line at the end of rcS file located in /etc/init.d/ just before the command done:
... | How to Autorun a program using busybox after boot? |
1,498,678,510,000 |
In XFCE4, there is a list of items to be started when an XFCE4-session is started
(XFCE4 Settings xfce4-settings-manager → Tab "Application Autostart"):
I'm wondering where this list is stored.
In ~/.config/autostart I have three .desktop files, which are available in the aforementioned list, but there are many more ... |
The entries you see are populated from:
~/.config/autostart (user-specific)
and
/etc/xdg/autostart/ (system-wide)
If you want to disable something from the second system-wide location, you create the appropriate entry to your start-up directory with this content:
[Desktop Entry]
Hidden=true
E.g. I have /etc/xdg/autos... | XFCE4 - Session and Startup: where are autostart items saved? |
1,498,678,510,000 |
I have a PC for routing purposes, it has 2 network interfaces and runs Debian. I want to add a sound to it, to signal that it is booted and okay.
So I've created some /etc/init.s/beep-startup script, according to top-secret LSByization manual (cannot stop laugning of its naming, sorry), which (along with hundreds of L... |
Excellent solution here.
Solution 1:
Create an @reboot entry in your crontab to run a script called /usr/local/bin/runonce.
Create a directory structure called /etc/local/runonce.d/ran using mkdir -p.
Create the script /usr/local/bin/runonce as follows:
#!/bin/sh
for file in /etc/local/runonce.d/*
do
if [ ! -... | How to run script at start when everything is up and running? |
1,498,678,510,000 |
There is an application, Zoom, which depends on software known as ibus. After installation, ibus likes to autostart. I don't want ibus to autostart. I've removed autostart files that start im-daemon from ~/.config/autostart and /etc/xdg/autostart, but the application still starts. I've searched for systemd services an... |
I am assuming you are talking about the Zoom Meeting application.
I ran the command
strace -o debug.txt -e trace=file -f ./ZoomLauncher
This showed at one point to run libibusplatforminputcontextplugin.so which is part of the zoom package. To guess what is happening without a full deep dive into the product I ... | Disable autostart of ibus on login |
1,498,678,510,000 |
I've got a problem:
A while ago, I installed a piece of software called wii-u-gc-adapter, and when I run it, I can plug my GameCube controller in to my Linux machine desktop computer to play games. This works great.
I must have taken some advice at some point in time to put somewhere in my computer an instruction to r... |
Solution:
Find process name in pstree
Find process in htop, get PID from there
Use command ~$ ps j [PID] to find the PID of the parent process
If the PID is 1, then it is being started by systemd
If it is started by systemd, use this answer along with the information you got from step 1 and step 2 to totally remove t... | What's causing a process to start at startup? |
1,498,678,510,000 |
CentOS 7.x with GNOME 3 Shell by default provides the following *.desktop files under /etc/xdg/autostart/ with AutostartCondition key:
# gnome-welcome-tour.desktop
[Desktop Entry]
Type=Application
Name=Welcome
Exec=/usr/libexec/gnome-welcome-tour
AutostartCondition=if-exists run-welcome-tour
OnlyShowIn=GNOME;
NoDispla... |
The session manager reads the .desktop files of all the start-up apps. If if finds an AutostartCondition key in any of those files, it checks its value: if the condition is not met, that particular app is removed from the list of start-up apps. The autostart conditions are described in a very old post on freedesktop m... | Understanding AutostartCondition key in .desktop files |
1,498,678,510,000 |
Which program runs $XDG_CONFIG_HOME/autostart in Debian 9?
I tried putting the following .desktop file in $XDG_CONFIG_HOME/autostart:
[Desktop Entry]
Type=Application
Name=test
Comment=test
NoDisplay=true
Exec=sh -c 'cat /proc/$$/status >~/test_output'
NotShowIn=GNOME;KDE;XFCE;
Its PPID is 1 (systemd),but I can't fin... |
This is handled by desktop environments which implement the Desktop Application Autostart Specification. If you’re using the default desktop environment in Debian 9, GNOME, autostart applications are started by gnome-session.
I imagine the fact that your process ends up with systemd as its parent is because its origin... | Which program runs $XDG_CONFIG_HOME/autostart in Debian 9? |
1,498,678,510,000 |
I'm using Telegram Desktop on Debian 8.7. It starts automatically even though I've not created any .desktop file under ~/.kde/Autostart. It's quite annoying as I don't want its window to show up maximised but I'd rather start it with the --startintray flag.
I've also tried to create the .desktop file under the Autosta... |
I fixed it! KDE was saving the session upon shutdown and restoring it upon startup, thus reopening all programs.
I disabled it under Startup and Workspace > Startup and Shutdown > Desktop Session > On Login > Start with an empty session. (Restore previous session was the default)
| How can I prevent Telegram from starting automatically on Debian 8.7 Jessie? |
1,498,678,510,000 |
I'm using a beaglebone black which works with Debian 8.6. I want to start a program after reboot. I tried crontab but it didn't work.
@reboot sleep 60 && /home/debian/acspilot/start.sh
Program consists of a config.sh file and a acsp.py python script. Each code works fine from terminal. Here are the codes:
start.sh:
... |
The script has a sudo'ed line, and if it is cronned to a non-root user, the shell cannot be executed by itself. Instead you should first be root with
sudo su -
And then
crontab -e
as root user and add the task line
| Run shell script after reboot in beaglebone black |
1,498,678,510,000 |
I am on Ubuntu 18.04 and trying swap Ctrl and CapsLock using xmodmap. But failed to find a way of doing that automatically: .[X|x]modmap[rc] and .config/autostart didn't work. What other ways are there? Could it be possible throgh systemd?
SHORT:
Desktop entry in .config/autostart or /etc/xdg/autostart. Exec is not a ... |
Since Ubuntu switched back from Unity to Gnome in version 17.10, you should be able to use the Gnome autostart mechanism (if it is sufficient that the shell command is launched on login).
To do so:
you will need sudo privileges
create a shell script that runs the necessary command (say switch_ctrl_capslock.sh) and pl... | Run shell command exectly one time at login |
1,498,678,510,000 |
I am trying a Slackware 14.2. I can start sshd by /etc/rc.d/rc.inet1 sshd start but my question is how to add service to run at boot on slackware linux? Basically how to permanently add services to system on Slackware Linux and also check that service status. So far I am able to achieve the above using this link,
$ su... |
Slackware use the BSD-style init system. sshd daemon is handled on boot with rc.inet2 script and is handled on shutdown with rc.0 and rc.6 on reboot.
To start sshd daemon on boot add execute permission to rc.sshd script:
chmod +x /etc/rc.d/rc.sshd
To disable sshd on boot remove execute permission:
chmod -x /etc/rc.d/... | How to add service to run at boot on slackware linux? |
1,498,678,510,000 |
I saw How to manage startup applications in Debian 9?
At that time, gnome-tweak-tool was the go-to-tool however, since a few days, that app. is not there anymore.
I am running on Debian buster.
https://tracker.debian.org/pkg/gnome-tweak-tool. See the news section and specifically https://tracker.debian.org/news/9319... |
To figure out what happened to a package, you need to look at the removal reason from unstable, not testing. In gnome-tweak-tool’s case, this is given as “RoM; source package has been renamed to gnome-tweaks”, and true enough, there is now a gnome-tweaks source package, which builds a gnome-tweaks binary package and a... | Managing startup applications in debian buster 10 (mate) |
1,498,678,510,000 |
I'm following the answer of Autostarting .desktop application at startup not working, and it is working well. I'm launching a python script. The .desktop application looks like this:
[Desktop Entry]
Type=Application
Name=Autostart Script
Exec=shutdown_notify.py
Icon=system-run
This is working well - but if I log ou... |
This is because KillUserProcesses is no by default in Ubuntu. This setting causes user processes not to be killed when the user completely logs out. To change this behavior in order to have all user processes killed on the user's logout, set KillUserProcesses=yes in /etc/systemd/logind.conf and re-login.
current value... | Autostarted .desktop application doesn't exit on log out |
1,498,678,510,000 |
I'm using Ubuntu Mate with XMonad. I can't seem to understand how to run something at startup after the login.
I want some programs like Firefox to run when I login to my desktop.
Now let's say I just want to run a simple script:
/home/juser/.xmonad/autostart.sh
The file is set as executable.
I've tried many things. ... |
The line exec xmonad in your shell script replaces the shell running the script with the xmonad process. So there's nobody left to run the next line. Type help exec in a bash shell, or see bash(1).
You probably want to rewite the last two lines as
/home/juser/.xmonad/autostart.sh &
exec xmonad
if none of the autost... | Ubuntu with Xmonad - How to run programs on startup |
1,498,678,510,000 |
On i3 start up I'd like HexChat to automatically start in my fifth workspace.
I know how to edit my config (~/.i3/config) to start HexChat on i3 start up, namely by adding exec hexchat line to it, but that starts it in my first workspace, when I want it started in my fifth workspace (i.e. $workspace5 in my i3 config)... |
You need to find some criteria that matches your window, then you can configure a workspace for it. I don't know HexChat, so here is an example for xclock. If you run this well-know X11 application, then run xprop and click on the clock window you will get output showing you the window class is XClock:
WM_CLASS(STRIN... | How do I get HexChat to start on i3 login in its own workspace (but not in workspace 1)? |
1,498,678,510,000 |
I came across the messages below with sudo journalctl --since today | tail -n 3000. Shouldn't autostart entries be removed from there when removing a package?
It seems like general good practice to remove autostart entries if the package has been removed (or to prompt the user about it during removal or to remove them... |
These files are treated as configuration files, and are only removed on package purge, not package removal.
apt list '~c'
will list packages which have been removed but not purged (including potentially some which dpkg still considered to be installed but which aren’t really).
sudo apt purge '~c'
will purge them, an... | Shouldn't files in /etc/xdg/autostart/ be removed when removing a package? |
1,498,678,510,000 |
I am trying to start a GUI application (python3 project) on application startup.
I've created a script in /etc/xdg/autostart/.
@lxpanel --profile LXDE
@pcmanfm --desktop --profile LXDE
@xscreensaver -no-splash
export DISPLAY=:0
@/usr/bin/python3 ~/path/to/the/file.py
I've also tried the following script in /home/deb... |
Found the solution here : Why does LXQT Autostart not do anything?
I updated the /home/debian/.config/autostart folder and created a new .desktop file with inputs:
[Desktop Entry]
Exec=sh script_name
Path=/full/path/to/working/directory
Name=MyAppName
Type=Application
Version=1.0
| Autostarting a python GUI application on startup as local user (beagle bone black) |
1,498,678,510,000 |
I'm trying to configure the Autoexec section of Dosbox. I downloaded DOSBOX for Windows and I added these lines :
[autoexec]
# Lines in this section will be run at startup.
# You can put your MOUNT lines here.
MOUNT C C:\DOSGAMES\
C:
I saved and ran Dosbox.exe, it worked !
I'm doing the same thing for Dosbox in Fed... |
The .dosbox folder was hidden by design.
Each user have its own default config file in ~/.dosbox/dosbox.conf . For root, go in /root/ and do Ctrl+H , and hidden folders will appear.
You can choose other config files with the corresponding flag, so make sure to configure the right dosbox.conf file.
| AUTOEXEC Configuration for DOSBOX doesn't work (Works on Windows) |
1,498,678,510,000 |
I want to access the screensaver state of ubuntu (when my laptop is idle for some minute) . And run an application if screensaver start and if I click or stir mouse pad then application should exit as screensaver exit.
After searching on google I come to a command
xssstate -i
But I don't know what it does and Ho... |
You can use xssstate -s to check out screensaver's status:
$ xssstate -s
off
then based on the output decide what you have to do.
-i returns X's idle time.
You can create a simple script and run it using cron then on that script use xssstate to see if you have to run or end your program.
| Use of command "xssstate " in ubuntu? |
1,498,678,510,000 |
I have a bash script, called runthunderbird, that… runs thunderbird :
#!/bin/bash
sleep 5
thunderbird & disown
When I execute runthunderbird from krunner, Thunderbird starts after 5 seconds as intended, then the runthunderbird process ends, as evidenced by ps -ef or the process list in the System monitor from Plasma ... |
It's managed via cgroups and systemd. (That is, I'm 95% sure it's managed via cgroups and systemd, although I don't have KDE installed here to confirm.)
Recently, both GNOME and KDE have begun using systemd's support for on-the-fly creation of .services and .scopes for launching desktop apps if the user-level systemd ... | How are "Applications" run with krunner managed wrt processes? |
1,689,350,565,000 |
I am running the latest version of Debian on an Intel NUC and I've setup PM2 autostart at boot with
pm2 startup
For my needs I need to delay its start by let's say 30 seconds.
How to do that please?
|
You've probably figured this out by now, but for others who come here the answer is quite simple.
You just open your shell script file, which is the one that the PM script runs upon start.
In here you simply put in a "sleep", for the 30 seconds simply write
sleep 30s
at the top of your .sh file.
I used this to op... | How to delay PM2 autostart at boot? |
1,689,350,565,000 |
I have compiled my code in this path : /home/m/ChatScript-master/SRC and created executable file myapp .
I can run it from inside the SRC folder like ./myapp. But when I try /home/m/ChatScript-master/SRC/myapp from my /home/m it gives me:
in cs_init.txt at 0:
Error opening utf8writeappend file LOGS/startlog.tx... |
Your program uses a relative path from the current working directory to access LOGS/startlog.txt. If there is no LOGS directory in the current directory, the application fails.
To correct this, make sure that the application uses an absolute path for accessing the file, or change the working directory as you start th... | I get error when I want to execute my program from /home |
1,689,350,565,000 |
I'm talking about the autostart scripts placed in ~/.config/autostart. I know that systemd-xdg-autostart-generator creates .service files for them. So where do i find the generated files so that i can check their status using systemctl status foo.service
|
You can find the generated entries at $XDG_RUNTIME_DIR/systemd/generator.late
to check the status
systemctl status --user foo.service
| Check status of systemd autostart scrips |
1,689,350,565,000 |
I'm thinking of developing an application to watch changes for auto starting applications and service that would notify when:
A service state change (enabled/disabled/added/removed)
An application is added/removed to boot
Eventually revert the change
Auto start location to be watched:
Systemd services
Systemd t... |
Startup-Watcher
Ended up writing it from scratch...
Watch for changes on 32 locations
Notify when change occur
Save change to /home/../.startup-watcher/changes
Start hidden on the tray
Root not required
Watch root and user
And much more.
Captures
https://github.com/Intika-Linux-Apps/Startup-Watcher
| Is there an application to watch changes in auto starting apps and services? |
1,689,350,565,000 |
I did try to initialize a dummy interface in shell manually without no problem. In order to bring up this interface at every boot up process, then i tried to add it to /etc/bashrc or /etc/profile as below:
ip link set name eth0 dev dummy0
ip link set eth0 address d0:17:c2:a9:a5:5e
ifconfig eth0 hw ether d0:17:c2:a9:a5... |
In most of the distros the answer for executing commands at the boot is /etc/rc.local (today this includes redhat and new versions of debian, but you need to create the rc.local file first). So create a script as /etc/rc.local (if it does not exists - if it is already there, just include the lines before exit 0).
The ... | Why I cannot initialize dummy interface at bashrc? |
1,689,350,565,000 |
I have a local VM running on Ubuntu that, on start, I need to run two commands on (as my user, andreas):
sudo mount -a
docker-compose up -d
The last command is run in my home directory, and can't be run as root otherwise docker gives me grief. How do I run these two commands automatically when the machine loads, one... |
Run the script as root and use sudo's -u option to run the docker-compose as your user, and the -l option to make sure it's running in a login shell (i.e. the same environment you would have if you logged in[1]). e.g.
#!/bin/sh
mount -a
sudo -l -u yourusername docker compose up -d
alternatively, use su:
#!/bin/sh
... | Mount and Start Docker on Startup |
1,380,179,815,000 |
How can I reliably address different machines on my network?
I've always used the .local suffix to talk to computers on my local network before. With a new router, though, .local rarely (though sometimes) works. I've found that .home and .lan both usually work, but not always.
.-------. .--------. ... |
There are no RFCs that specify .lan and .home. Thus, it is up to the router's vendor what pseudo TLDs (top-level-domain names) are by default configured.
For example my router vendor (AVM) seems to use .fritz.box by default.
.local is used by mDNS (multicast DNS), a protocol engineered by Apple. Using example.local on... | What's the difference between .local, .home, and .lan? |
1,380,179,815,000 |
Running a server machine with CentOS 7, I've noticed that the avahi service is running by default.
I am kind of wondering what the purpose of it is.
One thing it seems to do (in my environment) is randomly disabling IPv6 connectivity, which looks like this in the logs:
Oct 20 12:23:29 example.org
avahi-daemon[779]:... |
Avahi is the opensource implementation of Bonjour/Zeroconf.
excerpt - http://avahi.org/
Avahi is a system which facilitates service discovery on a local
network via the mDNS/DNS-SD protocol suite. This enables you to plug
your laptop or computer into a network and instantly be able to view
other people who you ... | What is the purpose of avahi on a RHEL 7 server? |
1,380,179,815,000 |
I'm currently working on a project that has required some DNS troubleshooting. However I am fairly new to the wonderful world of networking and I'm at a bit of a loss as to where to begin.
My specific problem probably belongs on the Raspberry Pi Stack Exchange, so I'll avoid crossposting. Just looking for information ... |
When you run a command such as ping foobar the system needs to work out how to convert foobar to an ip address.
Typically the first place it looks is /etc/nsswitch.conf.
This might have a line such as:
hosts: files dns mdns4
This tells the lookup routine to first look in "files", which is /etc/hosts. If tha... | What is the difference between resolvconf, systemd-resolve, and avahi? |
1,380,179,815,000 |
What I would like is to use avahi-daemon to multicast more then one name. So that I could connect to it with domainA.local domainB.local.
I could then reroute these addresses to a different web interface of different applications with nginx.
Is it possible to configure the avahi-daemon in such a way that it would mult... |
A cumbersome solution would be running several instances of the following command in background:
avahi-publish -a -R whatever.local 192.168.123.1
A better solution is probably publishing cnames using python-avahi. See e.g. https://github.com/airtonix/avahi-aliases or http://www.avahi.org/wiki/Examples/PythonPublishAl... | Multicasting multiple mdns names |
1,380,179,815,000 |
I am running Kali 2.0 64-bit, and I recently noticed that avahi-daemon is starting at boot time, listening on several udp ports.
How do I disable it completely, without purging the package itself?
I have tried
sudo rcconf --off avahi-daemon
But there is a warning:
Service 'avahi-daemon' is already off. Skippi... |
sudo systemctl disable avahi-daemon to disable boot time startup.
A few other options are systemctl list-units for a list of all known units, systemctl enable to enable boot time startup, systemctl start to start the service from terminal, but not enable boot time loading and systemctl stop to stop a service which has... | How to disable avahi-daemon without uninstalling it |
1,380,179,815,000 |
I have a Ubuntu 16.04 based HTPC/Media Server that's running 24/7. As far as I can remember using an official Ubuntu distro, I've always had issues with the avahi-daemon. The issue is pretty often discussed online. Some people decide to just delete daemon, however, I actually need it as I'm running a CUPS server and u... |
So I tried to change the "host-name" parameter in "avahi-daemon.conf" to something that's not the machines hostname, and I've been running 2 weeks without any issues.
Maybe this had to do with the machine also running samba and Windows using the ".local" domain for it's own purposes?
| avahi-daemon and ".local" domain issues |
1,380,179,815,000 |
So far, I have avahi-daemon running on all my Ubuntu machines, partly because it is installed by default. The router I used to have was quite dumb and did not really do anything except DHCP and DHCPv6. I could access the other Linux computers with hostname.local which worked fine for my purposes.
Now I have an AVM FRI... |
The FritzBox home router is using DHCP requests to update the FritzBox's DNS forwarding. Specifically: if there is a hostname option provided in the DHCP request then a hostname.fritz.box DNS record is provided by the FritzBox's DNS forwarding.
This is distinct from mDNS's .local domain. The FritzBox is not a mDNS pro... | `.fritz.box` and `.local` hostnames in the same network: Which do I really need? |
1,380,179,815,000 |
I just set up my new Pi2 with Raspbian. All works well, I installed avahi, so that I can reach the Pi via raspberrypi.local. However, the Pi does not find my MacBook, which is usually resolvable via mymacbook.local. For example, this is what I get when pinging:
raspberrypi $ ping mymacbook.local
ping: unknown host mym... |
What you are trying to do is to add multicast DNS to the name searching on Raspbian.
Install the package libnss-mdns (ie: sudo apt-get install libnss-mdns). This will pull in the Avahi packages to implement multicast DNS (which is used for name resolution for ".local" domains).
After installation ensure that /etc/nssw... | How to search .local? |
1,380,179,815,000 |
I have avahi-daemon running on a Debian 9.1 server; however, avahi-browse -a does not display any services in my home network, consisting of a single 192.168.178.0/24 network.
I can access all clients (tested with ping and, where applicable, ssh) and
server# tcpdump port 5353
gives quite a bit of output from my clien... |
avahi-browse requires the libnss-mdns package and the /etc/nsswitch.conf must have in its hosts: line two entries mdns mdns4 appended, i.e.
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 mdns
I also added multicast to the interface by first installing net-tools to get ifconfig and then running
server$ ifconf... | avahi-browse -a does not show any results |
1,380,179,815,000 |
I work in a large office building with hundreds of other computers on the same LAN. I don't have any reason to communicate with most of these computers, and when I do, it's always on an "opt-in" basis (like adding a network mount to my fstab). But Linux Mint is automatically adding printers throughout the building, an... |
Stop the CUPS service (embodied by a process called cupsd), for example
sudo service cups stop
Open /etc/cups/cupsd.conf in your favorite editor, for example
sudo vim /etc/cups/cupsd.conf
Look if there is a line in this file saying
Browsing Yes
and change this line to
Browsing No
This should dis... | How can I limit engagement with a large office LAN? |
1,380,179,815,000 |
How can a computer running avahi ascertain and display its OWN hostname in the event that it is dynamically changed to foo-2, foo-3, etc due to hostname conflicts with other devices on the network?
When two computers (both with hostname = foo) that are running avahi-daemon and are on the same networks, as expected the... |
Run:
avahi-resolve -a <IP> | cut -f 2
This will return a list of hostnames (one per-line) registered on mDNS for the IP address you passed in. If you pass in your own local IP, it will return what you have registered. Under normal circumstances, it should return exactly one line with your local host name (or whatev... | when using avahi, how can a host know if it's name is hostname.local or hostname-2.local |
1,380,179,815,000 |
From time to time, Avahi takes 100% CPU and CUPS-browse delays the system shutdown with the message "a stop job is running for make remote cups printers available locally".
I know Avahi finds printers, as Xfce shows me 16 printers. I also know I don't need 16 printers. On the other hand, I'm not sure what cups-browsed... |
Given your use case, you don’t need either package, and you don’t need to replace them with anything — CUPS on its own will be able to provide access to your network printer.
cups-browsed is the CUPS component which finds printers on your network, by interpreting Bonjour broadcasts. Since you don’t need to automatical... | Is it advisable to remove Avahi and CUPS-browse? |
1,380,179,815,000 |
At the startup I work, we're setting up a device for image capturing and analysis. It's a box with a camera, with Ubuntu Linux embedded, and, let's assume, we don't want to connect a monitor to this device for configuration.
Some guys came with the solution of having a configuration webpage when connecting the device ... |
The best way to do this is with avahi which implements multicast-dns (this is what Apple calls Bonjour).
I would disable Network Manager and go with configuring networking in /etc/network/interfaces. The interfaces file supports the ipv4ll method, which uses avahi-autoipd to configure an interface with an IPv4 Link-La... | How to have a device's IP discovered in a network in a simple manner? |
1,380,179,815,000 |
I used to be able to ssh [email protected] between machines on my LAN but it is no longer working. I can ssh using the IP of course, but it's DHCP so it may change from time to time. Both machines run Debian 9.12, one is a VM in a Windows host, but still, it DID work ; I haven't fooled around with the config files, ju... |
Found it !
It seems that my router has a DNS server indeed :
nslookup host_ip router_ip
Server: 192.168.1.254
Address: 192.168.1.254#53
69.1.168.192.in-addr.arpa name = hostname.lan.
So that answers the .localvs .lanquestion. In recent Debian, the local domain is .lan.
Still, ping hostname.lan returns unkno... | Can't resolve hostname.local on LAN |
1,380,179,815,000 |
I have a Debian server on local network for home media center/NAS purposes. It is running multiple services such as Plex, or Ajenti, which I can access like so:
http://debian.local:32400/web for Plex
https://debian.local:8000/ for Ajenti
However I would like to access these services like so:
http://plex.local for Ple... |
So the way to do the thing you're directly asking is to add those hosts as aliases to /etc/avahi/hosts (which reads like /etc/hosts) so that those work and are advertised over zeroconf/avahi . The second thing would be to install a reverse proxy (using Apache or Nginx or something) to forward requests for those hosts ... | Advertising local HTTP services via Avahi/Zeroconf on Debian |
1,380,179,815,000 |
How can I test software that uses avahi while my laptop is disconnected from any router?
All of the services run on the same machine, so Avahi would be advertising an IP address of 127.0.0.1 for all of the services.
As an example, I am using a file at /etc/avahi/services/postgresql.service to register a database:
$ c... |
Avahi requires that the interface have the MULTICAST flag set. That is,
ifconfig dummy0 multicast
Once the MULTICAST flag is set, avahi will automatically advertise services on that interface, no need to restart or otherwise mess with avahi configuration unless the interface is disallowed in the avahi configuration.
| How can I use avahi without a network connection? |
1,380,179,815,000 |
I want to use avahi on a system with a read-only rootfs where /etc is not writable.
I can start avahi-daemon with the -f option to specify a non-standard location for the avahi-daemon.conf file (default location is /etc/avahi/avahi-daemon.conf). However I can't find any way to specify a non-standard location for the s... |
It seems that Avahi does not provide any configuration option for searching for service definitions in a non-standard location (other than rebuilding with a custom --prefix, but that obviously has other implications). In case someone else needs this, these are the options I've found:
Symlink /etc/avahi/services to a ... | Using a non-standard location for avahi services |
1,380,179,815,000 |
I am using Ubuntu 20.04. I have tried to stop and disable the avahi-daemon as below:
$ sudo systemctl stop avahi-daemon.service
$ sudo systemctl disable --now avahi-daemon.socket
$ sudo systemctl disable --now avahi-daemon.service
However, the service restarts after I reboot.
I would also like to stop cups service fr... |
systemctl disable works most of the time but to be sure, use systemctl mask.
What this does is to link the unit files to /dev/null which effectively causes any start operation or command to fail.
You can see more on this in the man page.
| Ubuntu 20.04: Permanently disable a service start at boot |
1,380,179,815,000 |
$ systemctl status avahi-daemon
● avahi-daemon.service - Avahi mDNS/DNS-SD Stack
Loaded: loaded (/usr/lib/systemd/system/avahi-daemon.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2018-05-08 08:01:52 BST; 8h ago
Main PID: 817 (avahi-daemon)
Status: "avahi-daemon 0.7 starting up... |
The source code for avahi-daemon source code includes several more status messages, e.g.
sd_notifyf(0, "STATUS=Server startup complete. Host name is %s. Local service cookie is %u.", avahi_server_get_host_name_fqdn(s), avahi_server_get_local_service_cookie(s));
However, by default avahi-daemon enters a secure chroot... | Why is the status message for avahi-daemon.service permanently "starting up"? |
1,380,179,815,000 |
I've installed KDE desktop, that depends on avahi. It has two daemons avahi-daemon and avahi-dnsconfd.
In ArchLinux wiki there is no info about avahi-dnsconfd. I've tried Daemon and Avahi pages.
|
Here's the description from debian's avahi-dnsconfd package:
Package: avahi-dnsconfd
Description-en: Avahi DNS configuration tool
Avahi is a fully LGPL framework for Multicast DNS Service Discovery.
It allows programs to publish and discover services and hosts
running on a local network with no specific configurati... | What does `avahi-dnsconfd` daemon? |
1,380,179,815,000 |
Suppose I have dynamically published a DNS-SD service using avahi-publish, as in
avahi-publish -s "My service" _myservic._tcp 1234
How can I un-publish it without restarting the Avahi daemon?
I want to make a service discoverable via Avahi/Bonjour, but stop advertising it if I shut the service down. I don't want to ... |
It appears I should have experimented more before asking the question. When you publish a service with avahi-publish, the process continues running in the foreground (the man pages don't mention this!) To un-publish, you terminate the avahi-publish process.
Previously, I had been using a static configuration with ser... | How to un-publish a DNS-SD service? |
1,380,179,815,000 |
I'm trying to connect to several computers via their hostnames since they get their IP via DHCP. I can successfully ping the machines via ping host-01.local.
ping, wget, avahi-resolve and even Firefox all send out the required mDNS packages, which I checked throug Wireshark (UDP on port 5353).
However ssh doesn't seem... |
For some reason I had the 32-bit version of ssh on my system. Installing the 64-bit version seems to have solved all of my problems.
After looking through the strace of the command I noticed ssh had failed trying to load a bunch of libraries. This baffled me at first because most of these libraries are installed on my... | SSH is unable to resolve local domain names |
1,380,179,815,000 |
systemd-networkd: Is it possible to configure default link-local address, which will be tried as the first one? Something like '--start=' parameter for avahi-autoipd.
|
As of systemd v252-stable you can do IPv4LLStartAddress=169.254.1.1 Something like
[Match]
Name=en* eth*
KernelCommandLine=!nfsroot
[Network]
DHCP=yes
LinkLocalAddressing=fallback
IPv4LLStartAddress=169.254.1.1
[DHCP]
RouteMetric=10
ClientIdentifier=mac
[DHCPv4]
MaxAttempts=3
Would allow for a network interface t... | systemd.networkd: how to set default link-local address? |
1,361,291,930,000 |
The man pages for badblocks do not seem to mention what the three numbers in the output mean in particular:
Pass completed, 7 bad blocks found (7/0/0 errors)
Pass completed, 120 bad blocks found (0/0/120 errors)
I'm guessing it's "Errors while reading/writing/comparing". Can someone enlighten me?
|
Your guess is correct.
The source code looks like this:
if (v_flag)
fprintf(stderr,
_("Pass completed, %u bad blocks found. (%d/%d/%d errors)\n"),
bb_count, num_read_errors, num_write_errors, num_corruption_errors);
So its read/write/corruption errors. And corruption means comparison with ... | How to interpret badblocks output |
1,361,291,930,000 |
I need to do a destructive (rw) test on a new drive, and a read-only on a drive that fell out of my RAID array. I want to see if it finds problems and how far along it is.
|
Let /dev/sda be the new drive on which to test destructive-rw and /dev/sdb the old drive where you want non-destructive-r
# badblocks -wsv /dev/sda
# badblocks -sv /dev/sdb
-s gives the process indicator
-v gives verbose output
-w enables destructive read-write
-n would be non-destructive read-write
Read-only testing... | How do you use badblocks? |
1,361,291,930,000 |
I'm running badblocks to check for bad segments on an external drive, and it's been about an hour and it has not yet finished. Now, I need to go and consider cancelling. Is this somehow risky? Should I avoid this?
Clearly, I will need to start again from scratch; I just want to know if this is somehow risky to abort ... |
From examining the source code, I find that:
If you didn't specify -n or -w, badblocks doesn't write to the disk at all, so you're safe interrupting it.
If you specified -w, badblocks has already overwritten the filesystem, so it's much too late to worry about interrupting the process.
If you specified -n, badblocks u... | Is interrupting badblocks risky? |
1,361,291,930,000 |
The tl;dr: how would I go about fixing a bad block on 1 disk in a RAID1 array?
But please read this whole thing for what I've tried already and possible errors in my methods. I've tried to be as detailed as possible, and I'm really hoping for some feedback
This is my situation: I have two 2TB disks (same model) set up... |
All these "poke the sector" answers are, quite frankly, insane. They risk (possibly hidden) filesystem corruption. If the data were already gone, because that disk stored the only copy, it'd be reasonable. But there is a perfectly good copy on the mirror.
You just need to have mdraid scrub the mirror. It'll notice the... | Linux - Repairing bad blocks on a RAID1 array with GPT |
1,361,291,930,000 |
When you're using ext4, you can check for badblocks with the command e2fsck -c /dev/sda1 # or whatever. This will "blacklist" the blocks by adding them to the bad block inode.
What is the equivalent of this for an LVM2 physical volume? The filesystem on it is ext4, but presumably, the bad blocks that are detected will... |
When you're using ext4, you can check for badblocks with the command e2fsck -c /dev/sda1 or whatever. This will "blacklist" the blocks by adding them to the bad block inode.
e2fsck -c runs badblocks on the underlying hard disk. You can use the badblocks command directly on a LVM physical volume (assuming that the PV... | How can I check for bad blocks on an LVM physical volume? |
1,361,291,930,000 |
I have a HDD which I don't entirely trust, but still want to use (burstcoin mining, where if I get a bad block in a file, I'll only lose a few cents).
How can I tell btrfs to mark certain blocks as bad (eg from badblocks output)?
If I can't pre-mark blocks as bad, will any bad blocks identified by btrfs scrub be avoid... |
Sadly, no.
btrfs doesn't track bad blocks and btrfs scrub doesn't prevent the next file from hitting the same bad block(s).
This btrfs mailing list post suggests to use ext4 with mkfs.ext4 -c (this "builds a bad blocks list and then
won't use those sectors").
The suggestion to use btrfs over mdadm 3.1+ with RAID0 wil... | Can btrfs track / avoid bad blocks? |
1,361,291,930,000 |
My Ubuntu 13.10 system has been performing very poorly over the last day or so. Looking at the kernel logs, it appears that the <1yr old 3TB SATA disk is having issues with a particular sector:
Nov 4 20:54:04 mediaserver kernel: [10893.039180] ata4.01: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
Nov 4 20:54:04 ... |
Bad sectors are always an indication of a failing HDD, in fact the moment you see an I/O error such as this, you probably already lost/corrupted some data. Make a backup if you haven't one already, run a self test smartctl -t long /dev/disk and check SMART data smartctl -a /dev/disk. Get a replacement if you can.
Bad ... | Does a bad sector indicate a failing disk? |
1,361,291,930,000 |
I may be misunderstanding some concepts here, but as far as I know, each disk has a partition table and actual partitions.
I'm looking to test a hard drive for bad sectors and errors, but the tools I found to do this are meant for partitions -- not disks. badblocks takes a partition /dev/sda1 not /dev/sda. Same story ... |
Is there any way to test whole disk?
Yes, using badblocks:
badblocks /dev/sda
The manpage refers to partitions because badblocks can tell mkfs.ext2 about the bad blocks it finds, and that only works when checking partitions. But badblocks itself works fine on full disks.
However badblocks is really a relic of a byg... | How to check entire hard disk for errors and bad sectors |
1,361,291,930,000 |
I can't find anything about what badblocks actually considers a bad block. I've read the man page and looked at a bunch of questions on here, but I can't find specifics. Also, how good is badblocks? Should I trust it's results? My company historically used Victoria on Hirens Boot CD to test hard disks, but that isn't ... |
badblocks reads, and writes, and compares (not necessarily in that order).
Subsequently badblocks -v will output messages like:
Pass completed, n bad blocks found (x/y/z errors)
Which means it found n bad blocks, consisting of x read errors, y write errors and z corruption errors. It considers read errors and write e... | Is badblocks trustworthy? |
1,361,291,930,000 |
I got a new drive and I'm confused if smartctl detects bad sectors or not. Both short and extended self-tests completed without error. But the Error Log indicates Uncorrectable error in data for 96 sectors.
Here's the smartctl output:
smartctl 5.41 2011-06-09 r3365 [i686-linux-3.2.0-52-generic] (local build)
Copyrigh... |
Your disk had some problems with reading data from the surface, but it seems that the disk dealt with it. I had similar situation:
Error 29 occurred at disk power-on lifetime: 18836 hours (784 days + 20 hours)
When the command that caused the error occurred, the device was active or idle.
After command completion... | Does my hard-drive have bad sectors or not? |
1,361,291,930,000 |
I'd like to test my hard disks with badblocks, but I don't know which values I should use for the block size (-b option) and blocks number (-c option). I randomly tried a few values and it seems they can significantly change the speed of the process. But how can I choose the optimal values?
|
Here are the relevant excerpts for the same question which have been answered already at How do I choose the right parameters when using badblocks? and Using badblocks on modern disks.
There is a badblocks benchmark script available that should suit your purpose.
With regards to the -b option: this depends on your dis... | How can I choose optimal values for block size and blocks number for badblocks? |
1,361,291,930,000 |
Windows has a "Resilient FileSystem" since Windows 8.
Are there similarly resilient filesystems for Linux? What I expect from such a filesystem is that a bad block won't screw up either files or the journal. I'm no FS geek, so please explain if such error-resilience is unfit for a desktop/CPU intensive/memory intensiv... |
If you're looking for advanced filesystems for general-purpose computers in the Linux world, there are two candidates: ZFS and BTRFS. ZFS is older and more mature, but it's originally from Solaris and the port to Linux isn't seamless. BTRFS is still under heavy development, and not all features are ready for prime tim... | Are there error resilient filesystems for Linux? |
1,361,291,930,000 |
When running Clonezilla on a NTFS-drive with bad sectors the cloning is interrupted and I get a suggestion from Clonezilla to use the -rescue option to save as much as possible from the damaged drive.
What does the -rescue option do? How do I use it? When should I use it?
|
The -rescue option is meant to "Continue reading past block read errors." as per this manual.
This means that it doesn't stop when it reaches a sector error. It simply ignores or bypasses them, enabling you to pull off as much data as possible.
If the option isn't selected, CloneZilla will halt and throw a warning me... | What is the "-rescue" function of Clonezilla and when should I use it? |
1,361,291,930,000 |
Is there any user space tool that can retrieve and dump the list of bad blocks in a NAND flash device? I've checked the mtdinfo command line utility, and also searched /proc and /sys, but couldn't find anything.
I am looking for something suitable for use from a shell script.
I could parse dmesg as the kernel prints b... |
I have not been able to find any user space utility doing what I need. The closest I have found is the nanddump utility from mtd-utils, which can dump NAND contents, including bad blocks.
| Print list of bad blocks in NAND flash from user space |
1,361,291,930,000 |
Context
I am running a Raspberry Pi Zero with a Micro SD as it is designed.
However, for this specific application,
I cannot use a read-only system as I usually do with a Raspberry Pi.
Objective
Keep an eye on the health state of the Micro SD (and eventually get a notification somehow that it is time to replace the M... |
How many bad blocks are too many?
A single one.
badblocks is the wrong tool. The moment it reports the first bad block, the flash medium has been already used to the point of damage. Just like fsck, it can only detect when things have already gone wrong – and you might have lost data.
In SD cards (and generally, all... | Interpreting the output of badblocks: when is it time to replace the MicroSD card? |
1,361,291,930,000 |
Anyone know what happens when UBI uses up all its reserved PEBs that are reserved for bad block management? For example say I have a UBI volume that has 14 PEBs reserved
# ubinfo -d 1
ubi1
Volumes count: 1
Logical eraseblock size: 126976 bytes, 124.0 KiB
Total amount of logi... |
I've tested it on armv5tel GNU/Linux 2.6.39+ by marking physical eraseblocks (PEB) as bad using the U-Boot command line:
When the bad PEB count is higher than the amount of reserved PEBs, the volume will still be usable. As long as free blocks are available they are used to replace the bad ones. Problems will occur wh... | UBI bad block management |
1,361,291,930,000 |
I use badblocks to test my 32GB class-10 microSD card that I use to boot my RPi. I already have a functioning file system on it, so I don't want to scan it with the -w option (destructive read-write test).
I have two options: I could use the default read-only test, or I could use a non-destructive read-write test (whi... |
The read-only test only reads. That's basically the default testing method for just about everything and pretty much the same what disks do for SMART self-tests.
The non-destructive read-write test works by overwriting data, then reading to verify, and then writing the original data back afterwards. The only way to ve... | What are the pros and cons of badblock's two non-destructive tests? |
1,361,291,930,000 |
I have /dev/sda mounted on /, as the root partition. Can I safely run badblocks in read-only mode on this device? Will it show false positives/negatives because it's mounted?
|
Read-only is just that - reading from the disk. It will pick up sector read errors but (obviously) not sector write errors.
Categorically, it is safe to run on a device that is being used a mounted filesystem.
With respect to possible false positives, block IO is not "managed", i.e. there are no reader/writer locks. S... | Can I safely run badblocks in read-only mode on a mounted drive? |
1,361,291,930,000 |
I've ran fsck -c on the (unmounted) partition in question a while ago. The process was unattended and results were not stored anywhere (except badblock inode).
Now I'd like to get badblock information to know if there are any problems with the harddrive.
Unfortunately, partition is used in the production system and ca... |
Try
dumpe2fs -b /dev/<WHATEVER>
| How to view bad blocks on mounted ext3 filesystem? |
1,361,291,930,000 |
I made a full disk image from a 4 to 5 year old laptop HDD.
That HDD was in a laptop that was carried often to places, so, over the years, it has probably experienced physical stresses to some degree.
The HDD still works intact, but Guymager, the program I used, showed how many bad sectors were encountered while captu... |
What works listing blocks on all disks independent from file systems? (low-level). And what works with FAT and NTFS?
The LBA number and bad block detection is total independent of the file system. Finding files is completely dependent on the filesystem. Don't expect a single tool to work for all filesystems.
You c... | List bad blocks and affected files |
1,361,291,930,000 |
I have just tried upon tweaking the badblocks utility to use more RAM and possibly achieve a bit higher performance.
The exact command I am running is (without HDD's S/N):
badblocks -v -b 4096 -c 98304 -w -s /dev/disk/by-id/ata-WDC_WD5000LPCX-24C6HT0_SN >> /root/spare-hdd-badblocks.log 2>&1 &
I do not use the badbloc... |
The -c flag controls the number of blocks tested in one go. By increasing this number you're reducing overhead (system calls), marginally improving performance. (Consider dd vs dd bs=64M as another example of this optimisation process.)
However, I'm less convinced that badblocks is even relevant these days. Disk firmw... | Speeding up `badblocks` by tweaking its `-c` switch |
1,361,291,930,000 |
Description of my problem is quite large, so first I will give a short summary, then I will precisely describe the situation.
Short summary: manufacturer's diagnostic tools found and repaired some errors on my hard disk. As far as I understand tool's manual, these errors were bad blocks. However, smartctl (Linux tool ... |
There are no reallocated sectors because they failed to reallocate. Your drive is showing 5 Offline_Uncorrectable sectors, which happens when automatic repair fails. There are obvious read failures shown in the dmesg output, SMART errors, and read failures from SMART tests. There are ways of repairing these sectors as... | manufacturer's tool found bad blocks, but smartctl doesn't show any |
1,361,291,930,000 |
TLDR;
HDD seemed damaged. Unable to format partition (mkfs.ext4 I/O errors), even with a newly created GPT table. SMART test shows some errors. I was about to throw the disk away. Before that, out of curiosity, I ran a full badblocks test. Big surprise : it didn't detect any bad blocks ! Went back to GParted, created ... |
Yes, badblocks can have that effect — not really by design, but because hard drives can remap failing blocks, and will do so when they encounter a failed block during a write (since there’s no data that can be lost). By writing to every single accessible sector in the drive, badblocks gives ample opportunity for the d... | I/O errors, but after running badblocks everything works again : how is that possible? |
1,361,291,930,000 |
I have 2TB disk that I use in notebook. This disk was formatted as ext4 and It works fine in notebook, but when I attach it to desktop (via sata-usb adapter), I am unable to mount it due to following error:
From desktop:
# mount /dev/sdd1 /mnt
mount: /mnt: wrong fs type, bad option, bad superblock on /dev/sdd1, missin... |
This happens with faulty USB interface adapters. Possible reasons for faulty adapters:
Adapter too old
Cheap adapter
Bad adapter firmware
These errors became a lot more frequent with the advent of advanced format drives.
Some adapters try to "translate" AF drive interactions so they emulate legacy format drives.
Thi... | ext4-fs: bad geometry: block count exceeds size of device |
1,361,291,930,000 |
I have purchased a new HDD for my backups. Before entrusting the device with the job of keeping my data safe I want to make sure that it is in good condition. The drive is a new internal 3.5 inch SATA drive.
I started a destructive write test with badblocks using the following command.
(Important: DON'T just copy past... |
You need to add the -c option to do more than 64 blocks and probabky -b to specify a block size other than 1KiB. Right now you're doing 64KiB at a time, which is a lot of seeks.
Something like:
badblocks -c 2560 -b 4096 -wsv -t random /dev/«device»
ought to run much faster. That's 10MiB (= 4KiB × 2560) at a time; go ... | What data transfer / write speeds are to be expected for a badblock destructible write test? |
1,361,291,930,000 |
I have a pretty basic system running Ubuntu 16.04 (this question is not specific to Ubuntu, but rather ext4 partitions), 1 HDD, running a few partitions:
sda1 - EXT4 - 100G - /
sda2 - EXT4 - 723.5G - /home
sda3 - NTFS - 100G - (windows)
sda5 - SWAP - 8G
Whenever I try to access one of 3-4 files in a specific dir... |
Finally found the answer from somebody else on another site, just zeroed the inodes and rechecked the system, that was all!
debugfs -w /dev/sda2
:clri <1415>
:clri <1416>
:clri <1417>
:q
fsck -y /dev/sda2
To anybody else with this issue, I found my bad inodes using find on the bad mount, then checked dmesg for... | Partition Errors and Remounts Read-Only when Accessing Specific File |
1,361,291,930,000 |
The problem that I am having is the extremely long time that fsck is taking. I have thoroughly made searches on Google, but I could not find anything that would resolve the problem.
The command that I am running is sudo fsck.ext4 -vc /dev/sdb1.
I have a 200GB SATA hard drive which has some bad sectors. It is SMART-com... |
SMART doesn't remap sectors, it just detects and logs errors. Bad sectors are remapped automatically when written to. You can do this with dd or hdparm --write-sector.
If your drive cannot remap the sector because it has run out of reserve sectors then you should be one step before panic.
Remapping them in the file sy... | Extremely long time for an ext4 fsck |
1,361,291,930,000 |
I tried to move some files to my NAS (ShareCenter DNS-320), but something shows up, when using file managers:
Input/Output error
or when using rsync on mounted cifs/smb share
rsync: close failed on "/mnt/nas1/_am-unordered/.long-file-name.mkv.PI2rPM": Input/output error (5)
rsync error: error in file IO (code 11) at ... |
You're working from a shaky premise, being that badblocks can solve your problem in the first place.
Why badblocks Is an Untrustworthy Repair Method
As you use a hard drive, it continually does its best to hide problems from you by swapping fresh sectors in for dodgy ones. The hard disk ships from the factory with a p... | Adding badblocks on mounted partition |
1,361,291,930,000 |
The drive is currently in NTFS. After running chkdsk for hours, I have found the locations of bad sectors (below). I want to reformat the disk in EXT4. I have heard that EXT4 has some sort of metadata to mark bad sectors, and there is a utility for that, but I do not want to run the test for hours again. Can I just di... |
You can use the "badblocks" command together with e2fsck to specify a list of bad disk blocks to the filesystem.
As others have commented, that is not great, because that means your disk is on the verge of increasing failure. Also, because this is normally handled at the drive level today, this badblocks code is rarel... | Manually telling EXT4 about bad sectors? |
1,361,291,930,000 |
Before I sell an old HDD I completely read and write the disk to verify that it has no bad sectors.
I always did writing like this:
dd if=/dev/zero of=/dev/sdb bs=100M status=progress
But my computer has 32GB RAM and a lot of the data might be in cache when dd exits.
Is there a way to see when the OS fails to write t... |
Although you specifically requested not to recommend disk checking tools, I will do so and hereby recommend: The disk itself. You can ask the drive to perform a thorough, internal self-test, eliminating all possible sources of problems regarding caches. The self-test can conveniently be accessed via gsmartcontrol:
If... | Using dd to detect bad sectors |
1,361,291,930,000 |
mkfs.vfat -c does a simple check for badblocks.badblocks runs multiple passes with different patterns and thus detects intermittent errors that mkfs.vfat -c will not catch.
mkfs.vfat -l filename can read a file with badblocks from badblocks. But I have been unable to find an example on how to generate the file using ... |
From man badblocks:
-o output_file
Write the list of bad blocks to the specified file. Without
this option, badblocks displays the list on its standard output.
The format of this file is suitable for use by the -l option in
e2fsck(8) or mke2fs(8).
So the correct way wo... | Using badblocks with mkfs -l |
1,361,291,930,000 |
I thought I could nuke all partitions of a drive by using dd if=/dev/zero of=/dev/sdX. In the past this has always worked for me, but in this case it is not working as expected.
#check the partitions
➜ ~ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 477G 0 disk
├─sda1 8:1 0 512M 0 pa... |
#the partitions are still there!
This part, at least, is still normal. You have to re-read partition table to update the partition information. You can trigger a re-read with
blockdev --rereadpt /dev/sdx
(alternatively sfdisk --re-read but that option has been removed from recent versions of sfdisk).
For everythin... | dd if=/dev/zero leaves drive contents in-tact? Bad USB stick? |
1,361,291,930,000 |
I recently bought a 4TB hard disk and I want to do a read-write badblocks test on this before I start using it. Since running badblocks with -w option would take ages for 4TB, I've thought to first write a pattern on the disk and then use the -t option to read that pattern through badblocks, completing it in hours rat... |
Letting badblocks write the pattern in the first place should be no slower than writing it any other way. Especially if you use the -b block-size and -c blocks-at-once options so it doesn't do small reads/writes.
This example overwrites the disk with "random" pattern in 1MiB blocks:
badblocks -v -w -t random -b 4096 -... | How to write a pattern to a device to use it with badblocks with -t test_pattern option |
1,361,291,930,000 |
I have a MD drive set in RAID6 configuration with LVM2 on top. One of my drives was faulted last night due to bad blocks. Now apart from the fact that I am aware I should physically replace the drive, I am wondering:
Can I feed MD a list of badblocks (such as I can with mke2fs -l [badblockslist]) in such a way that th... |
No, you can't. You should also check the drive's SMART status either with the gnome disk utility or with smartctl from the smartmontools package. If it is only a few bad sectors, md should have tried to rewrite them, which should have triggered the drive to automatically remap them to the spare pool. If you have en... | Can MD cope with a badblock list? |
1,361,291,930,000 |
I am trying to check a mounted partition to see if the drive has errors:
[root@virtuality ~]# /sbin/badblocks -v /dev/sdb1
Segmentation fault
Uh oh. What does this mean? Why is badblocks segfaulting? Can I fix it?
(System is CentOS release 4.6, drive is an SATA drive)
EDIT: Using strace:
[root@virtuality ~]# strace /... |
Turned out this was a numbskull error, looks like my copy of badblocks may have just had a bug.
I ran yum update and after that, badblocks no longer segfaults.
| Why is badblocks segfaulting? |
1,361,291,930,000 |
The harddrive is connected with an external enclosure via USB3.0.
$ sudo smartctl -a /dev/sdb
=== START OF INFORMATION SECTION ===
Model Family: Seagate Barracuda 3.5
Device Model: ST4000DM004-2CV104
Firmware Version: 0001
User Capacity: 4,000,787,030,016 bytes [4.00 TB]
Sector Sizes: 512 bytes logical... |
According to fdisk, its a USB disk - so information is hidden.
smartctl has a database of many disks, so it can get the physical size.
In fact, any HD built in the last few years, especially in the multi-TB sizes will have physical block sizes of 4096 bytes.
I've just been looking at my smallish NVME drive and gdisk s... | What is my hard drive physical sector size? fdisk, smartctl etc.. give different answers |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.