Questions tagged [write]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
19 views

Can't write anything to USB drive. HTOP says 'disk sleep (uninterruptible)'

I was trying to 'burn' a ISO to my usb flash drive using the good ol' dd if=some-linux-distro.iso of=/dev/sdb bs=4M && sync but the process took a long time. So, I looked at the process in ...
0
votes
0answers
13 views

Fast large-write performance with LVM RAID5?

I have a use-case that is dominated by large sequential writes. Seems to me that striped RAID5 performance for large writes should approach the performance of striped RAID0. Say you configured RAID5 ...
2
votes
2answers
3k views

Stress (write) Test an SD card to destruction using a simple shell script

I would like to find out how many write cycles I can get from my SD card. I have googled and found good answers like this but its too complicated for a normal person like me. Say its a 64GB exfat ...
0
votes
0answers
20 views

Why file copy waits for disk write? Copy from slower hdd to a faster one

I see this behavior for years with many Linux distributions. When I copy a file from one hdd to another, file read freezes and waits for the write to complete a batch. In the case from my picture ...
0
votes
1answer
48 views

Background flushing of kernel buffers

My Ubuntu Xenial system is as follows: # uname -r 4.4.0-179-generic # I have the following simple C code which writes 5 bytes to a file every second, for a total of 5 times: { int fd = open("...
0
votes
0answers
7 views

Mounted network disk, how to determine whether the network disk is dropped

I'm trying to use fuse file operation for control, now I mount the network disk to the local, when cp a file to the inside, the mounted network disk suddenly dropped, in the cp file when the program ...
1
vote
0answers
37 views

ACL to change Read Write permissions of another User's files

Is there a way that sysadmin can create an ACL(ex: read_write_acl) so that all users which are assigned "read_write_acl" can modify the file permissions (only read and write) for the files ...
3
votes
2answers
64 views

How do I feed data to a pipe until it's full, no more no less?

I want to use pipes on Linux as a synchronization primitive between a master process and a slave process. The classic way is to create two pipes, but I believe there's a way to use a single fd instead....
0
votes
1answer
53 views

Write all numbers between 0 and large number (both inclusive) to a file in random order

For simulation I am trying to do, I want a text file with numbers ranging from 0 to 2^33 which is a huge number. I have used this command: seq 0 Number >> OUTPUT FILE But this is very slow. ...
2
votes
2answers
88 views

How can I simulate an unresponsive file descriptor?

We have an application that writes to a log file. In the prod environment, the log file directory is mapped to a NAS: 192.168.1.10:/storage/app/log 2554360832 11844608 2412762112 1% /usr/local/app/...
1
vote
0answers
146 views

Alternatives to dd to read/write to a disk?

I'm using cp to read/write from an SSD drive but is not fast enough. Then I used dd, which is fast, especially with the drive unpartitioned. But I ran into errors like there is no space left on ...
0
votes
1answer
351 views

What is a replacement for devmem write in a bash script?

I can use the dd command to read a memory address (ex: 0x400): dd if=/dev/mem count=4 bs=1 skip=$(( 0x400 )) But how would I write a value to physical address (ex: 0x400)? I tried this: function ...
1
vote
1answer
4k views

Why rm gives warning when deleting a write protected file?

I have a regular file and I changed its permission to 444. I understand that as the file is write protected, we can't modify or remove the contents of file but when I try to remove this file using rm, ...
-1
votes
1answer
43 views

Why does the write speed keep changing, on a msdos file-system on toshiba 64Gb USB flashdrive

I have just bought a new 64gb toshiba 2.0usb flashdrive and put 13gb on it that took about 1 1/2 hours to transfer (max). But it started out saying about 7/8mb transfer and went to 1.3mb transfer, ...
2
votes
1answer
244 views

How to write a luit command that outputs a file

I need to format a luit command so I can write a file that I'm trying to fix the encoding for. What I have right now is luit -encoding gbk cat santi.txt, but I would like this to have the output ...
0
votes
2answers
201 views

Can superuser write a file having 000 access permissions?

I know that a root user can read a file even if the access permissions are all set to 0 but i don't understand about the write and execute permissions in specific. Can a superuser write and execute a ...
0
votes
1answer
69 views

