Is there disk-level caching in Solaris 11?


 
Thread Tools Search this Thread
Operating Systems Solaris Is there disk-level caching in Solaris 11?
# 1  
Old 06-20-2016
Is there disk-level caching in Solaris 11?

I have an iSCSI disk at /dev/rdsk/c5t6d0

I have made a partition (slice with UEFI label) at: /dev/rdsk/c5t6d0s0

Now I write some data to the slice:
Code:
echo "xyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxy" >/text
dd if=/text of=/dev/dsk/c5t6d0s0


If I dump the disk contents I see the UEFI label and also my data at offset 0x5000:
Code:
dd if=/dev/rdsk/c5t6d0 bs=512 | xxd
0000000: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000020: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000030: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000040: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000050: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000060: 0000 0000 0000 0000 0000 0000 0000 0000  ................
...
0000070: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000190: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00001a0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00001b0: 0000 0000 0000 0000 0eb5 7760 0000 00ff  ..........w`....
00001c0: ffff eeff ffff 0100 0000 ff3f 0300 0000  ...........?....
00001d0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00001e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
0000200: 4546 4920 5041 5254 0000 0100 5c00 0000  EFI PART....\...
0000210: 7187 d278 0000 0000 0100 0000 0000 0000  q..x............
0000220: ff3f 0300 0000 0000 2200 0000 0000 0000  .?......".......
0000230: de3f 0300 0000 0000 fd59 3d67 51a0 4d13  .?.......Y=gQ.M.
0000240: abdd a5e8 8251 c7ac 0200 0000 0000 0000  .....Q..........
0000250: 8000 0000 8000 0000 7e8c 8e06 0000 0000  ........~.......
0000260: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000270: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000280: 0000 0000 0000 0000 0000 0000 0000 0000  ................
...
0005000: 7879 7879 7879 7879 7879 7879 7879 7879  xyxyxyxyxyxyxyxy
0005010: 7879 7879 7879 7879 7879 7879 7879 7879  xyxyxyxyxyxyxyxy
0005020: 7879 7879 7879 7879 7879 7879 7879 7879  xyxyxyxyxyxyxyxy
0005030: 7879 7879 7879 7879 7879 7879 0ab6 db6d  xyxyxyxyxyxy...m
0005040: 6db6 db6d 6db6 db6d 6db6 db6d 6db6 db6d  m..mm..mm..mm..m
0005050: 6db6 db6d 6db6 db6d 6db6 db6d 6db6 db6d  m..mm..mm..mm..m
0005060: 6db6 db6d 6db6 db6d 6db6 db6d 6db6 db6d  m..mm..mm..mm..m
0005070: 6db6 db6d 6db6 db6d 6db6 db6d 6db6 db6d  m..mm..mm..mm..m
0005080: 6db6 db6d 6db6 db6d 6db6 db6d 6db6 db6d  m..mm..mm..mm..m
0005090: 6db6 db6d 6db6 db6d 6db6 db6d 6db6 db6d  m..mm..mm..mm..m

But If I do the same dump at storage side (iSCSI target), I do not see my data written! I shutdown the SPARC/solaris machine and voila! the data is now there.

How can this be? Is Solaris caching my data in memory? How can I disable this?

Note: I tried to use sync but it did not help and anyway it is related to files in a file-system, which I do not have in my scenario.

P.S. My machine is a T5220 UltraSPARC T2 Server with Solaris 11.3
Moderator's Comments:
Mod Comment Please use code tags next time for your code and data. thanks

Last edited by vbe; 06-20-2016 at 03:59 AM..
# 2  
Old 06-20-2016
All UNIX from the beginning ( what made it superior to DOS...) used data buffers the write would never be direct, hence the famous but now obsoleted command sync...
The same is true when have to use fsck, depending what you would have to use special option to not get the result of command overwritten by the cache putting the FS back to previous state ( Dont remember now it so old ... if it were not a reboot without sync option...)
# 3  
Old 06-20-2016
Quote:
Originally Posted by dorbaruch
Code:
dd if=/text of=/dev/dsk/c5t6d0s0

You are writing to the block device (dsk) which is buffered. Should you want to bypass the buffer and directly write to the raw device, use:

Code:
dd if=/text of=/dev/rdsk/c5t6d0s0

Your /text file would need to have a size exactly multiple of a block size for dd to succeed though.

Alternatively, you can still use the buffered device but tell dd to sync its output:
Code:
dd if=/text of=/dev/dsk/c5t6d0s0 conv=sync

or, if you want fixed width output records:
Code:
dd if=/text of=/dev/rdsk/c5t6d0s0 cbs=512 conv=sync,block


Last edited by jlliagre; 06-20-2016 at 06:44 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

SAN DISK raid level in AIX

Hello All, Our servers having emc clarion for the data disks. Is that possible to see those san disks raid level from AIX ? Am having AIX 6.1 and EMC clarion 5.5. Regards, Gowtham.G (3 Replies)
Discussion started by: gowthamakanthan
3 Replies

2. Solaris

Convert from raw disk to solaris volume manager disk

I have a solaris 10 system configured using NetApp as its storage, and the file systems are already configured as you can see from the example below: root@moneta # df -h Filesystem size used avail capacity Mounted on /dev/md/dsk/d0 9.8G 513M 9.3G 6% /... (4 Replies)
Discussion started by: fretagi
4 Replies

3. Solaris

Convert from raw disk to solaris volume manager disk

I have a solaris 10 system configured using NetApp as its storage, and the file systems are already configured as you can see from the example below: root@moneta # df -h Filesystem size used avail capacity Mounted on /dev/md/dsk/d0 9.8G 513M 9.3G 6% / ... (0 Replies)
Discussion started by: fretagi
0 Replies

4. Solaris

Solaris 10 - Run Level Modification

Hello, I'm creating a VM Image of Solaris 10 on VM Player. I've completed the installation & I am using the Java Desktop as my default logon. I need to modify the Run Level to Console Mode (permanently). Unlike previous versions or Linux, modifying inittab file is not an option here. Please... (2 Replies)
Discussion started by: DevendraG
2 Replies

5. Solaris

How to get the initdefault run level in Solaris 10

Hi All, In Solaris 9 and below I will get the init run-level by checking the /etc/inittab entry is:3:initdefault: But in Solaris 10 we are using the smf functionality. Here how I can get the init default run level. Please help me in this problem. Regards, ... (2 Replies)
Discussion started by: kalpeer
2 Replies

6. Solaris

Patch level of Solaris machine

As i understand, Patch is a fix to bug in a product. What is patch level wrt to solaris OS ? How do i know the patch level of a machine ? I have task to compare patch levels of 2 machines running solaris (3 Replies)
Discussion started by: shafi2all
3 Replies

7. UNIX for Advanced & Expert Users

i'm pulling my hair out getting a solaris 8 box to work as a caching name server

i've gone through the sun docs as well as a Solaris Network Admin book. while the book is fair, it lacks detail and i'm sure there are things it's missing on getting a caching only name server working. as for the sun docs... what it has is really miserable. i can't make anything out of it. ... (4 Replies)
Discussion started by: xyyz
4 Replies

8. Filesystems, Disks and Memory

Find run-level in solaris 8.

When the solaris 8 have come up, which command can find out the current run-level? thanks. (2 Replies)
Discussion started by: nianzhe
2 Replies

9. Filesystems, Disks and Memory

Hard Disk parameters (caching/dma)

Linux uses hdparm to set these parameters, my question is: what tool uses BSD systems (FreeBSD/OpenBSD/NetBSD)? There is another thing which FreeBSD implements on their filesystems: softupdates. If I forgot to enable this option when I partitioned the disk, how could I enable it at a later time? (1 Reply)
Discussion started by: eNTer
1 Replies
Login or Register to Ask a Question