Tag Info

Hot answers tagged

21

SCSI is not only a type of hardware interface, but also a command protocol, which is used for abstraction of most of the modern storage devices. Linux scsi driver is a high level driver that handles a variety of storage hardware. Protocol: http://en.wikipedia.org/wiki/SCSI_command Extract from SCSI on wikipedia: Other technologies which use the SCSI ...


16

Do not use mount. From man mount: The listing. The listing mode is maintained for backward compatibility only. For more robust and customizable output use findmnt(8), especially in your scripts. Note that control characters in the mount‐ point name are replaced with '?'. Use findmnt, ...


13

Both RedHat and Debian-based distribution keep several versions of Kernel when you install a new one using yum or apt-get by default. That is considered a good practice and is done exactly for the case you describe: if something goes wrong with the latest kernel you can always reboot and in GRUB choose to boot using one of the previous kernels. In RedHat ...


9

Answer to my question, from Qualys: During our testing, we developed a proof-of-concept in which we send a specially created e-mail to a mail server and can get a remote shell to the Linux machine. This bypasses all existing protections (like ASLR, PIE and NX) on both 32-bit and 64-bit systems. My compiled research below for anyone else ...


7

Yes, it's the PID of ls: /proc/self This directory refers to the process accessing the /proc file system, and is identical to the /proc directory named by the process ID of the same process. (from man 5 proc) /proc/self is a symbolic link to /proc/PID for the PID of the process that accesses the link, by the magic of the proc filesystem. In your ...


6

How about: mount | grep '^/[^/]' Mount points relating to physical disks will always start with a / since the first field is the path to a device. cifs mounts will start with // so exclude lines with a second / to ignore them. Update I misread the question, I thought you wanted to exclude cifs and nfs. Try this instead: mount | grep -E '^[^ ]*[/:]'


6

Yes, it is possible and I would say even advisable. You just need to set up the boot process to offer you the alternative. Typically this is done in the boot loader configuration - usually you can just duplicate the entry that is there and change kernel image filename and boot menu entry label. On a production server this usually isn't a problem, but ...


6

If you change the file owner using chown, the permissions for alice would be transferred to bob. So here's the flow: sudo mv ~bob/Documents ~bob/Documents.orig sudo mv ~alice/Documents/ ~bob/Documents sudo chown -PR bob ~bob/Documents Edit: In case you want to overwrite the group as well, use sudo chown -PR bob:bob ~bob/Documents Or: sudo chown -PR ...


6

Aside from the "too many signals" problem, signals can be explicitly ignored. From man 2 signal: If the signal signum is delivered to the process, then one of the following happens: * If the disposition is set to SIG_IGN, then the signal is ignored. Signals can also be blocked. From man 7 signal; A signal may be blocked, which means that it will ...


5

The -t option for mount also works when displaying mount points and takes a comma separated list of filesystem types: mount -t ext3,ext4,cifs,nfs,nfs4,zfs I am not sure if that is a better solution. If you start using (e.g. btrfs) and forget to add that to the list you will not see it and maybe not miss it. I'd rather actively filter out any new ...


5

Option -0/--null was first introduce on 28-10-2009, and release with GNU coreutils version 8.1. If your coreutils is too old, you should upgrade. Or you can use perl: perl -e '$ENV{_}="/usr/bin/env"; print "$_ => $ENV{$_}\0" for keys %ENV' As @Stéphane Chazelas pointed out in his comment, the above approach doesn't include environment strings that ...


5

So assuming you are using mdadm you can do exactly what you suggest The only caveat is that the raid monitoring utility will generally only handle one disk at a time and normally when you have marked one as failed. Further you just need to ensure that it has completed copying the data before removing the old disks from the raid array otherwise you'll end up ...


5

Yes, that's the PID of ls. POSIX defined ls as an external command, so anytime you run ls, the shell must create new process and run ls in that process. To do that, the shell will call execve() system call: $ strace ls -l /proc/self execve("/bin/ls", ["ls", "-l", "/proc/self"], [/* 76 vars */]) = 0 You can see, after new process was created, /proc/self ...


5

In my personal experience, "duplicate PV" is usually caused by the system having multipath access to a particular SAN LUN but LVM hasn't been configured to filter out the block devices for the individual paths. The device mapper name even looks like a WWNN/WWPN (although I don't have enough experience with SLES to know if that could be something else). Not ...


