date int64 1,220B 1,719B | question_description stringlengths 28 29.9k | accepted_answer stringlengths 12 26.4k | question_title stringlengths 14 159 |
|---|---|---|---|
1,367,888,728,000 |
I have a problem with a filesystem here on a storage machine. We noticed, that many of the data that comes out of the systems seams to be corrupt, but only with minor problems like CRC errors with self-verifing installers or small picture errors in movies.
While tracking down the problem, i endet up in a test with 3 ... |
I think I found the problem: After a while of plugging arround different setups I replaced the SiI controller with an old PCI one and the problem seems to be solved.
| Same file with different content on every read [closed] |
1,352,298,199,000 |
My initial raid setup was 2x2TB RAID 1 using mdadm.
I have bought a 3rd 2TB drive in the hopes to upgrade the RAID's total capacity to 4 TB using mdadm.
I have already run the following two commands, but dont see a capacity change:
sudo mdadm --grow /dev/md0 --level=5
sudo mdadm --grow /dev/md0 --add /dev/sdd --rai... |
According to Gparted, the answer was to do a filesystem check in order to utilize the extra space.
To solve the problem I had to:
unmount the filesystem.
open gparted
select the raid device (in my case /dev/md0)
run check (Partition -> Check)
This successfully resized the md0 partition to use all of the available s... | Can I Increase raid 1 capacity by changing to raid 5? |
1,352,298,199,000 |
I have a Dell PowerEdge R820 server which is under maintenance by other third party. There are 6 SAS (10K RPM, 6gbps) disks and they are configured as RAID 5 using PERC controller.
Currently I am facing performance issue with the server. Basically it is with the disk. When I tried to write 4GB of data, it is taking ... |
That does seem like a disk performance issue.
You should get something in between 20 MB/s to 80 MB/s depending on block size I think.
I found this old 10k disk comparison where you can see how different drives are performing http://techreport.com/review/5236/10k-rpm-hard-drive-comparison/7 .
I also found a thread from... | Disk I/O performance issue [closed] |
1,352,298,199,000 |
MD raid5 array appears to have stopped working suddenly. Symptoms are somewhat similar to this issue in that I'm getting errors talking about not enough devices to start the array, however in my case the event counts on all three drives are equal. It's a raid 5 array that should have 2 active drives and one parity, ho... |
It looks odd. You might have to mdadm --create with overlays for this one (with correct data offset, chunk size, and drive order). And perhaps with the first drive missing, as that seems to have failed first...
Basically there is no way to recover with conventional means once a drive no longer even remembers its Devic... | mdadm not enough devices to start the array - recovery possible? |
1,352,298,199,000 |
I'd like to run a series of fio-based performance tests on a few drives in various RAID and non-RAID configurations. When assembling drives in RAID5, the rebuild process takes an incredibly long time (6TB HDD). Since I'm going to completely overwrite the disks as part of the performance tests (or at least all the sect... |
You can skip the initial sync with --assume-clean.
mdadm --create /dev/md100 --assume-clean --level=5 --raid-devices=3 /dev/sdx1 /dev/sdy1 /dev/sdz1
Alternatively, leave a disk missing so no sync can be performed. Doing so results in a degraded RAID, which might be a relevant use case for some tests.
mdadm --create /... | Quickly assemble raid5 for perf test |
1,352,298,199,000 |
I have 3 exactly the same drives (4tb ironwolf) where i would like to make a raid-5 with using MDADM for a small degree of data security.
Now the problem is, 1 drive is filled with data which i am unable to make a backup for.
Yes, i understand that when building and a drive fails all my data is gone, but still i would... |
If you have a small amount of disk space available you can test out these commands with loopback devices.
Create the loopback devices a, b, c:
dd if=/dev/zero bs=1M count=50 > diska.img # Plan for RAID5
dd if=/dev/zero bs=1M count=50 > diskb.img # Likewise
dd if=/dev/zero bs=1M count=50 > diskc.img # Original... | Build RAID 5 with mdadm and 1 disk with data |
1,352,298,199,000 |
I'm trying to create RAID 5 according to this tutorial. But, when I run mdadm -C /dev/md0 -l=5 -n=4 /dev/sd[b-e]1, I get this error:
mdadm: invalid raid level: =5
Here's the output of mdadm -E /dev/sd[b-e]:
/dev/sdb:
MBR Magic : aa55
Partition[0] : 4294965247 sectors at 2048 (type fd)
/dev/sdc:
MBR Ma... |
Your command is incorrect, it should be this:
$ mdadm -C /dev/md0 -l 5 -n 4 /dev/sd[b-e]1
If you want to use the = signs you use these switches instead like this:
$ mdadm -C /dev/md0 --level=5 --raid-devices=4 /dev/sd[b-e]1
Per man page:
-l, --level=
Set RAID level. When used with --create, options are... | mdadm, invalid RAID level? |
1,352,298,199,000 |
I'm trying to repair a RAID5 array, consisting of 3 2TB disks. After working perfectly for quite some time, the computer (running Debian) suddenly wouldn't boot anymore and got stuck at a GRUB prompt. I'm pretty sure it has to do with the RAID array.
Since it is difficult to give a full account of everything tried alr... |
You're missing one of the three drives of the /dev/md0 RAID5 array. Therefore, mdadm will assemble the array but not run it.
-R, --run
Attempt to start the array even if fewer drives were given than
were present last time the array was active. Normally if not
all the expected drives are found and --scan is ... | Repairing a RAID5 array |
1,352,298,199,000 |
I have an existing LVM RAID5 array on a CentOS 8 box made up of 3x4TB drives. That array is beginning to run low on space, so I have an identical 4TB drive I'd like to add into the array to increase the total space. However, when I run lvextend /dev/storage/raidarray /dev/sda, I get the following output:
Converted 100... |
I don't normally use LVM RAID so excuse me if I reproduce your situation a bit imperfectly. So the numbers will be a bit weird.
Given what would be a 3 device RAID 5 in mdadm. In LVM terms, this is called a raid5 with 2 stripes (the parity is not counted).
# lvs -o +devices HDD/raidtest
LV VG Attr LSize... | Grow LVM RAID5 by identical disk, not enough extents |
1,352,298,199,000 |
Basically I have raid 5 with three disks that are 2TB each. I bought 2 extra 2TB drives however they are few sectors smaller on a newer model - old drives are no longer sold.
When I issue
/dev/md0 --add /dev/sde /dev/sdf
it yields:
mdadm: /dev/sde not large enough to join array.
Is there any way to resize the f... |
You will have to reduce the size of whatever is stored on the md0 array first. Unfortunately you give very little information on that.
If there is a plain filesystem directly on /dev/md0 then it depends on the filesystem type how you can reduce its size, if at all possible.
If there is an LVM physical array on /dev/m... | MDADM - adding a disk to RAID5 with slightly less sectors |
1,352,298,199,000 |
I want to install a Linux server in my house to be able to share documents and multi-media files between every devices here.
The machine I have has 3 HDD slots, I need at least 3.5 TB of storage and I want my files to be safe in case of a disk failure.
I'm currently investigating two options that are around the same ... |
The trade-offs are:
Option 2 (2xRAID1) is more reliable, presuming the disks are of equal reliability. Basically, we assume there is a N%/yr (or whatever time period) of an individual disk failing. If you have two disks, the chance of any one of them failing is greater. If you have three disks, the chance of any one ... | Building a network storage server, trade-offs of different RAID configurations? |
1,352,298,199,000 |
I had a RAID 5 (Linux software RAID) server which recently decided not to boot anymore. It seems to be a motherboard problem possibly due to not being protected by a UPS during a power failure. It managed to extend its slow death to the point of taking up plenty of my time without much reward but I know that the drive... |
The short answer is: yes, it is possible.
Linux software RAID writes some meta information on the devices such that you can easily plug them into another system (using another controller and so on) and use them there. Before doing any assembling, you can query the devices (status, look what Linux think what part of wh... | is it possible to recover a raid 5 array by using usb enclosures? |
1,352,298,199,000 |
I had to open my file-server's housing today to replace a faulty fan. What I didn't see was that one of the sata-cables was not properly connected.
The 1st thing I did after a reboot was a check of the RAID status and it showed immediately that one drive is missing. Till this moment the device was not used (however it... |
Maybe it will help somebody.
I didn't write it before but all four partitions had the same count of events
mdadm --examine /dev/sd[a-z]1 | egrep 'Event|/dev/sd`'
mdadm: No md superblock detected on /dev/sda1.
Events : 315786
Events : 315786
Events : 315784
Events : 315786
Still, af... | missing files after reassemble of RAID-5 |
1,352,298,199,000 |
I’m going to build a new storage with a few SSDs in RAID5 under Linux’ mdadm. I am considering buying 5 or 6 SSDs now.
If I add another SSD in the future does adding it to the RAID5 require a full write on all then used SSDs? SSDs have a limited write capability and it would be a small indicator for me to buy more fre... |
If you plan to expand the array so to increase its capacity, then yes, this addition will be followed by the reshape operation and it will require a complete rewrite of all component devices, including the new one.
However, a single full rewrite a few times should not concern you much. You're not going to reshape an a... | Does adding 1 drive to an mdadm RAID5 with SSDs require writing all disks once? |
1,352,298,199,000 |
I have a raid5 which is inaccessible after unexpeted power outage.
Details:
# cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4] [linear] [multipath] [raid0] [raid1] [raid10]
md0 : active raid5 sdd[3] sdc[1] sdb[0]
3906766848 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU]
bitmap: 0/1... |
/sbin/fsck /dev/md0 failed because you don’t have /sbin on your PATH, so fsck couldn’t find fsck.ext4.
Running /sbin/fsck.ext4 directly works, as would adding sbin to the PATH:
PATH="${PATH}:/sbin" /sbin/fsck /dev/md0
| fsck: error 2 (No such file or directory) while executing fsck.ext4 for /dev/md0 |
1,352,298,199,000 |
I'm looking to recover data from 4 old HDDs set up in a software raid5 and it looks like a disk has failed. What I want to do is recover the raid so I can copy its data somewhere else. I have done some research and I believe I want to use mdadm to perform a resync, but at the end of the day I do not want to mess it up... |
So... /dev/sdb1 hasn't been active in this array since 2015 (Update Time). The data on it should be outdated to the point of uselessness. Essentially you've been running a RAID-0 ever since.
That leaves you the three other devices /dev/sd{c,d,e}1. Out of these, /dev/sdd1 failed recently. Since you already lost redunda... | Recovering a Failed Software Raid5 |
1,352,298,199,000 |
I'm trying to create raid 5 from four disks:
Disk /dev/sdc: 8001.6 GB, 8001563222016 bytes
/dev/sdc1 2048 4294967294 2147482623+ fd Linux raid autodetect
Disk /dev/sdb: 8001.6 GB, 8001563222016 bytes
/dev/sdb1 2048 4294967294 2147482623+ fd Linux raid autodetect
Disk /dev/sdd: 24003.1 GB,... |
6 TB would be (4 - 1) * 2 TB, where 4 is the number of your devices, minus one for parity, and 2 TB is the size of the partitions you seem to have.
Assuming that first output is from the fdisk utility, the fields are probably
partition name start end length type
/dev/sdc1 2048 429496729... | Why isn't the space of Raid 5 array equal to sum of disks? |
1,352,298,199,000 |
Is it slower to write one block in RAID Level 5 with 5 disks than RAID 1 with two disks (mirroring only)? I think No since with Level 5 you are writing the data and the parity (two writes). With Level 1, you are writing twice as well (original as well as mirror). Can someone let me know if my train of thought is corre... |
In RAID-5, unless your write was large enough to cover all data chunks for a given parity chunk, it has to read the missing data chunks in order to be able to recalculate and update parity. Thus a relatively small write on a RAID-5 can turn into a large read operation.
RAID-1 does not need such additional reads, as th... | RAID Level 5 versus Level 1 |
1,352,298,199,000 |
I have one 1.5Tb HDD with Debian Wheezy. I have also four 2Tb empty HDDs.
I want to configure the four 2Tb disks in Raid5 and install LVM. Then migrate the content of the 1.5Tb disk on the Raid5.
Before starting, I would like to know if the migration could be possible and, if yes, how to do it.
|
You could simply do a 'rsync' from the old disk to the new disk.
Something like this should work:
rsync -rtv "/mnt/old_drive" "/mnt/new_drive"
You would replace the above locations with the mount points of your disks on your computer.
To find where your disks are mounted to or what device they are showing up as you... | How to migrate the content of one disk on a Raid5? |
1,352,298,199,000 |
I have a CentOS server with RAID5. Every time RAID5 re-syncs my server stop working. The hosting company stopped the httpd service so that RAID5 can re-sync itself, a process which can take as long as 3-4 hours.
The problem reoccurs frequently, so the Hosting company swaped my server hardware and I migrated to new har... |
RAID should only resync after a server crash or replacing a failed disk. It's always recommended to use a UPS and set the system to shutdown on low-battery so that a resync won't be required on reboot. NUT or acpupsd can talk to many UPSes and initiaite a shutdown before the UPS is drained. If the server is resynci... | Problem with RAID5 |
1,352,298,199,000 |
I run a mdadm RAID 5 array of 4 3TB disks on Ubuntu 18.04, with a total size of 9TB. It displays as a 9.0 TB RAID-5 Array in gnome disk utilities, and the usage is 799 GB free, which means I have over 8T data.
I then bought a NAS and start copying data from RAID to a new disk. The copy was completed after 4 hours with... |
It turns out that the RAID subsystem has actually got only three disks instead of four. 3x 3TB in RAID5 gives 6TB usable space, and now the numbers add up and match as expected.
This can be seen with the command line utilities
cat /proc/mdstat # display the makeup of the RAID arrays
df /path/to/mountpoint ... | What is a good way to know mdadm RAID 5 array used size |
1,352,298,199,000 |
I connected a 4-bay enclosure with 4 new 8TB disks to my rPi.
This disks appeared in lsblk as sda to sdd.
Following this tutorial I created the array doing
mdadm -C /dev/md0 --level=raid5 --raid-devices=4 /dev/sda /dev/sdb /dev/sdc /dev/sdd
The array started building itself without issue and after 2 days (!) it was ... |
Ext4 is limited 16 TB on 32-bit systems.
| Can't create filesystem on a freshly made raid5 using mdadm |
1,352,298,199,000 |
I'm having an issue with LVM RAID 5 not allowing me to create a LV that uses the space on all four drives in the VG. What is particulary annoying is that I create this very same VG/LV using the same model of drives two years ago and I don't recall having this problem.
Here's the output of pvs and vgs before I attempt ... |
As I said in my question, I've done this before and have a capture log of what I did to accomplish it two years ago. For some reason the identical lvcreate command didn't work. To get this LV create I had to specify the number of stripes using -i 3. So, the working command was:
lvcreate -i 3 --type raid5 -L 8.18T -n l... | LVM RAID 5 not resulting in logical volume size expected |
1,361,988,965,000 |
I have 32 GB of memory in my PC. This is more than enough for a linux OS. Is there an easy to use version of Linux (Ubuntu preferably) that can be booted via optical or USB disk and be run completely within RAM? I know a live disc can be booted with a hard disk, but stuff still runs off the disc and this takes a while... |
Ubuntu can run on RAM, but it requires some manual changes:
https://wiki.ubuntu.com/BootToRAM
| Is there a linux OS that can be loaded entirely into RAM? |
1,361,988,965,000 |
There have been a lot of questions about RAM Disks and I am aware of ramfs and tmpfs which allow the use of ram as a block device. However my interest is in using a fixed memory address range as a block device.
This arises from the necessity to use non-volatile RAM available in my system. I have 6GB of RAM available,... |
I am not an expert on device drivers, however here are some pointers for your R&D:
if memory is marked as "reserved", the OS cannot touch it; you will have to find a way to either have the BIOS mark it as available to the OS, or use direct low-level ioctls to control it
if Linux could see the memory, you still would ... | Reserve fixed RAM memory region as a block device ( with a given start physical address) |
1,361,988,965,000 |
I have updated my KVM management script for Ubuntu 14.04 KVM hosts to support debian 8 guests. After a manual installation (preseed script does not work yet), I am stuck with the the following message on bootup:
During the installation, I:
Selected only ssh server and base system utilities.
Set the grub bootloader ... |
Thanks to the link @Someone posted in the comments to the question, I was able to pull this content which fixed the issue for me:
on the boot screen (below) press the "e" key to edit the configuration.
You will be shown a screen like follows.
Scroll down using the keyboard down arrow. You want the line that says li... | Debian 8 KVM Guest - Loading initial ramdisk |
1,361,988,965,000 |
I have allocated /dev/ram0:
dd if=/dev/zero of=/dev/ram0 bs=1M count=1024
Now I have 1Gb sitting in memory. How do I free up the allocated space?
|
I believe, you can use blockdev command, which is available from util-linux package (in Debian)
blockdev --flushbufs /dev/ram0
Source
| How to deallocate /dev/ram0 |
1,361,988,965,000 |
In modern file systems (and on modern SSDs) there is no guarantee that if you write over a file using a traditional utility (such as dd) that the data will be overwritten in-place and journaled backups destroyed. As a result, the data could possibly be recovered. So, after a little research I figured that mounting a... |
Q1: Yes
Q2: It is not feasible to recover the data. Nevertheless, if you want to be extreme you could do it like this :)
Create some space in ram:
mkdir ram
mount -t ramfs -o size=1000M ramfs ram/
Create some randomly filled file which we encrypt in that RAM space. Being filled with random data it will be impossibl... | Regarding the creation and destruction of sensitive data on linux/unix systems |
1,361,988,965,000 |
First, I have create the directory that I will want to mount to.
mkdir /mnt/ramdisk
Now, I could easily turn this into a ramdisk using ramfs or tmpfs via
mount -t tmpfs -o size=512m tmpfs /mnt/ramdisk
I've found a tutorial on how to create a ramdisk which breaks this syntax down as:
mount -t [TYPE] -o size=[SIZE] [FST... |
I have combined an idea given to me by Ipor Sircer's answer with Stephen Kitt's suggestion of using a RAM disk block device.
First, I compiled CONFIG_BLK_DEV_RAM into my kernel. I changed the default number of RAM disks from 16 to 8 (BLK_DEV_RAM_COUNT), though that is based on preference and not necessity.
Next, I cr... | How can I create an ext4 ramdisk? |
1,361,988,965,000 |
I need a block device in RAM. I built a 3.x kernel and added the RAM block device driver. The number of RAM block device drive is 16 (by default) but when the kernel boots there is no ramx in /sys/block nor /dev. What's going on?
|
I think you mean something like this:
Load the block ramdisk module, set the desired size in blocks using the rd_size=... parameter.
# modprobe brd rd_size=123456
...after this step /dev/ram0 exists.
You now can put a filesystem on it.
# mkfs /dev/ram0
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Blo... | How Linux kernel 3.x manage ramdisk as block device? |
1,361,988,965,000 |
OS: SLES 12.3
Running these commands:
mkdir /foo/ramdisk
mount -t tmpfs -o size=100m tmpfs /foo/ramdisk
Creating a NFS on /foo/ramdisk produces this result when I run showmount -e <IP>:
clnt_create: RPC: Program not registered
When I remove the NFS share then showmount -e <IP> works again:
Export list for ...
An... |
I found the problem: I had to add to the NFS options fsid so now the full list looks like this:
fsid=1,crossmnt,rw,no_root_squash,async,no_subtree_check
The fact is yast doesn't warn here. I could fix the problem because I ran exportfs and then I got the error regarding the fsid.
| Cannot create NFS on a tmpfs drive |
1,361,988,965,000 |
This is how I create RAM disk manually on Linux Debian Jessie:
mount -o size=1G -t tmpfs none /mnt/tmpfs
My question is, how do I make this automatic at each computer startup?
|
You don't need a script for that: there's a system facility to mount a filesystem at boot time. Add it to the file /etc/fstab. Open this file in your favorite text editor and add a line like this:
none /mnt/tmpfs tmpfs size=1G
Make sure not to accidentally modify other lines.
Note that there's already a tmpfs filesys... | How to create and mount a RAM disk at computer startup? |
1,361,988,965,000 |
I learned that I can do modprobe brd rd_nr=1 rd_size=4585760 max_part=1 if I want to create a ram block device at /dev/ram0 but lets say I want to flush the device (to free the ram), then delete it and create another. How would I do this running modprobe brd rd_nr=1 rd_size=4585760 max_part=1 again doesn't seem to cre... |
You should not delete /dev/ram0 yourself. It will be deleted when you do sudo rmmod brd, which frees the space and removes the module.
You can then start again from modprobe.
| How do you create block RAM Disks on demand? |
1,361,988,965,000 |
I have a fairly standard initial ramdisk created using mkinitcpio. I'm on Arch GNU/Linux.
A while ago I got dropped to a rescue shell and poked around in the /bin of the ramdisk to see what was available. For some reason, there was a bunch of utilities that seemed irrelevant (think things like ping - why would you wan... |
Initial ramdisks use Busybox to save space. Essentially, utilities like mv and cp all share a lot of common logic - open a file descriptor, read buffers into memory, etc. Busybox basically puts all the common logic into one binary which changes the way it behaves depending on the name with which it was called. Let's t... | Why are there internet utilities in my initial ramdisk? |
1,361,988,965,000 |
I have a script which creates a lot of files and directories. The script does black box tests for a program which works with a lot of files and directories. The test count grew and the tests were taking too long (over 2 seconds). I thought I run the tests in a ram disk.
I ran the test in /dev/shm. Strangely it did not... |
Quite generally speaking, all operations happen in RAM first - file systems are cached. There are exceptions to this rule, but these rather special cases usually arise from quite specific requirements. Hence until you start hitting the cache flushing, you won't be able to tell the difference.
Another thing is, that th... | why is filesystem intensive script not faster on ram disk |
1,361,988,965,000 |
How do I accomplish setting up project quota for my live root folder being ext4 on Ubuntu 18.04?
Documentation specific to project quota on the ext4 filesystem is basically non-existent and I tried this:
Installed Quota with apt install quota -y
Put prjquota into /etc/fstab for the root / and rebooted, filesystem got... |
I was told running tune2fs -O project -Q prjquota /dev/sdaX is absolutely essential to enable Project Quota on a device. So I searched for a solution that does not require switching off or using a live-cd as this requires too much time and does not always work well in my experience with my VPS provider. And I also hop... | Project Quota on a live root EXT4 filesystem without live-cd |
1,361,988,965,000 |
I've been shortly using the following on Linux Debian Jessie to create a "RAM disk":
mount -o size=1G -t tmpfs none /mnt/tmpfs
But I was told it doesn't reserve memory, which I didn't know.
I would like a solution, which does reserve memory.
|
Add it to your /etc/fstab:
none /mnt/tmpfs tmpfs defaults,size=1g,mode=1777 0 0
You may also need to rebuild your initramfs, e.g.:
sudo update-initramfs -u -k $(uname -r)
or, to rebuild the initramfs for all kernels:
sudo update-initramfs -u -k all
BTW, tmpfs doesn't reserve any memory - a tmpfs filesystem o... | How to create a real RAM disk that reserves memory? |
1,361,988,965,000 |
Is there away way to turn on IO accounting for /dev/ramX block devices in Linux? I already tried echo 1 > /sys/block/ram1/queue/iostat but it did not work.
Notice that all devices have stats except the ram devices at the bottomSo performance measurement tools like dool cannot measure the IO speed:
# cat /proc/diskstat... |
Ramdisks /dev/ram* (or rather the brd module) don't bother updating stats (*), for efficiency reasons I guess.
If you don't mind a small overhead, here is a workaround: use the device-mapper to create a transparent (1-to-1) layer over your ramdisk. You will then have access to the stats through your dm device.
# ramsi... | Why do /dev/ramX devices have all 0's in /proc/diskstats? |
1,361,988,965,000 |
I have a laptop with Linux Slackware. When it's working on battery saving a file to hard drive takes around a second. When I'm writing code I waste a lot of time saving the files.
I have about 2 GB of free RAM, so I can use 1 GB as a temporary buffer. And work like this:
Load the file into the RAM buffer.
Work with t... |
I think what you want to do is a bad idea, because in the case of a system crash you'll lose your work.
Anyway, you can use a subdir of /dev/shm to store your files; it's a tmpfs file system, which means it's kept in RAM.
| How to keep the file in RAM |
1,361,988,965,000 |
I'm installing a CentOS 7 VM, and I would like to create a RAM disk inside the %pre section of a Kickstart file.
However, doing so via
mkfs -q /dev/ram1 8192
is not possible as the mkfs binary is not present in the Kickstart environment, and all other mkfs.* filesystem-specific commands return an error "/dev/ram1: n... |
It turns out that the device node needed to be created with
mknod /dev/ram1 b 1 1
Once this is done, it can be formatted via e.g. mkfs.ext2:
mkfs.ext2 /dev/ram1 8192
| How to create a RAM disk from the Kickstart environment? |
1,361,988,965,000 |
I'm in an odd situation where I have plenty of RAM sitting around (200gb extra) and ALMOST enough SSD to do a read/write intensive process. Is there any way to say "Dear System, please create a temp virtual drive that is a combination of the RAM and SSD, so that for some of the read/write operations that are backed b... |
Well, yes, but actually no.
While it is possible to create a virtual disk in RAM, it's not handled the same way other disks are. In particular, it doesn't have a device node in /dev, so it isn't visible to features like "LVM" or "mdadm" (which could otherwise be used to join two different disks into one big virtual di... | Make a temp virtual RAM disk from some RAM + some SSD |
1,361,988,965,000 |
When mounting a tmpfs we can pass as an option its (maximum) size and prevent the relevant fs from growing indefinitely and thus consuming all of our RAM, e.g.
$ mkdir -p /tmp/shmemory
$ sudo mount -t tmpfs -o size=1G noname /tmp/shmemory/
$ mount | grep -i shmem
noname on /tmp/shmemory type tmpfs (rw,relatime,size=... |
mount never shows the size of filesystem.
Use df instead:
df /tmp/shmemory
That will show you desired information.
| Find size of shared memory tmpfs |
1,361,988,965,000 |
I have been experimenting with etckeeper to store different snapshots of /etc in a git repo.
I have cloned a working /etc in /etc-1 of a clean VPS and I have restored metadata with etckeeper, the I have deleted /etc and I have made a symbolic link of /etc to /etc-1.
I could not connect from ssh after reboot, so I logg... |
Those are created if the system has a ramdisk. I doubt that's the source of your problem though. Go back in time: before you delete /etc, compare /etc and /etc-1 with diff -q to see if etckeeper really cloned /etc fully.
| Missing /dev/ram0 /dev/ram1 and /proc/kcore |
1,361,988,965,000 |
I am following the book "Mastering Embedded Linux Programming - Second Edition" trying to boot up the Linux kernel mounting a ramdisk.
I have U-boot 2020.01 working and the Linux kernel image made. I have made a file system on my computer where I have added busybox and the libraries required by it manually as so files... |
Simple answer
You need to enable CONFIG_LEGACY_IMAGE_FORMAT in U-Boot:
Go to the u-boot source directory.
Type: $ make menuconfig
In Boot images -> Enable support for the legacy image format
Exit and save, then build U-Boot again
Now it will be able to load your uRamdisk :-)
Longer answer
The book was written using ... | U-Boot "Wrong Ramdisk Image Format" with initramfs on BeagleBone black |
1,361,988,965,000 |
To create a ramdisk (Ubuntu 18.04), I issued "sudo mkdir /mnt/ramdisk" at the Putty terminal prompt. Then I issued "mount | tail -n 1" and it returned:
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=100912k,mode=700,uid=1000,gid=1000)
Now to unmount I issued "sudo umount /mnt/ramdisk/" but it sai... |
The ramdisk created by the system at /run/user/1000 is for system processes and I would create a new, dedicated one if you wish to use it for your own purposes.
sudo mkdir /mnt/ramdisk will create a folder called ramdisk in the folder /mnt but not a ram disk.
If you wish to mount a RAM disk to the /mnt/ramdisk folder,... | Ramdisk mounted at mnt/ramdisk goes to /run/user |
1,361,988,965,000 |
Having a bsd.rd extracted from an installation image and mounted as a vnode I can see there is 0.2MB free space available for additional files such as used during unattended installation.
I want to copy a file 1MB in size but it obviously won't fit.
Having that said, is there any way to increase the size of the ramdis... |
Someone came up with a similar question some time ago on the [email protected] mailing list. Quoting directly Stuart Henderson's answer:
Hello, I want to build "bigger" bsd.rd image. Does rebuilding it only way
to increase it? Can I somehow increase its size and just rdsetroot new
disk.fs?
You'll need to build a r... | Is it possible to increase the size of OpenBSD's bsd.rd without building it from source? |
1,361,988,965,000 |
Background
I'm trying to download about 150GB to a newly-created Linux box (AWS EC2) with 100gbps network connection at full speed (12.5GB/s) or close to that. The network end is working well. However, I'm struggling to find anywhere on the box that I can put all the data fast enough to keep up, even though the box ha... |
On a tmpfs filesystem I can copy 64 files of 1.6 GB (in total 100GB) in 7.8 sec by running 64 jobs in parallel. That is pretty close to your 100 Gbit/s.
So if you run this in parallel (meta code):
curl byte 1G..2G | write_to file.out position 1G..2G
ẁrite_to could be implemented with mmap.
Maybe you can simply write... | Allocate RAM block device faster than Linux kernel can normally allocate memory |
1,430,142,974,000 |
I know from experience that the ~/.exrc file can be used to configure vim. I also know that the ~/.vimrc file can be used for the same purpose.
However, If I use .exrc to configure vim, this leads to problems on systems where vi is installed rather than vim. Namely, vim supports extra features that vi does not; and w... |
.exrc is the configuration file for vi, whereas .vimrc is the config file for vim
No. Vim will use the .vimrc file if present, otherwise the .exrc file if present
Yes, unless you only put vi-compatible commands in there
From the Vim help on exrc:
c. Four places are searched for initializations. The first that exis... | What is the difference between .exrc and .vimrc? |
1,430,142,974,000 |
I recetnly came across
setopt extended_glob
...in order to enable extended globbing which allows for a number of cool wildcard additions, like excluding specific patterns, for example:
ls ^foo*
...will use ls on every path in your current directory except for patterns that match foo*.
I found one tutorial suggesting... |
I would assume the potential issue is that ^ is quite a valid character in file names, so the meaning of a pattern containing it changes based on if the option is set or not:
$ touch 'foo' 'bar' '^foo' '^bar'
$ ls ^foo*
^foo
$ setopt extendedglob
$ ls ^foo*
bar ^bar ^foo
A standard shell would take the ^... | zsh: is there a problem with always enabling extended glob? |
1,430,142,974,000 |
I have a script that runs a command via zsh -c. However, when zsh runs, it doesn't appear to load ~/.zshrc.
I understand a login shell flag exists, but even zsh -lc <command> doesn't seem to work.
How can I get functions, aliases, and variables defined in my ~/.zshrc to populate when running it with zsh -c?
|
zsh do not read .zshrc in non-interactive shell, but zsh allow you to invoke an interactive shell to run a script:
$ zsh -ic 'type f'
f is a shell function
or you can always source .zshrc manually:
$ zsh -c '. ~/.zshrc; type f'
f is a shell function
| Run .zshrc when passing command via -c |
1,430,142,974,000 |
I've read and understood about how you create a daemon process, but from everything I read I never really understood why it needs to be done.
I've read that we do the fork - setsid - fork to avoid the process to gain control of a terminal, but what does this mean ?
If I start a program in the background using & (for ... |
That's more than one question, each could have long answers. Briefly
If I start a program in the background using & (for example './script &' ), what makes this process' execution different than if I ran normally a program that turns itself into a daemon ?
Running a program in the background, it no longer is directl... | Why do we daemonize processes? [closed] |
1,430,142,974,000 |
Mac's Terminal comes with a default PROMPT_COMMAND that checks the history and updates the current working directory (title of the tab):
Add echo $PROMPT_COMMAND to the top of your .bash_profile and you'll see:
shell_session_history_check; update_terminal_cwd
I want to add my own PROMPT_COMMAND without over-writing... |
# If PC contains anything, add semicolon and space
if [ ! -z "$PROMPT_COMMAND" ]; then
PROMPT_COMMAND="$PROMPT_COMMAND; "
fi
# Add custom PC
PROMPT_COMMAND=$PROMPT_COMMAND'CUSTOM_PC_HERE'
| How can I customize $PROMPT_COMMAND without overwriting the default (if present)? |
1,430,142,974,000 |
I am trying to edit the lxde-rc.xml file (in ~/.config/openbox) so I can implement Window snapping like in Microsoft Windows. When a window is dragged to the right edge of the screen, it maximizes to fill the right half of the screen. I don't want to use a tiling wm, but edit the configuration for openbox. I have foun... |
Mouse binding to toggle an action when dragging to screen edge: There doesn't seem to be an obvious way to have Openbox detect dragging a window to the edge of the screen as a <mousebind> action. It might be easiest to basically set up hot corners, such as with behave_screen_edge in xdotool, and use those to trigger t... | OpenBox Mouse binding for dragging window to screen edge |
1,430,142,974,000 |
Summary
--ignore=<regex> lines that I put in my .stowrc does not work. When running Stow, it says "Loading defaults from .stowrc", yet it has no effect. But passing the --ignore=<regex> lines to the command directly works.
Problem
Assume this directory:
user@user-machine:~/test-stow/stow$ tree -a
.
├── a
│ └── car
└... |
Thanks for the excellent bug report! I can answer your questions, and as the Stow maintainer I can also fix the issues, but I'd appreciate your feedback from a UX perspective so we can figure out the best fix.
Firstly, it's worth noting that --verbose=5 will give you much more detail about the internals of the ignore... | Stow doesn't use the "ignore" option given in the rc file |
1,430,142,974,000 |
Is it possible to have a conditional within /etc/rc.local?
I've checked many Q&As and most people suggest running chmod +x on it, but my problem is different. It actually does work for me without conditionals, but doesn't otherwise.
#!/bin/sh
if [[ -e /usr/src/an-existing-file ]]
then
echo "seen" >> /etc/rclocalm... |
The [[ ... ]] syntax isn't valid for /bin/sh. Try:
if [ -e /usr/src/an-existing-file ]
then
echo "seen" >> /etc/rclocalmadethis
fi
Note that sometimes it works because /bin/sh -> /bin/bash or some other shell that supports that syntax, but you can't depend on that being the case (as you see here).
You can run ls... | Is it possible to have conditionals in /etc/rc.local? |
1,430,142,974,000 |
I was trying to create a program that runs at start-up that takes a picture every 10 seconds (In a infinite loop) on my raspberry pi but I discovered I had made a mistake but couldn't Ctrl+C out of it. Is there a way to escape?
(I did try to go to a different workspace but login prompt wouldn't show.)
|
If you start the program from rc.local, then you cannot login to a shell and type ctrl-c to stop it. The reason is that the program was not started from the shell that you're logged into.
You will find the process ID (pid) of the program and use the kill command to send the process a signal, causing it to terminate.
... | How can I kill a program started from rc.local when Ctrl-C doesn't work? |
1,430,142,974,000 |
I using embedded Linux, I have compiled the kernel without initramfs and kernel is booting fine. But It shows me rcS file is not found I have put it in /etc/init.d/rcS and my rcS file look like
#!/bin/sh
echo "Hello world"
After the file system is mounted by the kernel it prints Hello world.
Can any one tell/explain ... |
/etc/init.d/rcS allows you to run additional programs at boot time. Its typical use is to mount additional filesystems (only the root filesystem is mounted at that point) and launch some daemons.
Usually rcS is a shell script, which can easily be customized on the fly. Typical distributions make rcS a simple script th... | Why is rcS required after file system is mounted by the kernel? |
1,430,142,974,000 |
I just recently switched to the fish shell from bash and I am having trouble sourcing my dircolors template file to get custom colors to appear for certain file extensions.
In bash, I was sourcing a template from ~/.dircolors/dircolors.256dark. The dircolors.256dark template has different file types mapped to differe... |
The solution was actually pretty simple. Within my ~/.config/fish/config.fish file, I just needed to drop the "$" from the eval statement. So it would look like this:
# uses dircolors template
eval (gdircolors ~/.dircolors/dircolors.256dark)
# Aliases
alias ls='gls --color=auto'
| Using ~/.dircolors in fish shell |
1,430,142,974,000 |
I want to know how to check whether a command is installed.
Specifically, I want to alias vi to vim on all machines where vim is a valid command. And I want to keep my *rc files generic. But some OSes don't come with vim installed by default. And in others, vi is Vi IMproved, yet vim isn't a valid command.
I figure... |
You can use command e.g.:
command -v vim
It is a shell built-in command. (zsh, bash, ksh, but not tcsh)
In tcsh you can use this:
~> sh -c 'command -v vim'
| How to check if vim is installed? |
1,430,142,974,000 |
I have a tmux triggering script as mentioned below, running on Raspbian Wheezy 7.10:
Step 1
#!/bin/bash
# this script is called "sess"
tmux new-session -d -s sess1 'sudo /home/pi/bin/myscript.py'
exit 0
I have checked the running script as follows :
first by running the python script sudo /home/pi/bin/myscript.p... |
The most optimized solution to troubleshoot any detached script using tmux will require you to use the following option within your triggering script:
#!/bin/bash
# this script is called "sess"
tmux new-session -d -s sess1
# this statement is a life-saver for tmux detached sessions
tmux set-option -t sess1 set-remai... | Cannot trigger tmux script on boot |
1,430,142,974,000 |
I'm curious:
What, exactly are the benefits to statically linking modules into the kernel rather than loading through rc.conf, etc?
For example:
To add Linux emulation, I could add linux_enable="YES" to /etc/rc.conf, or I could link it into the kernel by adding options COMPAT_LINUX to my kernel config.
Is there actual... |
Statically linking used to be the only way to load a module which is think is the primary reason to having options like COMPAT_LINUX. Also, prior to loader, it used to be the only way to load modules necessary to get FreeBSD to get the necessary drivers to mount the root file system and boot FreeBSD. Nowadays, I don... | Difference between rc.conf, loader.conf and static kernel linking in FreeBSD |
1,430,142,974,000 |
Issue
Many apt-get installs are failing b/c the system can't determine current runlevel
Background specs:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.1 LTS
Release: 16.04
Codename: xenial
$ uname -a
Linux systemName 4.4.0-43-Microsoft #1-Microsoft Wed... |
Windows Subsystem for Linux 1 (WSL 1) is just a compatibility layer for running Linux binary executables on Windows. It does not provide much more functionality beyond that. Especially in your case you encountered two unsupported components / functions:
Runlevels
WSL does not run as a separate instance of an operating... | Windows Subsystem for Linux is unable to determine current runlevel |
1,430,142,974,000 |
I tried to display the list of startup scripts for the current runlevel at bootup. I wrote the following code.
rl=`runlevel | cut -d " " -f2`
ls /etc/rc.d/rc$rl.d/S* | cut -d "/" -f5
sleep 10
It's working if I put this code in rc.local file.
But it's not working if I put it in rc file or in a separate script file ab... |
rc is typically not used by Linux distributions but is used in BSD
rc.local is used to be able to execute additional commands during the startup without having to add symlinks.
rc.sysinit seems to be Red Hat specific and is executed very early in the process. It is executed as one of the first scripts while rc.local... | What is the difference between rc, rc.local and rc.sysinit? |
1,430,142,974,000 |
Am using an open source .vimrc file from GitHub, but it is screwing up my default mouse right click, copy-paste actions. Whenever I do a right click, it enters into the visual mode and I am having a hard time, doing a copy-paste when I'm inter-working with my Windows machine.
Let me know what .vimrc config lines to d... |
As @VincentNivoliers said in his comment, your issue comes from the line mouse=a.
It enables the mouse in all modes of vim, ie letting you put the cursor where you click.
a means this is active in all modes. If you don't want vim to care about your mouse, just set mouse= (no value). Then, you could use your mouse to c... | My .vimrc file disabled the copy/paste action using mouse right click! |
1,430,142,974,000 |
I have an application that needs a modified LD_PRELOAD.
I want to start the application using the originally provided rc script, so I can benefit from an automatically updated rc script on an update of the application. I can't modify the original rc script of course, because any change would be lost on the next update... |
The best way is probably to create your own rc-script that you will use instead of the "official one".
Otherwise, your rc-script probably includes an external "config" file if you check it. The include may look like this:
. /etc/default/mydaemon-config
So that you can edit /etc/default/mydaemon-config and do someth... | Automatically start an application with a modifed LD_PRELOAD? |
1,430,142,974,000 |
I have installed rescuetime on debian 9. It requires the command rescuetime to be run in a terminal, this just keeps running rather than running and closing (it adds an icon into the tray at the bottom left of the screen). I'm having some difficulty getting this to run on startup.
I have tried crontab and added @reb... |
Add the commandline to 'startup applications'.
This worked for me (at least on Ubuntu 18.04).
| How to automatically start Rescuetime on startup (tried crontab and rc.local) |
1,430,142,974,000 |
I have a Git repo that is authenticated with an SSH key - the key is not the standard id_rsa.
I can run:
eval $(ssh-agent -s)
ssh-add /home/forge/.ssh/otherkey
Then
git pull origin master
This is working.
The server needs to do a git pull on boot.
So I have code in rc.local that pull the repo it's working only when... |
You can add ssh key file using ssh config.
Here is default for all users /etc/ssh/ssh_config
Here is for current user ~/.ssh/config
Example of current user ssh config per host:
## Home nas server ##
Host nas01
HostName 192.168.1.100
User root
IdentityFile ~/.ssh/nas01.key
## Login AWS Cloud ##
Host aw... | Add an SSH key on boot |
1,430,142,974,000 |
I am running a single-user FreeBSD and I am trying to edit rc.conf but it appears to be read-only for some reason. I can't change it from the root account. Indeed, id gives:
uid=0(root) gid=0(wheel) groups=0(wheel),5(operator)
Trying to mount with mount -u -w does not help either.
|
This is mentioned in the FreeBSD FAQ's System Administration section.
See especially section 10.5, which is aptly named I made a mistake in rc.conf, or another startup file, and now I cannot edit it because the file system is read-only. What should I do?.
10. System Administration
10.1. Where are the system start-up c... | FreeBSD: /etc/rc.conf persistently read-only |
1,430,142,974,000 |
What is the proper way to checkout a bunch of .*rc files into a home directory?
I've seen lots of github repos online and people usually name them dotfiles, and I guess they get checked out into their home directory; but what I don't understand is...
How does one keep their other home files (specific to that machine) ... |
An option is to use symbolic links. For example, say I have my git checkout out in ~/.dotfiles. I might have:
.vimrc -> ~/.dotfiles/vimrc
.bashrc -> ~/.dotfiles/bashrc
.bash_login -> ~/.dotfiles/bash_profile
...
I would not, personally, check my home directory itself into the repo.
| Proper way to checkout home directory .rc files from a git repo? |
1,430,142,974,000 |
Recently my Unison started throwing up some strange error whenever I tried to sync between my laptop and my PC. I realized that I had added a line in bashrc that would print my pending tasks whenever I would open a terminal.
The line added in my bashrc:
task list #this command comes from a small utility called task... |
You can test if the output of the script (i.e. rc file) is a terminal if not; if it is it should be safe to output text, and if not a terminal don't output anything:
if [ -t 0 ]; then
# check your jobs here and print any info you want to see
fi
| Separate bashrc file for ssh sessions to avoid Unison Errors |
1,430,142,974,000 |
I'd like to launch neofetch (a small utility that displays a banner) each time I log into a remote server via OpenSSH. So, I just added /usr/bin/neofetch into my ~/.ssh/rc file, and it works fine.
The problem is that ~/.ssh/rc is also parsed when I scp into the server. A complete scp command works just fine, there is ... |
The environment variable SSH_TTY seems to be set only when sshing, not when scping. So the following suffices (at least in my testing):
if [ -n "$SSH_TTY" ]; then /usr/bin/neofetch; fi
(For what it's worth, I guessed this by looking at the output of env | grep -i ssh.)
| how to distinguish ssh from scp in ~/.ssh/rc? |
1,430,142,974,000 |
I have installed kde4 (via running # pkg_add kde4) on my OpenBSD 6.0 VM and I would like to automatically boot KDM on startup. I have followed the most applicable guide Google found me, but it didn't work. Specifically adding:
kdm_flags=""
if [ "X${kdm_flags}" != X"NO" ]; then
/usr/local/bin/kdm ${kdm_flags} ;
... |
Leave /etc/rc.conf as is. It even has a prominent header saying DO NOT EDIT THIS FILE!!, twice. Instead, modify /etc/rc.conf.local. But you don't need to do even that:
Tested on OpenBSD 6.1-stable (amd64) running in a VirtualBox VM (this installs kde4-4.14.3 and enables KDM):
$ doas pkg_add kde4
$ doas rcctl enable kd... | How to autostart KDM on boot in OpenBSD 6.0? |
1,430,142,974,000 |
I have following in my .zshrc:
zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'
When I press TAB, in addition to processes being listed, there is always a last line containing the digit 0.
why is that? Can I get rid of it?
|
If you run:
zstyle ':completion:*' format 'Completing %d'
And try again, you'll see:
Completing process-group
Just above that 0. kill 0 does kill the current process group. See https://www.zsh.org/mla/workers/2014/msg00713.html for the rationale, though I'll have to admit neither their explanation nor the code in ... | zsh completion for kill listing unexpected "0" |
1,430,142,974,000 |
I have a small backup bash script that I wrote for my computer at work. I have copied the script into /etc/rc0.d/ and called it K01backup so it is executed before anything else upon shutdown. It backs up all the data from my computer (running Ubuntu 14.04LTS) and my working copies and a virtual machine located on a se... |
The README in that directory states that scripts in that directory are only called once on poweroff (and not on reboot).
With a simple test program
#!/bin/bash
LOG=/root/backup.log
date >> $LOG
echo $* >> $LOG
I noticed that one time the program was actually called twice, once without a parameter and once with the... | Shutdown script seems to be executed twice |
1,430,142,974,000 |
I have a Raspberry without screen/keyboard/mouse that does nothing else than launching a radio stream at startup :
mplayer http://95.81.146.2/fip/all/fiphautdebit.mp3
I have put this command at the end of /etc/rc.local. Unfortunately, 50% of the time, the playing doesn't start (maybe because the WIFI wasn't properly ... |
Instead of running mplayer directly from your start up, I would write a script and run that instead.
Your script would eventually just run the same mplayer command you have given, but before hand you could check that your wifi connection is up and working (maybe by pinging your router), this gives your script control.... | Launch a command at the end of Linux startup |
1,430,142,974,000 |
At work, I'm running linux, and use vagrant on a daily basis. What I find annoying is that the system often hangs when I reboot/shut down, if I forgot to vagrant halt any virtual boxes I may have fired up.
To counter this, I'd like to write a shutdown script, along the lines of:
#! /bin/sh
cd ~/vagrants/vagrant_1
vagr... |
If you don't do something special vagrant is a wrapping for virtualbox.
You can get a list of running virtualboxes:
vboxmanage list runningvms
and parse the output to get a vmname, then do:
VBoxManage controlvm <vmname> acpipowerbutton
Have to do this as the user that started the VMs
Put a link to the script in /etc... | local shutdown scripts (do's and don't's) |
1,430,142,974,000 |
There are many "built-in" softwares for OpenBSD, ex.: NTP, LDAP, RADIUS, etc., see all (?):
https://github.com/openbsd/src/blob/master/etc/rc.conf
in the rc.conf file.
The question: Currently, 2017 Dec, I cannot find any database software by default, is this true?
I know I can install several from the ports, but I ... |
There is currently no database software (in the conventional sense) included in the OpenBSD base installation. SQLite was part of the base system, but that too has been put back into the ports system with the release of 6.1.
The OpenBSD developers are unlikely to include any software in the base system that is "big" ... | Is there any database solution that can do master-master replication by default on OpenBSD? |
1,430,142,974,000 |
I am trying to configure Openbox's rc.xml file in order to manipulate my soundcards with one keypress. Because I have multiple sound cards on my system I have to manipulate multiple sinks at once so I use multiple commands separated with & like this:
<keybind key="XF86AudioRaiseVolumen">
<action name="Execute"... |
You need to put the commands into a shell script, make that script executable and then uses this script as the command.
<command>/usr/local/bin/volume_up</command>
The contents of /usr/local/bin/volume_up
#!/bin/sh
pactl set-sink-volume alsa_output.usb-Focusrite_Scarlett_2i4_USB-00.multichannel-output +5% &
pactl set... | Openbox - multiple commands separated with & for one keypress |
1,426,032,517,000 |
I (new to linux) am attempting to add a command to the boot up that will execute an application. The application accepts parameters and has simple output of what it is doing. To troubleshoot it, how can I see what the output is when it attempts to start up (or not start at all)? When I run the command, it works. Whend... |
According to this answer:
Unless a command has output or logging already configured, rc.local
commands will not log anywhere.
If you want to see logs for specific commands, try redirecting the
stdout and stderr for rc.local to somewhere you can check. Try
adding this to the top of your /etc/rc.local file.
exec ... | Understanding rc.local and troubleshooting |
1,426,032,517,000 |
I have Ubuntu-server 16.04. Installed gtk3 and can execute my program manually by this command: ./img when I go to it's directory /home/m.
But when I tried to add this line to my /etc/rc.local file:
/home/m/img &
It didn't work. This is my rc.local full content:
startx
/home/m/img &
exit 0
Then I tried to create ~/... |
**Also I like to hide my mouse pointer and my windows borders but don't know how?
You can append -- -nocursor to your startx to hide mouse pointer:
exec startx -- -nocursor
There are files ~/.config/openbox/rc.xml and /etc/xdg/openbox/rc.xml for you to edit (ref: http://openbox.org/wiki/Help:Configuration) , e.g. (... | My ubuntu-server doesn't execute my gtk-based program at startup! |
1,426,032,517,000 |
Background: On my Debian Stretch machine at home, I've noticed my DNS lookup times are pretty slow, and have concluded that the culprit is dnsmasq - since if I take it down, name resolution becomes > 10x faster (no multi-second delays). Now, it's probably some misconfiguration, but I was lazy and wanted to just remove... |
Lazyness rules ;)
If you don't want to remove the program itself:
sudo update-rc.d -f dnsmasq remove
| Trouble update-rc.d remove'ing dnsmasq on Debian Stretch |
1,426,032,517,000 |
Background:
I have a Python script that runs (infinitely) from startup in the background of a Ubuntu server. The process is ended by sending a SIGINT which is handled by the script which finishes all jobs before exiting. If anyone were to shutdown the server, thus terminating the script, important data will be lost. I... |
You linked your script to K99. When changing runlevel, the K* scripts are called with option stop, and the S* scripts are called with option start, or stop for runlevel 0 (shutdown). They are called in numerical order.
So you should remove your K99 links and replace them by K00 links so they are executed first (befor... | Prevent shutdown using shell script run at shutdown |
1,426,032,517,000 |
Whenever I ssh to my desktop, I change $TERM to ansi so that ssh works better with the Windows terminal. I decided to create ~/.ssh/rc and add TERM=ansi to it. The problem is, after I ssh into my desktop, the terminal type is still msys instead of ansi. Is there a way to fix this?
|
I couldn't get the TERM setting to work from ~/.ssh/rc either.
I could get it to work by changing the following in /etc/ssh/sshd_config
PermitUserEnvironment yes
followed by a restart of sshd and taking into account the warning from man sshd_config,
PermitUserEnvironment
Specifies whether ~/.ssh/environment and envi... | .ssh/rc not working |
1,426,032,517,000 |
I have a binary file that needs to run at startup on all accounts (including unprivileged user accounts), so a command to run it will be put into /etc/rc.local. The program itself will have only execute permissions so that it cannot be read or modified by an unprivileged user. It is located in /usr/bin.
However, it ne... |
If it, as you say, "needs to run at startup on an unpriveleged user account", then it will necessarily have access to all files that the unpriveleged user account in question has access to.
You could create a dedicated unpriveleged user account for the purpose of running the script. Set the permissions on the secret k... | File that is only readable with root privileges |
1,426,032,517,000 |
I'm trying to configure multiple Zope-Instances as daemons in FreeBSD. Each instance gets a start script in /usr/local/etc/rc.d. Starting works fine, but invoking status or stop is problematic because the PIDs of the running instances get confused (although the PIDs are different, the startscript cannot tell them apar... |
I think you are on the right path but that you expect the rc framework to handle more things automatically than it actually does.
It looks like you might be familiar with Practical rc.d scripting in BSD as you touch upon:
For instance, stop must know the PID of the process to terminate it.
In the present case, rc.... | rc scripts for multiple Zope instances in FreeBSD |
1,426,032,517,000 |
I put a python script with an infinite loop into /etc/rc.local but the machine boots successfully, which confuses me.
The /etc/rc.local content:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on erro... |
Assuming that Raspbian Stretch uses systemd like regular Debian Stretch does by default, /etc/rc.local is started by /lib/systemd/system/rc-local.service:
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License... | boot normally even with an infinite loop in /etc/rc.local |
1,426,032,517,000 |
I'm trying to set my color syntax highlighting in nano, but it doesn't work as expected.
One system everything works. This is an Fedora 21 laptop.
Two systems everything I've tried except man something works. This
is an Fedora 21 desktop and an Fedora 21 vm in VirtualBox.
One system only one file I've tried works(ope... |
I since found that there is a bug in nano < 2.7.4-1
nano: /etc/nanorc is ignored, if ~/.nanorc exists
Latest from the bug report:
I just made the dist-upgrade to Debian 9.0,
which included an update of package nano to version 2.7.4-1
and the problem vanished, the bug is solved in 2.7.4-1.
The bug report:
bug
| Color syntax highlighting working on one system but not the others. Same nanorc file |
1,426,032,517,000 |
I have been trying to get Forgejo running in a Truenas Core (FreeBSD jail) for over a week. When I manually start Forgejo as the git user it runs as expected, however attempting to get it to run with the included rc file provided by the ports package it errors out.
Forgejo Port
rc.d script
When I start forgejo manuall... |
2024-03-07, archived:
WARNING - don't upgrade your TrueNAS CORE jails to FreeBSD 13.3 just yet | TrueNAS Community
Today, https://forums.freebsd.org/threads/forgejo-failing-to-start-as-service-pid-file-not-readable.93214/#post-653734:
FreeBSD 13.3
TrueNAS CORE 13.3 is not yet released.
TrueNAS CORE 13.3 Plans - An... | Forgejo pid file (/var/run/forgejo.pid) : not readable in Truenas Core (FreeBSD Jail) |
1,426,032,517,000 |
Is there a way to join an interactive session of a process that was ran on boot with /etc/rc.local, or send it "stop" over STDIN on reboot/shutdown and wait for it to end before shutting down?
|
As has been explained in comments, you need to “save” the process's stdin somehow. By default, depending on the init system, this may be the console, or /dev/null. To be able to attach to the process, use a screen multiplexer such as Screen or tmux. See also How can I disown a running process and associate it to a new... | Join an interactive session of a process launched from rc.local |
1,426,032,517,000 |
I have a simple script that asks for user input ([y/N]) and then acts upon it. I wrote a daemon rc wrapper so that it can run from startup. I was wondering if it is possible to make the daemon/script ask for the user input and then background itself until it is time to ask again, at which point it foregrounds itself? ... |
Don't block the startup process for the sake of one service, unless it's some absolutely critical service without which the machine is unusable (e.g. entering a passphrase to decrypt the OS disk).
If some service needs manual intervention to start (which should be avoided if at all possible, unless you like getting pa... | RC script that brings itself to foreground under certain criteria |
1,426,032,517,000 |
I've been using GNU/Linux for over a year now. And there's this question to which I need an answer from you, Linux gurus:
What language(s) do config files like .bashrc, .vimrc, .i3status.conf, .conkyrc, .xinitrc, etc. use?
|
There's no global standard. They can be (and are) all different syntaxes.
For example,
the bashrc is simply a bash script,
the vimrc a vimscript script,
i3 uses its own syntax that's pretty
close to a scripting language (but they
claim it isn't a
programming language, but I think they're lying there, the conditional ... | What language do config files use? |
1,426,032,517,000 |
Something wrong with one service on FreeBSD 7.3:
1) it starts with command "service my_secret_service start" but later if I enter "service my_secret_service status" - it shows as not running. But in processes it exists (ps auwx | grep secret_service) with all threads (python threads) and I can see that it's working be... |
When you use the service command in will look for the process id (pid) as it was set when it was started. Your service has it defined as:
pidfile="/var/run/secret_service/${name}.pid"
When you ask for status the pid will be fetched from this file and it will check if the process is running.
If you examine the output ... | FreeBSD 7.3: service is working, but status shows "is not running" |
1,426,032,517,000 |
I can successfully start slapd on FreeBSD 11 perfectly fine, but it won't run on startup. Here is what I put in my rc.conf:
slapd_enable="YES"
slapd_flags="-h "ldap://1.2.3.4/ ldapi://%2fvar%2frun%2fopenldap%2fldapi/""
slapd_sockets="/var/run/openldap/ldapi"
1.2.3.4 is replaced with my actual public IP.
I have tried ... |
I didn't post this until I had searched for days, and I just now found the answer. If no one else finds this useful, I'll end up deleting, but here it is:
https://forums.freebsd.org/threads/58365/
Basically, if networking isn't up yet, then it cannot bind and will fail. The solution is to edit /usr/local/etc/rc.d/slap... | slapd doesn't start automatically despite rc.conf entry |
1,426,032,517,000 |
I need to run a script before shutting down or rebooting my VPS running Debian 8,to keep count of network statistics.I tried adding the script directly to /etc/init.d and symlinking it in /etc/rc0.d and /etc/rc6.d, and adding to it the LSB header, making it like an actual service with start and stop and generating the... |
This works for me as /etc/systemd/system/netstat.service:
[Unit]
Description=Save interface stats on shutdown
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/true
ExecStop=/bin/sh -c '{ date; ip -s link; } >>/root/ipstat.log'
[Install]
WantedBy=multi-user.target
Enable it with systemctl enable netstat. T... | Execute simple script before shutdown and reboot |
1,426,032,517,000 |
I was trying to find out how to run a script at startup and during shutdown during which I got to know that level 6 corresponds to reboot in ubuntu. When I opened the /etc/rc6.d every link's name started with K which is for kill I suppose.
|
The K does indeed stand for “kill”. The symlinks link all the init scripts which are supposed to be called to stop the corresponding service when the system switches to runlevel 6; this tries to ensure that all the system’s services are stopped correctly before the system reboots. Each link is called with a stop argum... | Why do all the links in /etc/rc6.d start with K if runlevel 6 corresponds to reboot? |
1,426,032,517,000 |
I currently have scripts in the rc.# S## ...
one of my scripts is called:
S20cheese and another is called S19Moo. How would I properly update these run orders e.g. S20cheese -> S15cheese.
Is it as simple as renaming the files in every rc.2 / rc.3 etc etc or will this break things?
I am trying to set the run order as ... |
update-rc.d -f cheese remove
update-rc.d cheese defaults 15
| change boot order in rc.d |
1,426,032,517,000 |
I mount some nfs exports from a fileserver to my workstation.
The workstation is ubuntustudio 64bit 14.04.
in order to make the mounts as transparent as possible, I have inserted the following in my .bashrc
SG=sg
mount | grep $SG &> /dev/null
if [ $? -eq 1 ] ; then
sudo mount -o vers=3 fileserver:/nfs/home/na... |
Could you add the mount command to /etc/fstab instead of doing it with a script? As for the second part, rc.local is run by root by default, so if you aren't taking steps to run as nass you will be mounting the NFS share as /root/sg. If you want it to run as a different user from rc.local you would have to do someth... | run a script from rc.local, that exists on an autofs nfs share |
1,426,032,517,000 |
I have a very simple SysVinit service in /etc/rc.d:
#!/bin/bash
PIDFILE="/var/run/test.pid"
status() {
if [ -f "$PIDFILE" ]; then
echo 'Service running'
return 1
fi
return 0
}
start() {
if [ -f "$PIDFILE" ] && kill -0 "$(cat "$PIDFILE")"; then
echo 'Service already running'
return 1
fi
e... |
It looks like Synology moved from classic SysVinit to upstart in DSM 6 or so, and then to systemd in DSM 7. Both init systems provide backward compatibility for classic SysVinit-style start/stop scripts, but there are some quirks you should be aware of.
If you have DSM 7.0 or newer, then after installing the script yo... | Stop not called for init rc.d service |
1,426,032,517,000 |
I'm a relatively new Linux user. I started with Ubuntu 20.04 a few months ago, and eased myself into the experience, learning a bit of the command line and becoming familiar with the system structure
I'd now like to move up a bit in the world, and improve my productivity by working on a tiling window manager. I've sta... |
I use a pretty minimal i3 install.
The only things I've had to add are:
dmenu to launch applications,
i3status for a status bar in the bottom.
nm-applet for networking from the status bar
Commands in a config file to map XF86Audio* keys to pactl actions.
The other things that DEs give you are default applications fo... | What are the key components of a desktop environment? |
1,288,013,569,000 |
I am using gtk-recordmydesktop to record the video output to my desktop. However, the videos have no sound. All the tutorials I found regarding this involved getting sound recorded from a microphone, while I am interested in getting the sound output recorded. How can I do this? The official FAQ says "The solution is i... |
I managed to get it going with the steps on the Ubuntu Forums, for clarity here is what I did:
sudo apt-get install gtk-recordmydesktop pavucontrol
Opened the Pulse Audio Volume Control dialog: Applications > Sound & Video > PulseAudio Volume Control
Opened gtk-recordmydesktop
In gtk-rmd advanced preferences, "Sound"... | How can I record the sound output with gtk-recordmydesktop? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.