Running DiskSim 4.0 On 64-Bit Ubuntu

DiskSim is a disk simulation software used for I/O analysis research. It is used as a research tool instead of a commercial tool, and hence requires some tweaking to run on your system.

This is a guide to installing and running DiskSim 4.0 on 64-bit Ubuntu machines. 64-bit machines require a patch, as DiskSim is originally intended for 32-bit machines. Also, some changes need to be made to certain Makefiles. Without making the changes, the compilation of the DiskSim code fails.

Firstly, download the 64-bit patched code for DiskSim 4.0 as a zip file from the following GitHub repository: DiskSim 4.0

Unzip the contents into any directory. For convenience, use the user home folder (as has been done in the following example for the rest of this post).

Now, cd into the directory disksim-4-0-x64-master from the terminal. When you run ls, you should see a list of folders such as diskmodel, doc, etc.

The libddbg, libparam, and diskmodel directories require no changes to be compiled correctly. However, memsmodel and src directories will require a few modifications to work correctly. So, run the following commands in sequence:

cd libddbg

make

cd ../libparam

make

cd ../diskmodel

make

cd ../memsmodel

gedit Makefile

The Makefile in the memsmodel directory needs to be edited slightly.

Search for the line:

LDFLAGS = -lm -L.

and replace it with

LDFLAGS = -L. -lm

Also, search for the following line (it will be below mems_seektest)

$(CC) -o $@ mems_seektest.o $(LDFLAGS) $(CFLAGS) -lmems_internals

and replace it with

$(CC) -o $@ mems_seektest.o $(CFLAGS) -lmems_internals $(LDFLAGS)

Save the Makefile and go back to the terminal.

You are currently in the memsmodel directory. Now run make.

Now run cd ../src to go to src directory and open Makefile using gedit Makefile, because a few more changes need to be made.

Search for the line:

LDFLAGS = -lm -L. -ldisksim $(DISKMODEL_LDFLAGS) $(MEMSMODEL_LDFLAGS) \
$(LIBPARAM_LDFLAGS) $(LIBDDBG_LDFLAGS)

and replace it with

LDFLAGS = -L. -ldisksim $(DISKMODEL_LDFLAGS) $(MEMSMODEL_LDFLAGS) \
$(LIBPARAM_LDFLAGS) $(LIBDDBG_LDFLAGS) -lm

Also, search for the line (it will be under rms)

$(CC) $< -lm -o $@

and replace it with

$(CC) $< -o $@ -lm

Save the Makefile and go back to the terminal.

You are currently in the src directory. Now run make.

The installation of DiskSim is done. To begin testing and using it, first run cd ../valid to go to the valid subdirectory.


The following commands show how to test if DiskSim is working and to begin using it for simulations. First, to test it, (while remaining in valid subdirectory) run the following command:

./runvalid

If DiskSim has been compiled correctly, no errors will be thrown. So, DiskSim can now be used to run simulations of disks. Disk specifications are given to DiskSim in the form of a parameter file ending with ‘.parv’. The output of a simulation run is given in an output file ending with ‘.outv’.

To run DiskSim on a parameter file, the command format is as follows (NOTE: run this from ‘valid‘ subdirectory, as it contains all the parameter files, otherwise you will have to change the required paths):

../src/disksim parfile outfile tracetype tracefile synthgen

The last two keywords in the command, tracefile and synthgen, signify whether a trace file is being used to run the simulated disk, or whether the input stream is randomly synthesized and run on the disk. Hence, only one of these can be set to 1 at a time.

‘0 1’ signifies that there is no tracefile being used, and accesses are randomly synthesized. ‘tracefile.txt 0’ signifies that tracefile.txt contains the trace to be simulated and there is no randomly synthesized input.

For example:

../src/disksim 3disks.parv out1.outv ascii 0 1

The output of the simulation will be present in out1.outv.

