date int64 1,220B 1,719B | question_description stringlengths 28 29.9k | accepted_answer stringlengths 12 26.4k | question_title stringlengths 14 159 |
|---|---|---|---|
1,459,528,977,000 |
I want to read the contents of the file into the paste buffer and stdout it to the screen.
I did this:
screen -X readbuf /home/nitro/file|screen -X writebuf|cat /tmp/screen-exchange
but the cat command showed me the screen-exchange file with the previous result of the readbuf command. If I do these commands separatel... |
Those commands:
screen -X readbuf /home/nitro/file
screen -X writebuf
cat /tmp/screen-exchange
do not act as parts of a pipe, but your composite command attempts to treat them that way. That is, each step does not read the previous step's standard output, so there is less causal relationship among them than if you ha... | Screen command for buffer |
1,459,528,977,000 |
There is a program that takes unexpectedly long to run. Before I started it, I did not start screen. So I dont know how to detach the process now. Is there any way to keep this process running on background even if I quit the current ssh session without killing it first?
|
The typical way to do this is with CTRL-z to suspend the process, and then bg to resume it in the background. Once running as a background process, you can disconnect and it will keep running.
If you need to reattach the process to a terminal later, you can use reptyr, which should be in your distributions repositorie... | put a running program into background like screen |
1,459,528,977,000 |
I have a screen session running on my local machine:
~/[email protected]$screen -S pair
Then, turn on multiuser:
ctrl-a:multiuser on
Finally, allow the user pair to connect to the session:
ctrl-a:acladd pair
So far so good. A remote user can log into the machine as pair and connect to the session:
~/$ssh [email pro... |
Turns out screen now has a layout facility that will keep track of splits. In order for the pair to see the current layout just save it as the default:
ctrl-a:layout save default
| Why doesn't GNU Screen split show up for remote user? |
1,459,528,977,000 |
I promise I've been searching thoroughly for an answer...
So, my goal is to emulate the standard urxvt "tabbed" behaviour with screen keybinds, i.e. map three keybinds and that's ctrl+left (prev), ctrl+right (next), ctrl-down (new(?)).
Now I've found the keybinds for left and right on several comments like here and h... |
Rather than xev, if you use cat -v, you can find the characters sent by urxvt:
bindkey "^[Oc" next
bindkey "^[Od" prev
bindkey "^[Ob" new
xev shows X events, which are interpreted by the terminal emulator, and sent to your application (such as screen) as characters. To set up bindings for screen, you have to work wi... | screen with urxvt keybindings |
1,459,528,977,000 |
I use GNU Screen on occasion, and my Emacs keybinding muscle memory is hard to overcome. I know that I can send a control-a (i.e. "go to beginning of line") by hitting "c-a a", but I'm wondering if it's possible to remap the keybindings so that c-a c-a so that sends the c-a.
I've tried a simple "bind ^a ^a" in the ... |
You want:
escape ^a^a
or
bind ^a meta
(since meta sends the command character, i.e. here ^a).
But since ^a is typically more useful than ^z in GNU Screen, you could use ^z as the command character. This is what I do:
escape ^z^z
| Gnu screen: remap "c-a c-a" to send "c-a" |
1,459,528,977,000 |
I use screen on a daily basis. My caption line in ~/.screenrc looks like this:
caption always '%{= dg} %H %{G}| %{B}%l %{G}|%=%?%{d}%-w%?%{r}(%{d}%n %t%? {%u} %?%{r})%{d}%?%+w%?%=%{G}| %{B}%M %d %C:%s '
I like but when I connect via ssh to a remote host and reattach a screen session on it I get this - 2 caption lines... |
Captions are fairly limited - once a caption is added, there is no known command to remove them. One thing you can do is hide the text in them by replacing the caption in the outer session:
<ctrl>-a :caption string '%{kk}'
(where kk is black/black.) You'll still have a wasted line of real estate but the outer sessio... | GNU screen - kill outer nested session |
1,649,348,039,000 |
One of my first questions. Please comment if further explanation or information is required or if the question is not like it's supposed to be here
I'm using screen to automatically start servers (minecraft server in this example).
I'm spawning a screen like
screen -S 'server_1' -d -m "java -Xmx4G -Xms4G -jar spigot.... |
Have tried anyone below?
ansifilter
less -r
strings
| screen logging - How to ommit interactive shell control characters and prompt? |
1,649,348,039,000 |
# tmux Start Script Need To Work!!
if which tmux >/dev/null 2>&1; then
#if not inside a tmux session, and if no session is started, start a new session
test -z "$TMUX" && (tmux attach || tmux new-session)
fi
fine on arch wiki site:
https://wiki.archlinux.org/index.php/Tmux
it differences now then what it was ... |
Screen doesn't have an environmental variable like TMUX however TERM is set to "screen", so you can check that. Screen has a way of reattaching/creating all in one flag set.
-d -R Reattach a session and if necessary detach or even create it first.
# screen Start Script Need To Work!!
if which screen >/dev/null 2>&1;... | how convert with startupScript from tmux to gnu-screen? |
1,649,348,039,000 |
I upgraded recently to OpenSuSE 12.1 from 11.3 and now when I open any files in emacs from inside a screen session, I get a blank buffer. Let's say I open it as:
emacs myFile.txt
it will open to an empty buffer, not the file, and when I attempt to save something, it will ask for a file name to write to. This worked b... |
I'm posting this answer based on the discussion in the comments.
Trial and error indicates that changing $TERM from linux to xterm works around the problem.
I don't know why this would matter. From your description, with TERM=linux it's opening an empty buffer rather than the file, which is not the behavior I'd expec... | GNU Screen and Emacs |
1,649,348,039,000 |
I have a very simple chat-like tool that runs within a GNU screen session. The screen window is split, the top part is running tail -f file.txt and the bottom part is running a script with the following content:
#!/bin/bash
while : ; do
read -p "Message: " msg
ctime=$(date +"%H:%M:%S")
echo "[$... |
How about a slightly different approach? Rather than remove the escape characters and sequences, you can allow users to use them to edit the input line with read -e.
If you want, you can take this even further by recording chat message history, like this:
...
read -e -p "Message: " msg
history -s "$msg"
...
With this... | How to safely escape a variable string (user input) in bash? |
1,649,348,039,000 |
I setup $HOME/root/.screenrc with
caption always "%3n %t%? @%u%?%? [%h]%?%=%c"
This is supposed to show the title at the bottom
When I launch a new screen with
screen -t testtitle
I see a different title
0 root@SERVERNAME:~
I can then set the title with ctrl-a A
Why can't I specify the title when launching screen?
|
This is from the category "It's not a bug, it's a feature!"
The problem is the bash (maybe the same or similar in other shells) variable PROMPT_COMMAND which is set by default in your distribution.
This variable is used to communicate with a lower level software (like a terminal emulator) by writing escape sequences (... | screen -t <titlename> , does not set screen title properly |
1,649,348,039,000 |
Is there a simple way of disabling this? I don't have any power saving constraints currently, as my desktop is always plugged in and I don't mind having it running forever. All of the explanations on xset I've found so far are so long and convoluted...
|
The quickest way is to:
xset -dpms
xset s off # if you also want to disable the screen saver
You can put that inside your .xinitrc so, every time you log in, that's executed. There are more efficient ways of making this programmatic though, one of them is mentioned at the end of one of Brodie Robertson's videos.
DPM... | How to disable screen going blank/off in X11? [duplicate] |
1,649,348,039,000 |
There are multiple questions about this sprinkled around the network, but what I could find has one of two things in common:
They give the manual solution, which only prints the current running program (with no arguments)
The use zsh preexec feature (though I am not sure how that interacts with screen). I am looking ... |
An year later, here is my solution, using traps. This display the hostname, corrent PWD and command (and screen stuff if on screen). This is easily customized in set_screen_window below. Everything should sit in your .bashrc.
First some helper function to check if I'm on screen or not:
export PROMPT_COMMAND=''
if [[ "... | Display full command on GNU screen with bash in title, and interact properly with Vim buffers |
1,649,348,039,000 |
Problem Statement:
A bash script is being used to create a new screen session for each name from a list of names. At every name, a python script is run using that name as an input. The bash script sets the path containing the correct version of python (python 3 in the anaconda package):
#!/bin/sh
export PATH=~/anac... |
export PATH=~/anaconda3/bin/python:$PATH
This seems like the path to an executable. PATH should contain directories:
export PATH=~/anaconda3/bin:$PATH
#!~/anaconda3/bin/python python3
Shebang lines need actual paths and do not perform tilde expansion (that's in your shell). Write the actual path to the executable... | Path Variable and script's shebang will not run correct version of python |
1,649,348,039,000 |
In GNU screen, the shortcut Ctrl-A + Ctrl-K or just K is mapped to kill the current window. I was wondering is there a shortcut to clear the current characters input so far in the prompt, just like the bash Ctrl-U or Ctrl-A + Ctrl-K would. I haven't been able to find it in the documentation.
|
If by "prompt" you are referring to the GNU screen prompt by Ctrl-A and :, that gets cleared by Ctrl-U. That is standard for most command-line applications; the others are bash-specific.
| How to delete current line in GNU-screen (bash equivalent of Ctrl-K)? |
1,649,348,039,000 |
I connect to Host1 using ssh and start a screen session. From one of those windows I ssh into the Host2, which launches a screen session on login.
How can I create new/switch between screen windows on Host2?
Is there a way to escape the first screen(Host1) and send the command to the second screen(Host2)
|
What you have is a nested screen session (using screen within a screen session).
By default, to send commands to the nested session, you hit a second a first:
Ctrl + a a command
For example, to create a new window in the nested session:
Ctrl + a a c
From the screen documentation:
(C-a a)
Send the command charact... | Working with screen via another screen session |
1,649,348,039,000 |
I need to toggle logging from outside of a detached screen session. Interactively you do this by pressing ctrl-a H.
Their octal codes are \001 and \110. (source)
What I tried:
$ screen -S test
then from other terminal I tried to push these codes to the screen:
$ screen -S test -X stuff $'\\001\\110\\r'
However inste... |
You've injected the characters Ctrl+A, H and Return into the application (bash) running in the Screen window. The string that is passed to stuff is not parsed for Screen escapes.
screen -S test -X log on seems to work, or screen -S test -X log to toggle as you want.
| failed to stuff "ctrl-a H" to a screen session |
1,649,348,039,000 |
Sometimes I'll start doing something fast. I've got something to do, and I need to get it done now.
Then of course i realize that I need to do something else to help me finish what I started, so I want to add a new shell using tmux (or screen)... but I forgot to start tmux right off....
My question is this:
How can I... |
I believe you can do what you want using either reptyr ore retty. With either tool you can start up either screen or tmux and pull processes that have been backgrounded/disowned into either. For example:
$ reptyr <pid>
-or-
$ retty <pid>
References
Move a running process to a new screen shell
| Resume bash session in new TMUX or SCREEN? [duplicate] |
1,649,348,039,000 |
I'm trying to run a minecraft server on linux. Running the server starts an important interactive session. I can run the server in the background by appending & at the end of the command and log off the server. But then I don't know how to get back to that interactive session when I log back in.
I know about screen, b... |
screen (or tmux) is the best option for this and written for exactly this purpose.
| How to run linux process and come back to it later? |
1,649,348,039,000 |
I want to run a private Minecraft and Teamspeak server on my little vServer. When I start all manually, it works quite well but I want my servers to start automatically on server startup.
As I run two servers, I use screen to get multiple windows. But I don't know, how I can start a screen session with two windows and... |
The reason the -X doesn't work is because it's a screen command you're executing - in order to get it to run mcStart.sh and tsStart.sh, you should use:
screen -dmS test -t win1 mcStart.sh
screen -rS test -X screen -t win2 tsStart.sh
| Debian Server - Autostart two Servers in one Screen Session |
1,699,902,364,000 |
I have an arduino communication via Serial port at /dev/ttyACM0 and I can open it via screen:
$ screen /dev/ttyACM0 115200
But for some reason I have no privileges to open it via minicom:
$ minicom /dev/ttyACM0 -b 115200
minicom: cannot open /dev/tty8: Άρνηση πρόσβασης
My user is in dialout group:
$ groups
pcmagas ... |
minicom does not actually accept a device name on the command line without the -D option. If a non-option argument is specified, it will be used as a suffix for the Minicom configuration file.
If you specify minicom /dev/ttyACM0, it actually attempts to read a configuration file at either /etc/minicom/minirc./dev/ttyA... | Why I can open serial via screen but cannot open via minicom? |
1,699,902,364,000 |
I have run multiple ANN training processes under multiple screen sessions. When I enter a screen, I see a training process running.
Now, I want to kill a specific process inside the screen without killing the screen.
I can press CTRL + C. But, that produces some unwanted garbage text on the screen.
How can I do it cle... |
If you are able to ssh in to the remote host (the one running screen), then you could modify my script from a similar question that I had to give you the pid of the process and then just kill it.
Find the number of the window that you want to kill the process under. If you are viewing the window, Ctrl+a N will make i... | How can I kill a specific process running inside a screen session, without killing that screen session? |
1,699,902,364,000 |
I was going through the GNU Screen manual and it says
When a program terminates, screen (per default) kills the window that
contained it. If this window was in the foreground, the display
switches to the previously displayed window; if none are left, screen
exits
However in practice doesn't seem so. Neither fo... |
If you start screen, then type who at the prompt, then it is the shell that runs in screen that executes who. screen will therefore not terminate until that shell terminates.
To make screen run who instead of your shell, invoke screen like
screen who
The same behavior may be observed with tmux:
tmux new-session who
... | GNU Screen behavior when the program running on it terminates |
1,699,902,364,000 |
I read the manual and online help, but still cannot grasp the idea of the screen command.
Lets say I SSH to my linux shell. Inside it I want to run a program that will run for 8 hours:
I create a "detached screen" by entering screen and then crtl+a, crtl+d to deattach it.
Then I run my program my_prog
What to do the... |
You start screen,
Run the program in screen,
And then detach it.
screen -R to attach it again.
If you run many independent screen sessions, then use the -S option to name your sessions and to attach named sessions, or use -ls to list existing sessions, and attach to those.
| How exactly to use screen in linux / SSH shell? |
1,699,902,364,000 |
I need a way to display two multiple running processes periodically on a system console so that I don't need to manually type commands to switch between the virtual terminals running them.
So for example, I can switch between my long running process and top every 10 seconds to watch both at the same time.
I thought ... |
After starting your screen session, run this (in another terminal):
while sleep 10s ; do screen -X next ; done
The -X option sends commands to an existing screen session, and next simply advances to the next window. So if your session only has the two windows, then this will switch from one to the other.
| Can gnu-screen periodically toggle between two virtual terminals? |
1,699,902,364,000 |
Here's the workflow:
Open GNU screen: screen
Create a vertical split: C-a |
Switch to the newly created split: C-a TAB
Create a new window / terminal in this split: C-a c
How to do steps 3 and 4 at once? Is there an option that could be added to ~/.screenrc in order to achieve that?
(Note: I come from tmux, where sp... |
I'm not very familiar with screen, so there may be better ways, but you can change the binding for | in your ~/.screenrc with the line
bindkey | eval "split -v" "focus" "screen"
This make the key run the 3 commands equivalent to your key sequence.
| GNU screen: how to automatically spawn a terminal after splitting? |
1,699,902,364,000 |
I'm trying to do this: if a GNU screen named worker already exists, then reattach to it, else create it by starting python example.py.
I tried:
if [ls /var/run/screen/S-root/ |grep -Fxq worker] then screen -r worker else cd /home/www/example/; screen -S worker python example.py fi
but it doesn't seem to work.
Is ther... |
It makes more sense to use screen -ls or
screen -S worker -x || { cd /home/www/example; screen -S worker python example.py; }
But the errors in your code are
the unnecessary [ (which would have needed spaces around it)
if [ls /var/run/screen/S-root/ |grep -Fxq worker]
must be
if ls /var/run/screen/S-root/ | grep -F... | If GNU screen already exists, reattach to it, else create it |
1,699,902,364,000 |
I want to use GNU screen to run a single command in detached mode over serial console and save it's output to the log file on the host where screen is running. Basically, non-interactive equivalent of the following actions:
screen /dev/ttyUSB0 115200 # connect to serial console "/dev/ttyUSB0" using speed "115200"
ctrl... |
I can't test this properly on a serial port, but I think this might work:
$ screen -S serial -L -d -m /dev/ttyUSB0
$ screen -S serial -X stuff 'some command\n'
My version of screen accepts an argument to -L, the name of the log file. Apparently not all versions do. Another way to set the log file name would be with s... | How to run GNU screen in detached mode over serial console and save output? |
1,699,902,364,000 |
Is it possible to run source ~/.bashrc once but for all my N shell sessions (I'm talking about sessions related to one gnu screen of course) ?
Same question but for things like export TEST_VAR=whatever in one shell sessions.
|
If I understand your question correctly, you have N shell sessions in one GNU screen and you want to execute a given shell command (such as source ~/.bashrc or export TEST_VAR=whatever) in all shell sessions at once.
This can be done from inside your screen session with:
Ctrl-A:at "#" stuff "export TEST_VAR='whatever'... | source ~/.bashrc for all my shell sessions of my gnu screen at once |
1,699,902,364,000 |
Every couple of months I return to a gnu screen session just to find out that the running script was stalling for hours or days. My suspicion is, that I, while I try to detach, accidentally press some key combination that makes the process halt. When I attach later and notice the stalling I often see that my tries to ... |
The ^[[D is a key sequence normally created by pressing the cursor left key. This indicates you hit this key by mistake before detaching the session.
Screen pauses may be caused by pressing Control+S keys. This is using Xon/Xoff flow control. It can be restarted with Control+Q. Since the S key is next to the A ke... | Scripts stalling in `screen` session |
1,699,902,364,000 |
The X window system in a desktop Linux (where just one physical monitor is used) usually uses display 0, screen 0.
The output of who in Ubuntu 14.04 is
user1 :0 2016-06-15 14:25 (:0)
where :0 is the abbreviation for :0.0 (:display.screen). Here I logged in only from the GUI.
Then I opened a terminal emula... |
You're referring to the text at the end of the line. That is written by screen to indicate which pseudo-terminal connection it is using, as well as which window-number screen has assigned to it. Comments in the code indicate what it does:
/*
* Construct a utmp entry for window wi.
* the hostname field reflects w... | Display used by screen in utmp |
1,699,902,364,000 |
I use tmux regularly to easily handle multiple terminals on my local machine. Sometimes, I need to connect to a remote machine and start a script in one the terminals (i.e. a pane or window in tmux). If my machine disconnects for any reason during this process, the remote script is killed and I cannot re-attach to the... |
One approach is to use a terminal multiplexer only on remote machines. Running each shell in a separate terminal emulator has the advantage that you can put multiple shell windows side by side. On a remote machine, resistance to disconnection is a big win that justifies terminal multiplexers, but locally, they have fe... | Combining local and remote terminal multiplexing |
1,699,902,364,000 |
I have a scenario where I need to cd into a directory before running a script:
cd repos; python script.py
But it should be setup such that it automatically runs when screen is started. So in .screenrc I have this:
screen -t "cd repos; python script.py"
except this doesn't work because the cd repos is wrong. How do I... |
If you want this to happen by default when you run screen, then you'll need to edit your .screenrc file. You can use the chdir directive to have a new screen window change directories upon opening it, but you'll want to explicitly reset that after your needs are met, so that newer windows are not affected.
# .screenr... | How can I automatically run a script inside screen if the script is not in $PATH |
1,699,902,364,000 |
As far as I've seen, pressing Ctrl-Z on any terminal multiplexer, or trying to start them in the background, does nothing or crashes.
I know that, in a sense, terminal multiplexers are a "replacement" for job control, and usually, they have their own mechanisms for suspending and resuming. Still, I was wondering if I ... |
Do you want to suspend a job inside a screen window?
Just use Ctrl z inside the screen window (as usual). This doesn't suspend screen, though.
Do you want to suspend screen itself?
Use Ctrl az inside any screen window. But notice that although this suspends the user-facing part of the screen application, it doesn't... | Does any terminal multiplexer (screen, tmux, zellij) support job suspension (Ctrl-Z) in Bash? |
1,699,902,364,000 |
I could not figure out how to start a screen session, and in that attached screen session to run a command without human intervention. Expected behavior is:
[me@me ~]# screen -S name -L --mystery_flag 'hostname;echo yes;echo no'
#new screen session
[me@me ~]# hostname
me
[me@me ~]# echo yes
yes
[me@me ~]# echo no
no
[... |
GNU screen takes a number of options, and then an optional command to start within the screen session. If no command is given, the screen session will contain an interactive shell session. The screen session terminates when the command that it runs terminates, no matter whether it's a command given on the command li... | Running screen and immediately run other commands |
1,699,902,364,000 |
I have been running my code within a screen session on a remote server. I want to move the output directories generated within this session on the remote server to my local server using SCP but I am not able to.
Is there a way to do this?
If not, how can I copy my folders from the screen session to my remote server (... |
It looks like you are re-attacing to a session started by root.
The files may be in /root.
Where ever they are you may have to change the file permissions to be able to read them. see What are the different ways to set file permissions etc on gnu/linux
They may also be on a mount-point that is restricted to a single ... | Is it possible to copy directories from a remote session, to the local machine? |
1,699,902,364,000 |
I am attempting to get ANSI to display properly in a screen session using Iterm2 on OS X, the default TERM is set to
screen.xterm-256color
I tried
export TERM=vt100
and
export TERM=ansi
and
export TERM=xterm
w/ tmux
|
The issue isn't the terminal emulation - leave the TERM setting as is.
It's that the character set used by those part of the UI is CP437, but your terminal is set to another character set (probably UTF8).
You can either set iTerm2 to use CP437 if it supports that (the setting is under Terminal / Character Encoding), o... | ANSI in BitchX not displaying properly |
1,699,902,364,000 |
Whenever I move the cursor after the last/before the first character of the line, or I move before the first/after the last line in Vim there is a latency until I can control the cursor again.
It happens in bash too, but not in emacs.
It happens within konsole/terminator terminals but there is no problem while in a TT... |
The likely problem is when using key-repeat to move continuously in in a terminal, when you reach the end, your key will have sent more characters than were needed to reach the end. The editor (or other application) still has to read and react to those extra characters. While it is doing that, you may notice that no... | GNU screen latency when moving cursor on start/end of lines in Vim |
1,699,902,364,000 |
In my terminal I run a screen. Obviously I have several tabs and in one of them I connect to a remote server. In this one I have a detached running screen, I attach it but I can't switch its tabs.
PS: the remote running screen has been here since many months ago and is never killed. However the local one is killed ev... |
Either use a different command character for the inner screen, for instance by starting it with:
screen -e'^Bb'
So that ^B be the command character instead of ^A and a literal ^B be entered ^Bb.
Or you'll need to enter ^Aa (assuming the outer screen was started with the default settings, that is as if with screen -e'... | screen inside screen [duplicate] |
1,699,902,364,000 |
screen offers this functionality:
bindkey -t foo stuff barfoo
Make "foo" an abbreviation of the word "barfoo".
Timeout is disabled so that users can type slowly.
I use(d) this for e.g.
bindkey -t .,u stuff user.name
bindkey -t .,U stuff User.Name
bindkey -t .,E stuff [email protected]
and so forth.
But no... |
tmux doesn't have this functionality. It uses a single key in each key-table, with modifiers. Some keys have names see here for a list.
If you are using a program such as bash that uses the gnu readline library
then you can use it to do the conversion.
Using bash
bind '".,u":"user.Name"'
bind '".,U":"User.Name"'
bind ... | tmux multi-key key binding like in screen possible? |
1,699,902,364,000 |
I'm trying to run an application sbopkg that uses a curses interface in an ssh session running under GNU Screen (Tmux also has the same behavior). If I run ssh directly from the terminal emulator (either iTerm2 or Terminal on OS X), then I don't see any blank spaces.
Why am I seeing these blank spaces? Is there a way ... |
You're using a terminal description that says that the terminal supports back color erase (bce), but it does not actually do this.
GNU screen is configurable (defbce for instance), but apparently tmux is not (see for instance Support background color erase (bce) [was: Vim copy & paste trailing space issue] #109)
Furth... | Curses interface has blank spaces under GNU Screen and ssh |
1,699,902,364,000 |
I have a script that takes a while to run, and I'm using screen to run it.
ssh user@host screen -dm "python dostuff.py"
Now the question is, how do I make sure it kills the screen session after dostuff.py finishes execution? Whether it's because an error, or proper termination.
|
This might be in the "workaround" category, but I was able to achieve what I think your goal is by putting the command ("python dostuff.py" from your example) into a shell script, then running ... screen -d -m "/path/to/that/script"
Version info:
$ screen -v
Screen version 3.09.10 (FAU) 4-Sep-01
Looks like I have a ... | Kill a screen session when script is done executing |
1,699,902,364,000 |
I have these in my .screenrc file:
screen -t ghci 0
screen -t bash 1
screen -t dev 4
Now, I put these in my my .screenrc file to split them:
split -v
focus
Now I want to switch to the window bash on the split screen. Right now that window is empty. How do I do that? I don't want to do that interactively. Is there an... |
The man page for screen has select, prev and next for window selection.
| GNU Screen switch to different window |
1,699,902,364,000 |
This is actually a problem that also goes on with screen. Here is what it looks like (in mutt):
mutt with browser visible behind http://s15.postimg.org/l4pupb7mx/muttmux.png
When running a terminal application that builds an updated interface from Guake, tmux and screen don't seem to display the default background col... |
The question (and suggested answer) are a little obscure, but what is being described is mutt's use of the default color feature of ncurses (or slang). If your mutt color scheme uses the word "default" for the foreground or background, then at runtime mutt will ask ncurses/slang to use the terminal's default color.
W... | How to get guake to update background characters? |
1,699,902,364,000 |
I am using a laptop and Putty on a Windows system.
When I connect to my Debian Squeeze server in Bash environment, I can use the "Pos1/Home" or "End" (at the numlock part of the keyboard) to navigate through the commandline I am just writing.
However, when I create a "subshell" using screen, I cannot use Pos1/Home or ... |
I have found the reason why it didn't work.
In the PuTTy configuration I had to change the session settings as follows:
Connection -> Data -> Terminal details -> Terminal-type string
The value was: xterm
I changed it to linux
Now I can use the Home+End keys in Bash and in Screen as well.
echo $TERM will show linux out... | No numlock in screen? |
1,699,902,364,000 |
tl;dr: I have an irssi proxy screen session running in the background. I'm running byobu -R -S byobu;exit in ~/.bash_profile to start a second session instead of reconnecting to the irssi session, but it starts a third session when I log in twice (e.g. once through the local terminal and once through SSH). How can I m... |
You could switch the irssi process to use tmux, instead of the login process.
| How can I set up byobu to use a second screen session on login? |
1,699,902,364,000 |
I want to start a long running custom script at boot.
The script must run under a specific username.
So far I have successfully used the screen command and switched to the user in the custom script. But I rather have the screen command run under that user so that I can later login to that user and resume the screen.
T... |
Under GNU/Linux at boot, you should not use su (as it depends on PAM/dbus, which may not be available yet), but runuser:
runuser username -l -c "screen -S sessionname -d -m /path/to/bash/script"
When using runuser followed by the user name, the syntax is the same as su.
| Combined su and screen at startup |
1,699,902,364,000 |
Here's my .screenrc:
defscrollback 5000
vbell on
vbell_msg " dierre!!! ---- Wuff!! "
screen -t GRINDER ssh [email protected]
screen -t TRUNK
attrcolor b ".I"
termcap xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
defbce "on"
# caption always "%3n %t%? @%u%?%? [%h]%?%=%c"
# hardstatus alwaysignore
hardstatus al... |
Add at the end of your .screenrc the following lines:
split
focus
other
To run multiple command, each in a separated split window:
screen -t title1 app1
split
focus
screen -t title2 app2
split
focus
screen -t title3 app3
and so on.
| Is it possible to have a screen macro for this? |
1,699,902,364,000 |
I like the experience that I get from using the terminal on a remote device where there is a visible lag between what I type and what happens on screen, because it forces me to trust the actions I'm taking. Sometimes I'd like to train my fingers a bit like this, and replicate this sort of lag on my local setup.
I use ... |
The answer - and explanation - comes from How to throttle bandwidth of SSH connection but I don't think it's a strict duplicate.
I started by considering a 150baud teletype (15 characters per second), but this timed out, taking too long for the ssh command to establish its credentials and set up the connection, and an... | How to add delay to my terminal? |
1,699,902,364,000 |
I am trying to run gnu screen in a virtual machine. To create a new screen window, I press ctrl+a c, but this key combination makes the qemu monitor appear instead. How do I send these keystrokes to the guest?
|
QEMU in -nographic mode uses CtrlA as its own escape character.
To send CtrlA to the emulated system, you need to double it; so CtrlACtrlAc will create a new window in your screen session.
You can change QEMU’s escape character using the -echr option, followed by the ASCII code of the key you want to use; for example,... | Prevent qemu from hijacking input |
1,699,902,364,000 |
With the screen command, the -X option allows you to execute a command in the specified screen session, but when you try to use it when creating a new screen, e.g:
screen -dmS -S downloader -X "wget https://google.com"
you get the error No screen session found.. So it's clear the the -X option only works for pre-exis... |
I found my answer, although it was under a different title and the question was slightly different, this does the job:
screen -d -S downloader -m wget https://google.com
It creates a new screen called downloader, detaches it and runs the command.
| Execute command when creating new screen session |
1,699,902,364,000 |
I found out today that both my friend and I use different ways of connecting to a screen. I've always used the form -x and he uses -r. I read the man pages but I wasn't able to come up with a test case that produced different results.
I opened two consoles on the same account and attached to it successfully with -r an... | ERROR: type should be string, got "\nhttps://www.gnu.org/software/screen/manual/screen.html#Invoking-Screen\n-x attaches to a session even if you are attached to it already.\n-r attaches only to a session if it has no client currently attached to it.\nIf you want to test it (the test you did sounds rather like you tried to attach to the screen-session from inside the screen session, which you definitely should not do), you need two separate terminal sessions. In the first, do screen to start a screen session and attach to it. In the second, do screen -r:\nscreen -r\nThere is a screen on:\n 562503.pts-2.E595 (Attached)\nThere is no screen to be resumed.\n\nNow do screen -x and you will attach to the session. If you put both terminals side by side, you will also notice that what you do on one of the terminals will be visible also on the other terminal.\nSo in short: -r for attaching a detached session, -x to attach to an attached session without detaching the other session.\n" | What is the difference between -r and -x when attaching to a screen? |
1,612,926,048,000 |
I am building a dumb terminal with an arduino and I can now see the output of serial connections. How do I get a login/shell?
I have tried screen /dev/ttyACM0 and that lets me type on the host computer and see the results on the terminal screen, but no shell. Using screen's :exec /bin/sh command starts a shell on that... |
agetty seems to be fairly quiet about problems. I tried:
$ strace -e open agetty -I 'hello\012' -L /dev/ttyS0 9600
and it opened /dev//dev/ttyS0, which failed of course. It then hung around a few seconds and stopped.
The man page does say it wants a relative filename, so I then tried:
$ strace -e open agetty -I 'hell... | How do I host a shell for a serial terminal? |
1,612,926,048,000 |
I can split my screen window horizontally by typing Ctrl-A S (or vertically with Ctrl+A |), and then I can switch between windows with Ctrl-A Tab. I'd like to also be able to switch windows with Ctrl-A o (to parallel how you can switch windows in emacs with Ctrl-x o). I've tried reading the docs on screen's bindkey ... |
See the docs.
Add this to your .screenrc file:
bind o focus next
| Change "next window" keyboard shortcut in GNU screen |
1,612,926,048,000 |
I have an existing screen session and now I need to set some (more than one) environment variables to that session. These environment variables should not be visible to other screen sessions. I tried the solution in this answer which didn't work.
I tried
screen -r "myscreen" -X setenv x x_value;y y_value;z z_value
He... |
instead of the setenv command, try the export command
export myEnvVar="echo \"It works!\""
bash $~/ $myEnvVar
Output:
It works!
To make it permanent for your user:
in the .bashrc file (usually your your /home//folder)
add it at the last line, and reload the bash shell.
I.e you could add the following lines:
export ... | Set multiple environment variables for existing screen session |
1,612,926,048,000 |
I am new to GNU screen and was wondering how to split window appropriately.
Start a session with screen command.
Split window with C-a S.
And I get the results of the terminal as shown in the image below.
I'm assuming that I'm logged into bash at the same time as the split screen, is this feasible?
I'm using
macOS... |
I was able to solve this issue sing @Fox 's method.
| Could not start bash session after GNU screen window split command |
1,612,926,048,000 |
Our $HOME file system is an openAFS system. I log on to my desktop machine from my laptop at home and want to run a long job. Thus to protect it from a broken session, I open up
screen -S session_name
and run the script from there, and then disconnect the screen session. My problem is that after a relatively shor... |
I suggest running krenew, which has the option to run a command with the -t flag, which by default is aklog. It’s usually packaged as part of the kstart package.
Run the krenew inside the screen session. Make sure you get renewable Kerberos tickets, and your institutions KDC might have limits on how long your ticket c... | screen session loses contact to AFS file system |
1,612,926,048,000 |
I have a machine configured (via cron) to start a screen session on reboot. The session opens up a few screens and starts a server in one of them. All of this works fine. However, when I login and resume the screen session, I get a (PS1) prompt like this:
\u@\h [\j] \w\$
Terminal colors do not appear either. This is... |
The fact that magic characters like \w in PS1 are not being interpreted seems to suggest that the shell started by screen is not bash, but something simple like /bin/sh. I looked at /etc/crontab in one of the systems I had to hand and it had the line
SHELL=/bin/sh
at the start, but another distribution had SHELL=/bin... | How to start screen on reboot with an interactive TERM/TTY |
1,612,926,048,000 |
I'm running a Minecraft server as a systemd service. The service's ExecStart is the path to a script whose contents are:
screen -L -DmS minecraft java -Xmx4096M -Xms1024M -jar server.jar nogui
That is, this is running as a simple service, not forked.
I would like for the output of the java call to be logged via syste... |
I eventually solved this problem by changing the way I ran the server. I stopped using screen entirely and used Minecraft's RCON support to control the server (e.g. stopping it). I'm not sure it's precisely an answer this question as I've asked it, but it should work well for anyone specifically running a Minecraft se... | Capture log output for a systemd service running in a screen session |
1,612,926,048,000 |
I have my computer start secure shell in a chroot system at boot. (All the normal directories are bind mounted in the chroot system /run, /dev, /dev/pts, /sys, /proc). After logging in to the chroot environment and trying to start screen, I receive the error.
Directory '/run/screen' must have mode 775
So I set chmod ... |
This sounds similar to this screen bug detailed for Ubuntu.
You are sharing the /run directory between your host and chroot, but I suspect they are running different versions of screen and the the Ubuntu one is exhibiting this bug and should be updated to a version that does not have this problem.
If that does not h... | GNU Screen requires different permissions for chroot environment? /run/screen |
1,612,926,048,000 |
I write a bash file, which contains screen commands. This bash file is then called from a python script using subprocess. All works perfectly fine. However, the screen sessions don't close after the script has (successfully) run and stay open. This is unwanted behaviour.
Here is an example of the bash file:
#!/bin/bas... |
When you execute something like
screen -dmS session_1
screen -S session_1 -X stuff "Rscript script_1.R\n"
you send to the terminal (in previously created screen) the sequence of characters Rscript script_1.R\n. This way the shell will execute the command and, then, wait for the next command.
You need to execute some... | Screen session doesn't close after script has run |
1,612,926,048,000 |
I have a screen running with a number of sessions, and in one of them, I entered screen -D -m and now that session is just hung. I can't do an Escape, q, or Ctrl+C to terminate. Even after closing and resuming the screen screen -r screenName, this specific session is just in that same state.
How do I kill this session... |
screen -D -m starts a new session in a detached state without forking a new process. The command will not terminate until that new screen exits.
You can still put the command in the background with Ctrl+Z followed by bg, and then check what name it got with screen -ls (it will say (Detatched) at the end and also ment... | Terminating a Screen session after running "screen -D -m" |
1,612,926,048,000 |
Suppose we need to run application in screen and keep it running when screen exits. The following command does the job, but only if "sleep 1" is appended to it. Why it does not work without "sleep 1"?
screen -d -m -L sh -c 'DISPLAY=:0 nohup zenity --info --text test >/dev/null 2>/dev/null &'
|
This seems to be a timing problem, in that nohup does not have time enough to disable signals before it is signaled by one of the parents. You can see this by adding strace -o /tmp/s -ff in front of the screen command and then in one of the log files /tmp/s.* you see
...
access("/bin/nohup", X_OK) = 0
st... | Why application does not run from SCREEN without delay? |
1,612,926,048,000 |
In my .screenrc I have the following stanza:
# Change command key to ctrl+space
escape ^@a
I found this magic incantation in a forum I can no longer find; it allows me to hit ctrl+space to invoke screen commands, so ctrl+space c (or ctrl+space ctrl+c) will create a new window, and ctrl+space space (or ctrl+space ctrl... |
With a lot of terminal programs (but not every one), control-SPACE sends the ASCII 00 character (NUL).
You can see this, eg with od -cx and entering control-SPACE, RETURN, control_D. You'll see output similar to:
% od -cx
^@
0000000 \0 \n
0a00
0000002
Control-@ is also the NUL character (@ is ASCII 64, ... | Why does the .screenrc key binding ^@a map to ctrl+space? |
1,612,926,048,000 |
In a bash script I want to show the user a file with less, but I don't want less to take up the whole terminal: I need to keep some informations visible in the terminal while the user browses the file with less.
I googled for terminal split linux and all the results refer to the screen command.
After several hours of... |
Sending the quit command will tell screen to quit, so replace the less command with:
screen 1 sh -c 'less /etc/passwd ; screen -S "${STY}" -X quit'
or something to that effect.
| using screen to split the terminal |
1,612,926,048,000 |
Related, but this is Gnome Terminal, not Screen
I closed a "tab" (pane? window? not sure the correct term) within my screen session. Is there a way to recover a "tab" lost in this way?
(not dissimilar ctrl+shift+t in a browser)
|
No. Once a shell session has terminated, it is gone, no matter whether it was running in GNU screen, in tmux, in a terminal emulator or directly on a console.
A web browser is different as it's able to just reload the page in a new tab if you ask it to reopen the most recently closed tab. A browser may additionally ... | Can I reopen closed panes in GNU Screen |
1,612,926,048,000 |
I have a python script that I run by passing some arguments as environment variables:
param=1 length=5 python myscript.py
I want to run it inside a screen. I tried screen -m param=1 length=5 python myscript.py but this does not work, I get the error "Cannot exec param=1, no such file or directory". How can I still ru... |
Try:
param=1 length=5 screen -m python myscript.py
Example
$ cat myscript.py
#!/usr/bin/python
import os
print(os.environ["param"], os.environ["length"])
raw_input()
If we run this command:
$ param=1 length=5 screen -m python myscript.py
The output appears:
('1', '5')
(For python3, replace raw_input with input. A... | screen a script with env variables |
1,612,926,048,000 |
Context
I often create a multiuser GNU screen session for demonstration purposes. I do it by creating a named session with:
screen -S tutorial
And then performing
^A:multiuser on
^Aaclchg student1,student2,student3,... -wx "#?"
And that works, the students can connect with screen -r grochmal/tutorial and can see wh... |
OP got me to find the last bits of what I needed for my configuration, seeing it's a old question I stumbled in here and found little examples of it elsewhere so figure I could drop my solution here~ I found in the umask it's reading right->left as well between the | if you like to add permission for one and remove fr... | GNU screen: how do I use :aclumask to set permissions to unknown users? |
1,612,926,048,000 |
When I used vim outside a unix screen to edit a file, vim displays the file correctly.
However , when I open the same file inside a unix screen, the indentation "seems" to become messy.
I say "seems" because the indentation is actually correct (if you see the highlighted cursor in the second image, it is actually at t... |
The picture appears to show these features working:
color (perhaps)
cursor-addressing (something moved the cursor to the right place)
tabs (unknown: if the terminal was claimed to support hardware tabs but did not at all, that second line would begin at the left margin)
But that second line is the problem. Vim coul... | vim inside screen : Indentation displayed incorrectly |
1,612,926,048,000 |
Is there a way to list the windows of a screen session from a non-interactive terminal?
screen -S 'screen_name' -X windows
According to gnu.org, this command displays the list of windows using the message line.
That's fine and dandy for an interactive console, but I need this to print to standard output so I can read... |
You can use the -Q option
% screen -S 2908.pts-0.mymachine -Q windows
0- spam 1* news 6 ksh
Unfortunately this truncates if there's more than fits across the terminal width (basically it causes the command to run and displayed in the message line, but also copies it to the current stdout).
| Screen: List Windows in Session (Non-Interactive) |
1,612,926,048,000 |
The current work flow is like this, a user logs into a session and begins processing. At a later time that user's shift ends. At this point the user is still processing but able to detach from the session where upon a new user logs in and continues processing.
This is okay while there is only one unit of processing wo... |
A simple way of sharing that might work for you would be to start a
Xvnc virtual X11 server with vncserver :1 on one machine, and
run your application in it, and then connect to it simultaneously from many different workstations with vncviewer -shared host:1. All users see the same desktop and share keyboard and mou... | gnu screen command for X |
1,612,926,048,000 |
I have added this to .profile:
[ -z "$STY" ] && screen -Rd "work"
When connecting to a remote machine via ssh, the automatic attachment to screen is hiding the server's motd (message of the day).
Can I tell Screen to show this message when first attaching, or at least insert a keypress block before hiding the motd?
|
You can try it this way:
[ -z "$STY" ] && read && screen -Rd "work"
It will postpone the screen attaching after you will press enter (or input something). If you enter Ctrl+D, screen will not be attached and you will end up in normal shell.
| Showing login message when connecting to Screen |
1,612,926,048,000 |
I am trying to compile GNU Screen in my home folder on a machine where I don't have super user rights. I am taking GNU Screen version used by Linux from Scratch.
tar xvzf screen-4.3.1.tar.gz
cd screen-4.3.1
./configure --prefix=$HOME
Its all good until that point and the Makefile is generated. Then the command make e... |
It looks like you're missing a few dependencies. That would be a bug in the configure script. You might want to file a bugreport to the screen maintainers.
| Trying to compile GNU Screen |
1,404,431,914,000 |
I recently installed Debian on my machine and made separate / and /home partitions. Yet my disk usage analyzer shows that my /home is inside /.
But gparted shows that /home is indeed in it's own partition, and has 500+ GB of free space.
I checked my /etc/mtab and it shows that /home is mounted at /dev/sdb6 whereas / ... |
You split your disk into (at least) two partitions - one for your home directories (/home) and another for everything else (/). It looks like you only allocated about 10GB for /, which is now full. The partition mounted as your /home directory is ~621GB, with plenty of free space, but that's not where most system file... | Why is my hard drive out of space if gparted says I have 500+GB |
1,404,431,914,000 |
I have Linux Mint installed on an external hard drive, and I have the 4 main partitions (/boot, swap, /, and /home). I also have 600GB of unallocated space. I know there's always the chance of data loss, but would it be any more dangerous to add a partition while booted to that physical disk than it would while booted... |
Since "when booted" means that the OS that needs to make changes and write to the disk, is also running from the same disk, has a higher potential for problems/disaster if something goes wrong.
Following Murphy's Law, "Anything that can go wrong, will", you are safest to run the operation isolated from the operating s... | Is it safe to use GParted while booted? |
1,404,431,914,000 |
I have the following partitions on my machine:
I want to resize /dev/sda5 and stick it to sda4, but gparted doesn't allow me.
How can I do it?
|
You can't, you need to unmount it first. And because it is your / filesystem, you need to use a LiveCD (GParted has a special LiveCD but you can use the Ubuntu installation image too).
Some filesystems can be resized when mounted and ext4 is one of them, but you don't want to just resize it, you also need to move the ... | resize mounted partition with gparted |
1,404,431,914,000 |
I seem to be unable to start gparted from the command line. I am using Trisquel 8 (based on Ubuntu 16.04) with LXDE. If I try to open it, I get the following error and nothing happens:
$ sudo gparted
(gpartedbin:7820): Gtk-WARNING **: cannot open display:
However, it seems to open fine from the graphical applicatio... |
To access X you need environment variables DISPLAY and XAUTHORITY. Depending on setup, sudo may delete them. You can check that with sudo env to see the environment variables.
To preserve your users environment, you can use sudo -E. That has the pitfall setting HOME to your users home, and config files may get wrong f... | Why can I not open gparted from the command line? |
1,404,431,914,000 |
Apologies for this question but I am very new to Linux.
When I installed my Fedora distribution I only allocated 20GB of my hard drive space for its partition. I recently used GParted and tried to increase the size of the partition to around 40GB. I was under the impression that I was successful but today I tried to ... |
In this case, your file system is on the LV(Logical Volumne), which is on the partition. If you expand the partition, your LV will not be expanded.
Please run these commands :
pvresize <device name> <-- This will let the Physical Volume know that the partition it is on has been expanded.
And :
lvextend -l +100%FREE /d... | How to increase size of filesystem to match partition |
1,404,431,914,000 |
I'm running a VM with Centos 7 in a virtual environment (Proxmox). I'm out of space. So I've added some from Proxmox, booted from Gparted Live CD to allocate that space to /dev/sda2, but it won't let me resize. Please advice what can be done.
|
You have a swap partition between /dev/sda2 and the free space. Turn off swap, remove the swap partition from /etc/fstab, then use Gparted to delete the swap partition /dev/sda3 and the extended partition /dev/sda4; you will then be able to extend /dev/sda2 in the adjacent free space.
| Gparted Live: Can't resize ext4 partition |
1,404,431,914,000 |
I am trying to somehow extend the unallocated partition (below sda1) into the sda2 partition to increase its total size. If it is relevant the sda1 is a Windows 10 parition and I'm dual-booting with Antergos (Arch Linux variant). Below is a screenshot from GParted.
|
Mounted file systems can't be resized. In the screenshot of gparted, there's a key symbol between /dev/sda2 and ext4; that key symbol indicates /dev/sda2 is mounted. It can't be unmounted while the Arch Linux system on sda2 is running.
To fix:
Reboot from a liveCD, (or USB equivalent), and run gparted from that, ri... | Extend unallocated partition into linux partition |
1,404,431,914,000 |
I am working with an external HDD and trying to backup a logical partition within an extended partition using dd like this:
sudo dd if=/dev/sdb6 of=partition6.dd
it returns:
dd: opening `/dev/sdb6': No such file or directory
I used the exact same method to backup a different partition (primary) with no issues
sudo d... |
It appears that the device file does not exist. You can verify this by doing ls /dev/sdb6.
Try running the command partprobe, or sudo partprobe as user. This should detect the devices and create the according device files.
This may return the error
Error informing the kernel about modifications to partition /dev/sdb5... | dd can't see partition but cfdisk and GParted can |
1,404,431,914,000 |
I have a LVM primary partition at the end of my disk, Windows is at the beginning, there was an unused partition in between but I need some space for Linux so I removed it.
Now I'm trying to figure out if it is possible to resize my LVM from its add more space "on the left" of the partition.
fdisk -l
Device Boot ... |
LVM (Logical Volume Manager) is a subsystem. At the lowest level is a PV (Physical Volume). Within the PV is a VG (Volume Group) and within the VG are the LVs (Logical Volumes).
You seem to be asking how to move or resize the PV corresponding to /dev/sda4. In order to do this you first need to deactivate the VG. (gpar... | Resize LVM at the beginning |
1,404,431,914,000 |
This is my partition structure :
I want to create another primary partition from that unallocated space.
If I shrink sda2 to a size less than what I needed for to create another primary partition, will it move entire extended partition to right or just slices off extended space from it as it is contiguous ?
|
No it will not move the entire extended partition nor make the space contigious.
Although in theory the extended partition could just be recreated with the same
logical partitions, that would mean that the entries stay in place (with some zero size first, logical partition), or you would have to rearange the Extende... | Moving unallocated space from Extended partition to create a Primary partition |
1,404,431,914,000 |
I have an Ubuntu 12.04 LTS server that has 6x600GB SAS drives in a RAID 5 configuration (Perc 6/i).
The partition scheme looks like this:
Partition File System Mount Point Size
/dev/sda1 ext2 /boot 243.00 MiB
/dev/sda2 extended 1.09 TiB
/dev/sda5 lvm2 ... |
jordanm had the best suggestion. Although the msdos partition table cannot accomodate a single partition that is larger than 2TB, because I have a logical volume, I can create a new partition from the unallocated space (which is smaller than 2TB) and add it to the logical volume.
First I create a new, unformatted part... | Change Partition Table with GParted |
1,404,431,914,000 |
I have an external (USB) disk, which has been working OK for some time and shows no errors whatsoever in /var/log/$relevantfiles (no errors on reading/writing, for example).
Here's the thing:
if I ask for sudo fdisk -l /dev/sda this returns:
Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 12... |
You appear to have both a dos and mac partition table on the disk, and parted is recognizing the mac one. You should be able to zap the mac partition table with:
sudo dd if=/dev/zero count=1 bs=2 of=/dev/sda
| parted not recognizing my current partition on external disk. How to fix without losing data? |
1,404,431,914,000 |
I am using GParted.
It shows partition name and a label.
I found their difference in What is the difference between a name and a label in gparted?
I found how to change Partition label in How do I change the “label” reported by lsblk?
I want to change Partition Name stored in the partition table (not label). How can I... |
A) Make a list of partitions with lsblk -o NAME,FSTYPE,LABEL,SIZE,MOUNTPOINT
B) Unmount the partition with umount /xyz -l where /xyz is the partition to change.
If it's your boot partition you wish to rename, well, boot with a LiveUSB. The process for making a LiveUSB will vary depending on your distro, but here's a ... | How to change partition name (not label) |
1,404,431,914,000 |
I have an ext4 img file containing an Android system partition files.
I mount it by using sudo mount -t ext4 -o loop,rw system.img system
When I'm done editing the files and umount the file, I notice that the resulting image is significantly larger than the content it has.
I checked with GParted, and it is indeed tru... |
You can use resize2fs -M system.img to shrink your filesystem to the minimum size. Note that this does not shrink the image file directly. You would need to use truncate to shrink the image file to the new filesystem size (carefully, so you don't chop data off the end).
| Automatically shrink an ext4 IMG file |
1,404,431,914,000 |
I booted to a live Ubuntu USB, wanting to delete partitions on an SD card, and ended up deleting all my partitions on my MacBook Pro's internal HD.
I have already tried gpart (which gets stuck at "Begin scan...") and testdisk (which can't create partitions since "Function write_part_mac not implemented"!).
I did try c... |
Intel MacBook Pro's use GUID partition table for disk partitioning which one can edit with gdisk.
A copy of the partition table metadata is usually stored as backup of the primary. You can read more detail about it on the Arch Wiki here
You need first to know the device name, /dev/sda, /dev/sdb of your Mac disk.
You c... | Recover partitions Mac OS internal HD |
1,404,431,914,000 |
I was so dumb, to turn of the power on my Readynas Ultra 4 when it was installing the disk (3TB WD Green), I had no time to wait for it as I was going to return it (It was too damn noisy) The disk installation was at 0% and stayed like that for 2 minutes, so I decided to turn it off without really thinking about the c... |
You have copy & pasted a lot of unnecessary transcripts but your first paragraph pretty much says it all:
When I run sudo gparted on a live ubuntu USB, I get Input/output error during read on /dev/sdc.
So you have a defective disk. The error comes directly on /dev/sdc (not /dev/sdc1 or /dev/sda2, etc...) so it appli... | Cannot access disk, partition table broken |
1,404,431,914,000 |
I went through what I found about this subject in the most of the threads, unfortunately without success. I have the following situation. fdisk or parted doesn't recognize this sanDisk USB flash:
fdisk -l
root@debian:~# fdisk -l
Disk /dev/sda: 477 GiB, 512110190592 bytes, 1000215216 sectors
Disk model: Intenso SSD SAT... |
The problem seems to be that (for whatever reason) /dev/sdb is not a device file but a regular file. Both the output of ls -l (-rw-r--r--) and parted (Model: (file)) schow that.
This can be fixed by deleting and recreating /dev/sdb (the file):
rm /dev/sdb
mknod /dev/sdb b 8 16
| fdisk dowsn't recognize SanDisk USB 3 Ultra Flair |
1,404,431,914,000 |
I installed Linux Mint 18.2, as LVM with LUKS encryption, onto a 128GB SSDD. I would like to remove the swap drive b/c I have 16GB of RAM on my machine and I want to try to preserve the drive as long as I can. When I started the disk and started Gparted to remove the swap partition I noticed that Gparted lists the dri... |
There shouldn't be any problem disabling a swap partition of any sort. Once booted, you can disable the swap partition with:
sudo swapoff -a
And then place a swap partition on some other disk and enable that with:
sudo swapon -U uuid-of-new-swap-partition.
Once you verify that the new swap is working, you can remov... | Removing the swap partition from a LUKS encrypted SSDD |
1,404,431,914,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,404,431,914,000 |
I am using GParted (0.28.1, Fedora 25) to format a external drive and noticed that the command displayed is:
mkfs.ext4 -F -O ^64bit -L "INSTALL" /dev/sdd1
When making disks in the past from command line I have just used mkfs.ext4 DEVICE which seemed to work well for various architectures. However the above includes ... |
The default options for mke2fs including those for ext4 can be found in /etc/mke2fs.conf. They could be different depending on the distro you're using. I'd take a look at that file on any distro you're curious about to see if the -O ^64bit param would be necessary. According to the man page the '^' is indeed the prefi... | What does this mkfs.ext4 operand mean? |
1,404,431,914,000 |
I shrunk my root partition and it seems nice. But I am thinking about overwriting now at least the most important files from the backup copy (external drive, rsync, weekly backup) in order to be sure that none of my files got corrupted during the shrinking. That is probably a waste of time (and perhaps it may result i... |
Why can I rest assured that GNU Parted has not corrupted a single bit
after shrinking my partition?
You can't, in fact, gparted man page clearly says (under NOTES):
Editing partitions has the potential to cause LOSS of DATA.
......
You are advised to BACKUP your DATA before using the gparted application.
Reboot ... | Why can I rest assured that GNU Parted has not corrupted a single bit after shrinking my partition? |
1,404,431,914,000 |
In CentOS 8.0 Server with desktop, I am trying to install gparted. It's not in the native software app, so I tried:
sudo yum install epel-release
sudo yum install gparted
and when I ran the latter, I see
Error: Problem: conflicting requests
- nothing provides PolicyKit-authentication-agent needed by gparted-1.0.0.... |
The encountered error which is missing policykit-authentication-agent dependency package does not look essential to run gparted.
You can try
dnf download gparted
sudo rpm -i gparted-downloaded-package-name.rpm --nodeps
sudo gparted
| CentOS 8 install gparted fails |
1,404,431,914,000 |
I am currently dualbooted between Windows 8 and Linux Mint 18
Using GParted, I see this following:
The selection partition is unallocated for a size of 25 GB, I would like to merge this with my dev/sda6 (linux partition), so that I can make my linux partition about 50GB. I'm not really sure about the process though o... |
The free space and your existing Linux partition are not contiguous, so you can't simply merge them. Linux's own partition scheme, LVM, allows a filesystem to be split between separate location on the disk or even between disks. But native MBR or GPT partitions have to be a single contiguous area.
Moving the partition... | How can I merge unallocated hard disk space to my linux partition? |
1,404,431,914,000 |
Current Environment Information:
Dual Boot with Windows 7x64 and Linux Mint 16
I am currently trying to install Elementary OS instead of Linux Mint.
Windows works fine but Mint boots fine but has some problems (Cinnamon Crashes and unable to browse other drives) so cannot use for regular use. So I decided of trying th... |
Your partition table looks OK, but it's a bit odd. In particular, most partitioning tools put a data structure known as an Extended Boot Record (EBR) in the sector immediately preceding the logical partition it describes. In your case, though, there's no gap between your logical partitions 5 and 6, so your partition 6... | Gparted showing complete drive unallocated |
1,404,431,914,000 |
I know this isn't a question that's specific to Unix/Linux, but I think there are people who can answer this question here.
I want to hide my Windows partition from the partition table completely, then later I want it to come back. I'm sure it's something simple to do, but it's safer to ask people who know instead of ... |
Make a backup of the partition table (sfdisk -d /dev/sda >sda.txt (DOS MBR)
or sgdisk --backup=<file> <device> (GPT)).
Delete the partition.
Restore the partition table from the backup.
Warning: Under certain conditions deleting even an unused partition may prevent your Linux from booting. This can happen if the sys... | Hide a partition in the partition table and make it reappear later |
1,404,431,914,000 |
why does df command and gparted show different free space?
In my case, I have:
$ df -hT
Filesystem Type Size Used Avail Use% Mounted on
[...]
/dev/sda4 ext4 184G 173G 1.6G 100% /home
and the same results from Nautilus
while gparted shows:
Size Used Unused... |
Previously answered here
Gparted will be looking at actual inodes and disk-level info to determine how much is free, whereas df will be looking using the filesystem tools themselves[...]
| free space inconsistency |
1,404,431,914,000 |
I will be installing Windows 10 and Linux (dual-boot) on a new computer in a couple of days. I would like to use GPT instead of MBR for the partition table.
As I understand it (and have done in the past), it is much easier to install Windows first (and let it try to dominate the machine 😊) followed by the Linux ins... |
Latest Windows can install automatically on GPT, and then proceed with Linux install as usual, modifying partitioning setup as required. Why would you partition first?
| Using gparted before installing Windows 10 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.