Notification 'Message Sent' for write command

I need to use the write command to send someone a message. Using a shell script if the message is sent successfully I want to have a 'Message sent!' notification pop up and if possible, end the shell ...
0
votes
1answer
76 views

How can I estimate the whole time of a write process including sync?

Progress and estimated time to write without and with sync I have found no tool (or straightforward method) that will include flushing the buffers when showing the progress and estimating the ...
1
vote
0answers
97 views

consistent writes to a file while preserving its inode

What is the best way to edit a file consistently (consistency used here in the database systems sense of the term) without changing its inode? Normally, I would write to a temporary file and then ...
-3
votes
1answer
98 views

write/wall: how to prevent non-printable characters from being escaped [closed]

Compare dd if=/dev/urandom bs=512 count=4 to write lsr < <(dd if=/dev/urandom bs=512 count=4) How do I achieve the intended behaviour? Current output: Message from qwe@hhgw11 on pts/386 at ...
1
vote
1answer
40 views

write in file starting from certain line

I have a file which looks like this: ********************************** Some notes are here Year Month Day Hour Minute Second . . . . . . . . . . . . . . . . . Undertneath this, I would like to have ...
0
votes
2answers
543 views

User messages can't be switched on Fedora

A non-root user X cannot message a user Y. This is despite both users having successfully run mesg y. I've tried following advice for similar problems on Ubuntu described in this question. No luck. A ...
2
votes
1answer
123 views

Why does terminal takes input line by line?

If I use: strace echo 'a b c' > file The bottom lines are: write(1, "a\nb\nc\nd\n", 8) = 8 but in strace echo 'a b c d' > /dev/pts/0 These lines are: write(1, "a\n", 2) ...
0
votes
2answers
99 views

Save in a file first 7 file in the directory /bin that starts with c

I have write a command in the shell of linux to count the file (in total 8) starting with 'c'in the directory /bin find /bin/[c]* -type f | wc -l What I wish to do now, it's save the name of the ...
6
votes
3answers
3k views

How can I output a command to a file, without getting a blank file on error?

I'm trying to run a command, write that to a file, and then I'm using that file for something else. The gist of what I need is: myAPICommand.exe parameters > myFile.txt The problem is that ...
0
votes
2answers
61 views

Write command working one way?

I want to communicate with my girlfriend through the write command. She's on a mac, I am on a debian laptop. I did the next steps: adduser haly apt-get install openssh-server systemctl start ssh ...
2
votes
1answer
117 views

Cannot write to sector - boot Ubuntu

So I was in an airport working and I closed my laptop. When I brought it back up again, my screen was black so I kill switched. Now when I boot, I get "cannot write to sector".
0
votes
1answer
2k views

Writing the output of a command to a file in a bash script

I am trying to write a simple bash script that executes the command tcprobe -i $1 where $1 is an mp4 file. Then, I want to write the output of this command, which should be a long string of ...
5
votes
1answer
553 views

Atomically write a file without changing inodes (preserve hard link)

The normal way to safely, atomically write a file X on Unix is: Write the new file contents to a temporary file Y. rename(2) Y to X In two steps it appears that we have done nothing but change X "...
1
vote
1answer
2k views

is `write()` asynchronous write?

From Operating System Concepts Another issue that can affect the performance of I/O is whether writes to the file system occur synchronously or asynchronously. Synchronous writes occur in ...
1
vote
1answer
74 views

Prevent Linux from writing to HDD

I have 3 HDD's, I want to install Linux Mint on HDD 3 which is currently empty and I don't want Linux to be able to write any data on the other 2 which is where all my Windows files are, is there a ...
0
votes
1answer
70 views

Why is my very old USB2 Harddisk faster than expected?

http://web1.heissa.de/usb2_speed.pdf From the spec, I would expect a max. write rate of 60 Mbyte/s. But today a simple test told me it‘s 226 MB/s. Is it possible that this is a trick of kernel 4,18 ...
0
votes
2answers
213 views

Split datetime column in csv file into MM/YYYY and time column separately and write to the same csv

I am trying to use awk, split and then print but running into error Input: id day userId itemId 1 12/1/17 8:32 2232 tv 2 1/12/18 10:18 3232 fdfs 3 2/9/18 10:50 232 fdsf ...
1
vote
1answer
2k views