16 thoughts on “Running DiskSim 4.0 On 64-Bit Ubuntu

  1. Me 18 October, 2016 / 11:03 PM

    In the last step, when in src enter the command “sudo make” this error comes up:
    Makefile(128): recipe for target ‘disksim’ failed

    what should I do?
    thanks.

    Like

    • Kajal 20 October, 2016 / 2:08 PM

      That should not be happening – are you sure you ran all the previous commands as root? If you follow the steps exactly, I don’t see why that would happen. If not, try checking if your compiler is up to date.

      Like

  2. Henk 7 January, 2017 / 9:53 PM

    Hi Kajal,

    Thx! That work for me, saved me some time (-;

    To extend, I also had to edit the inline.h (located in /src)

    I swapped “inline” from ifdef to the else, (the arrows below are more clear (-;)

    #ifndef _DISKSIM_INLINE_H
    #define _DISKSIM_INLINE_H

    #ifdef _INLINE
    #define INLINE <—————
    #else
    #define INLINE inline <—————
    #endif // _INLINE

    #endif // _DISKSIM_INLINE_H

    KR Henk Stobbe

    Liked by 1 person

  3. alty 12 May, 2017 / 7:42 AM

    Thank you Kajal and Henk, both of your instructions help a lot 😀

    To extend, I found out that even modifying all places you mentioned about, I still failed to make in /src. And finally here is the solution: comment out #712 of /src/disksim_iosim.c as below.

    disksim_iosim.c: in function void io_initialize (int standalone)

    #712 StaticAssert (sizeof(ioreq_event) <= DISKSIM_EVENT_SIZE);
    #713 device_initialize();

    comment out #712,

    #712 //StaticAssert (sizeof(ioreq_event) DISKSIM_EVENT_SIZE.

    ref: https://www.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.cbcpx01/datatypesize64.htm

    Liked by 1 person

  4. Paridhi 11 October, 2017 / 2:21 AM

    Hi Kajal, I am getting following error :

    paridhi@paridhi-VirtualBox:~/disksim-4-0-x64-master/valid$ disksim 3disks.parv out1.outv ascii 0 1
    disksim: command not found

    Installation was done but running this command is giving error. Please help. Thanks

    Like

    • Kajal 11 October, 2017 / 2:33 AM

      Hi Paridhi,

      You will need to change disksim to ../src/disksim, as specified in the post. This is while running from the ‘valid’ subdirectory.
      ../src/disksim parfile outfile tracetype tracefile synthgen

      Hope this helps.

      Like

      • Paridhi 22 October, 2017 / 9:12 AM

        Hi. I am getting following error while running Makefile in src:

        recipe for target ‘system’ failed make: *** [system] Error 1.

        Can you help me in person? It would be great help and favor. Thanks.

        Like

        • Paridhi 22 October, 2017 / 9:20 AM

          Hi. I am getting following error while running Makefile in src:

          recipe for target ‘libdisksim.a’ failed make: *** [libdisksim.a] Error 1

          Can you help me in person? It would be great help and favor. Thanks.

          Like

  5. Sam 18 October, 2017 / 7:00 PM

    hi kajal,

    im getting the following error from running make:
    Makefile:107: recipe for target ‘disksim_iosim.o’ failed
    make: *** [disksim_iosim.o] Error 1

    from /src.

    i tried following the edit for the makefile
    but once i run make
    it still give me that error

    Like

    • Kajal 18 October, 2017 / 7:18 PM

      Could you try the changes mentioned in the comments by Henk and Alty on this post? The changes are in disksim_iosim and they should resolve the problem.

      Like

  6. Paridhi 23 October, 2017 / 1:13 AM

    Hi. I am getting following error while running Makefile in src:

    recipe for target ‘libdisksim.a’ failed make: *** [libdisksim.a] Error 1

    Can you help me in person? It would be great help and favor. Thanks.

    Like

  7. Student1337 21 November, 2017 / 11:07 AM

    Thank you so much for this post! On the last ‘make’ step, I have modified the Makefile in ../src exactly as specified, but am getting memsmodel/mems_event.c:1865: undefined reference to `addtointq’ errors (there are dozens of errors complaining about udr to math libs). I don’t understand why, because it should be using the -lm flag. Additionally, I already compiled mems_event.c successfully in a previous step?

    So, I figured since it was already compiled I could continue, even though the last make failed. but when running ./runvalid, I get tons of errors, such as ./runvalid: 10: ./runvalid: ../src/disksim: not found and ./runvalid: 144: ./runvalid: ../src/syssim: not found.

    Any clue what’s wrong?

    Thank you again for this great post!

    Like

    • Luo Luffey 6 January, 2020 / 2:20 PM

      I have the totally same situation with you. Have you solved this problem? Can you give me some clue?

      Like

  8. diana 14 June, 2018 / 8:59 PM

    Thank you for this complete and great post. May I ask if there is any examples or samples or simulations with Disksim.

    Like

  9. diana 19 June, 2018 / 12:32 AM

    I use it and then add ssd-one add to simulate ssd but there is an “error : unknown block ssdmodel_ssd”.could you please help me in this case.

    Like

  10. Luo Luffey 6 January, 2020 / 6:16 PM

    Hey, thank you for this post. But after followed your steps, there still have some errors. May I ask you what’s your vision of ubuntu?

    Like

Leave a comment