I want to seek to a location on the hard drive that will be written to that is different from the output block size. Is this possible? It seems the man page implies you can only seek in increments of the number of bytes you output.
A bit of information about what I'm trying to do, if that helps. Maybe I need to use another unix command I don't know of:
I'm trying to do is to seek to a point on a hard drive and write to it in block sizes that will not page. So, if I seek to a point on the hard drive that is larger than my ram, that would be the default block size to write, then I believe I will get paging.
Last edited by silvermoon; 08-29-2008 at 01:42 PM..
You can seek to any point with dd, it's not tied to the hardware's block size; you can set bs to anything (for example, one).
I don't understand your explanation of why you think this would be useful, though.
If I set bs to 1, like you say, wouldn't it then only read and write one byte per count? If I am not misled on this, the data would be copied slowly due to dd handling 1 byte per count iteration.
What I find is confusing is that dd man page seems to imply I can only seek in obs. Which makes it seem that if I decide I want to write with a megabyte at a time (so do more per count iteration), I can only seek a megabyte at a time, which results in not being able to seek any where I want.
I hope I'm confused, because dd won't work for me if this is true. Unless there is a workaround.
I think your interpretation of "seek" is wrong. It means to skip to the requested position.
As you can tell by the byte count, it really only reads after seeking.
You are correct that the seek parameter expresses how many blocks to seek forward, but on a block device, this truly is a seek operation (move the disk head to the requested position), not a serial operation.
Of course, if you mean to read a lot of data after the seek operation, then the block size does affect the read, but I don't think it modifies the hardware buffer block size, i.e. slow down buffered reads.
Last edited by era; 08-31-2008 at 12:23 PM..
Reason: On reading after seeking
I think your interpretation of "seek" is wrong. It means to skip to the requested position.
As you can tell by the byte count, it really only reads after seeking.
You are correct that the seek parameter expresses how many blocks to seek forward, but on a block device, this truly is a seek operation (move the disk head to the requested position), not a serial operation.
Of course, if you mean to read a lot of data after the seek operation, then the block size does affect the read, but I don't think it modifies the hardware buffer block size, i.e. slow down buffered reads.
Maybe an example will help narrow things this problem down.
I used a jpg to copy to make it easy to check for errors.
I copied the file to a usb memory stick with no partition table, (zeroed out). First I tried without seeking or skipping and all worked fine. The jpg opened fine.
But, once I tried using seek and skip, the jpg would not open:
I am assuming that skip mean to advance along the destination before writing and skip means to advance along the medium where things will be read before reading, but I'm not getting a readable jpg.
Can you examine the resulting file? I assume you get the result from the first experiment in the first 281,881 bytes after the second operation, and its contents are 2 x 281,881 bytes (but of course, in the absence of a file system, it's hard to tell). What about when you copy it back, do you get padding on either end of the file, or the wrong number of bytes, or the wrong contents?
Can you examine the resulting file? I assume you get the result from the first experiment in the first 281,881 bytes after the second operation, and its contents are 2 x 281,881 bytes (but of course, in the absence of a file system, it's hard to tell). What about when you copy it back, do you get padding on either end of the file, or the wrong number of bytes, or the wrong contents?
When it's copied back, I get the same size file. When I view the contents of the file, it has got the last few hundred bytes of the jpg. The rest of the file is zero's that were placed on the memory stick before the copy operation occurred.
I finally realized that default 550 obs was the issue when combined with skip, whereas seek used 281881.
The program I'm writing is in Python. My goal is to write a file at any location I want on any drive. It's part of an encryption idea, where the encryption decides where to store the file rather than the file management system. That's when I need to seek a number of bytes that isn't the ibs. I'm not sure the dd is going to help me with this. But I can't say that with full confidence, because I don't fully understand how it works yet.
Seek help configuring Sendmail 8.14.4 Unix server.
Not sure if this is the correct place to post or the Unix/Linux Forums job board. Seeking help configuring sendmail 8.14.4 on my Unix server. It appears I have an open relay. I was advised I need to modify a etc/mail/dir , a command line entry... (0 Replies)
hello
i'm working with aix 5.3 hacmp 5.4 P550 and P520
those two serevr every 10 seconds seek connection to the internet web.
i check with sniffer software and i've got this details.
the problem is that when i've problem with the internet those server get frizzzzzzz. on those servers running... (0 Replies)
I am new to UNIX shell script programming. I have coded one korn shell script used on solaris 10 for Oracle database rman cold backup. The first part of script is working. But only following part is not working. Please help me to point out the problem and errors in my code. Thanks a lot.
# the... (2 Replies)