Knowing when a write() on a serial port has finished transmitting data

I need to synchronize an IO pin value with a write to a serial port from user space (because I wasn't yet able to do it from kernel space - see my other question). My code (leaving out error checking) ...
1
vote
2answers
76 views

Can we use read(), write() on a directory in unix/linux?

Can we use read(), write() on a directory just like on any other file in Unix/Linux? I have a confusion here because directories are also considered as files.
0
votes
1answer
767 views

How to use write command to send message to user in debian stretch

who command show that xyz user is on tty2. $ who xyz tty2 2018-06-22 08:18 (:0) I trying send message to xyz using write xyz command. But it does not shows on terminal. When I run tty ...
2
votes
1answer
104 views

Prevent battery drain from constant write IO churn by browsers

For some reason, common browsers (Chromium is particularly bad, but Firefox isn't much better) generate constant IO load, particularly writes, on my Debian system. This is the case even when the ...
1
vote
1answer
713 views

Simulating slow down of disk operations

we know that there exist some excellent tool like netem which make it possible to slow down network parameters (like bandtwidth and so on). Is there exists analogous tool for simulating slow down ...
-2
votes
1answer
30 views

Loop until find entry and then use the entry

Lets say i have a file which have entries, File: user pts/1 2016-10-22 19:47 (ip) user1 pts/2 2016-10-22 20:04 (ip) user1 pts/3 2016-10-22 20:04 (ip) i want to have a loop ...
0
votes
1answer
76 views

Can reading STDIN conflict many writings from different processes? [closed]

One of my applications (Let's say "A") pushes its some alerts into STDIN and that app's shell script reads that STDIN and processes it. In the same way, there can be another applications (called B, C, ...
0
votes
1answer
256 views

Output to multiple files in crontab

In crontab I have set up a python script to run every 5 min, and output to a specific file */5 * * * * sudo /home/pi/MyProgram.py -o /home/pi/MyFile.csv How can I take the same ...
1
vote
1answer
3k views

How to block messages from write?

I have an ssh account on a server. Someone is spamming me with write messages. So I can't run any command in an interactive login. Is there anyway I can prevent them from sending me write messages or ...
4
votes
1answer
642 views

How to force Fedora 27 to write to USB flash drive immediately?

My Fedora 27 writes actual data to USB on umount. Before umount it works only with links or something like that. So, for example, when I transfer a big file of 5 GB cp /home/iam/bigFile /run/mnt/iam/...
7
votes
4answers
3k views

Overwriting a running executable or .so

I have a question about overwriting a running executable, or overwriting a shared library (.so) file that's in use by one or more running programs. Back in the day, for the obvious reasons, ...
4
votes
1answer
2k views

Linux USB Flash direct write / write cache

Lately I've been using USB2 flash drives to transfer a lot of data to my company. When copying the Data to the flash drive, I noticed that the data is not written directly to the drive. It wrote ...
0
votes
1answer
80 views

Why is the write rate to the disk being up to several GB/s, while no process reports any writing?

I use Ubuntu 17.04, though this problem was persistent in many previous versions. Long ago (a year or two, I think) I started to spot it. Immediately (no more than a couple of minutes) after the ...
10
votes
4answers
56k views

Sending message from one terminal user to another user

I have a user of name x in tty1 and y in tty2. Now x wants to write some message to y and vice-versa. Now I typed in tty1 terminal write y tty2 It is showing write:write:you have write permission ...
1
vote
0answers
146 views

Relation between write and filesystem blocksize in SSD disks on Apple

R. Stevens, in his famous book about programming in O.S. environment, taught us that when the syscall write's block size is comparable (or even equal) to the filesystem block size, the performances ...
-5
votes
1answer
83 views

Write xommand in Solaris, Unix

Hey guys need a little help here. For example me and my buddies are sending messages on our school computers using write user* pts/** , my question is can the system administrator see on his pc that ...
37
votes
1answer
147k views

How to get total read and total write IOPS in Linux?

How do I get read and write IOPS separately in Linux, using command line or in a programmatic way? I have installed sysstat package. Please tell me how do I calculate these separately using sysstat ...