5

You can't trust that every signal sent will be delivered. For example, the linux kernel "coalesces" SIGCHLD if a process takes a long time in handling SIGCHLD from an exited child process. To answer another part of your question, signals get "queued" inside the kernel if a number of different signals arrive in too short of an interval. You should use ...


4

Recommended Books for the Uninitialized void *i "Men do not understand books until they have a certain amount of life, or at any rate no man understands a deep book, until he has seen and lived at least part of its contents". –Ezra Pound A journey of a thousand code-miles must begin with a single step. If you are in confusion about which of the ...


4

There's a distinction between the two (emphasis mine): if an existing destination file cannot be opened, remove it and try again remove each existing destination file before attempting to open it In the first case, if the file can be opened, cp will attempt to replace only the contents. cp is not going to remove the file unnecessarily. This will ...


4

The question has little sense. "To start during boot" means precisely "to start as dependency of the default target". Note that systemd starts everything in parallel, so the 1.5-second NetworkManager startup does not delay anything except services which explicitly wait for network (apparently, you have none; otherwise they would have been shown in the ...


4

As Bob: mv ~bob/Documents ~bob/Documents.orig cp --remove-destination --no-preserve=ownership -r ~alice/Documents/ ~bob/ sudo rm -fr ~alice/Documents/


4

One option is stat + findmnt combo: findmnt -n -o UUID $(stat -c '%m' "$path") Here -n disables header, and -o UUID prints only UUID value. Option -c '%m' of stat is present to output only mountpoint of given path.


4

I believe the answer lies in how you define "Unix-like". As per the wikipedia entry for "Unix-like", there doesn't seem to be a standard definition.1 A Unix-like (sometimes referred to as UN*X or *nix) operating system is one that behaves in a manner similar to a Unix system, while not necessarily conforming to or being certified to any version of ...


4

The flags work together in the opposite way to what you're expecting. The documentation of /e is, for the record: This command allows one to pipe input from a shell command into pattern space. If a substitution was made, the command that is found in pattern space is executed and pattern space is replaced with its output. A trailing newline is suppressed; ...


4

Yes, you can do it in bash but I have no idea why you would want to. Here's a pure bash solution: $ while read -r mon day time host threat date time crit count sugg out exip \ in inip tcp port export cat vuln; do printf "%s | " "$mon $day $time" "$host" "$threat" "$date $time" \ "$crit $count $sugg" "$out $exip" ...


3

Linux uses two independent keyboard mappings. One for the graphical mode X and one for the console. You usually change the first one with setxkbmap (or xmodmap) and the second one with loadkeys. All those tool have a fine manpage. For loadkeys you can find the existing keymaps under /usr/share/kbd/keymaps. The description of those files is available in man ...


3

The proces is already dead at the time. It doesn't make sense to kill it again. It is still recorded in the process table to allow the parent ti pick up its status. Note that all processes become zombies after being killed. You just don't see them because most parent processes clean up their children very quickly. You might want to file a bug report if a ...


3

I think about this in the following manner: mount is a tool that tells the system to interpret the contents of some files as directory trees. The filesystem has directories and files, and each file is a label for some string of bytes. /dev/cdrom is a file, it represents the string of bytes stored on the CD. You can read this very long string directly, but ...


3

The mv command calls the rename system call, which is guaranteed to be atomic. However, there are two exceptions: If the source and the destination are on different filesystems, which is relatively common for /home vs. /tmp, then rename fails, and mv then works by copying the source tree to the destination and then removing the source tree. This is ...


3

For a GNU tar: --sort=ORDER Specify the directory sorting order when reading directories. ORDER may be one of the following: `none' No directory sorting is performed. This is the default. `name' Sort the directory entries on name. The operating system may deliver directory entries in a more or less random order, and sorting them ...


3

Since this is C, "table" is likely short for "array of structures". You probably want to read "Understanding the Linux Kernel" or "Linux Kernel Development". Or do it the hard way and read the source; good places to start might be: include/linux/fdtable.h and include/linux/fs.h.


3

The structure is entirely dependent on the specific filesystem being used, and the only way to read it is by directly reading from the disk ( i.e. /dev/sda1 ), and interpreting the filesystem yourself.



Only top voted, non community-wiki answers of a minimum length are eligible