14

Is it possible to put the entire operating system on a ram disk? If I have 16 GB of RAM and it is an Intel Xeon. I don't have an SSD and my hard drive is killing my boot time. So can I just allocate some of my ram to work as if it were an SSD and install windows and vital software on it, to gain super fast speed. Or is it more trouble then its worth and would be better off just buying an SSD?

  • 23
    Right... and what will you do when the power goes out or you need to turn the PC off? – misha256 Oct 12 '15 at 2:40
  • They did make hardware ramdisks, but they generally arent worthwhile – Keltari Oct 12 '15 at 3:11
  • 1
    @Keltari Too true, they did make them, and then SSDs crashed the party. Folks who want even more performance than a single SSD can muster, simply RAID-up multiple SSDs at still far less cost than a hardware RAMDISK. There may still be esoteric scenarios where RAMDISKs make sense today. But the cost... the cost is just insane. – misha256 Oct 12 '15 at 3:17
  • 8
    Remember that the file cache already copies the components which you actually use into RAM. Your Ram Disk idea would also copy unneeded parts into RAM, and duplicate the parts which are in use (as the Windows file cache in RAM would still cache the Ram Disk). So you'd end up with approximately 16 GB of Windows components in RAM which are either unused or duplicated, and need 32 GB in total. And that's on top of misha256's comment about power loss. – MSalters Oct 12 '15 at 9:10
  • 1
    @Ruslan exactly. In principle it could be faster because it would load data sequentially, but just letting the filecache do its job is better in practive. In windows SuperFetch should actively preload the stuff you need anyway. The toram option is mostly useful if you want to remove the CD. – gmatht Oct 12 '15 at 9:42
29

Your idea (as cool as it is) unfortunately won't work in practice:

  1. The RAM disk would be wiped whenever you turn your PC off, reboot it, or if you lose power.

  2. 16 GB is not enough RAM. Don't forget you need to keep some RAM aside to use as, you know, regular RAM. So at best you might be able to do a 12 GB RAM disk. Well, 12 GB doesn't meet Windows 10's minimum free hard drive space requirement.

  3. Software-based RAM disks actually run on top of an already installed operating system. What you'd need is a way to create a RAM disk at a hardware level, so that Windows actually thinks it's talking to a real IDE/SATA/SCSI hard drive. That would require purchasing a special RAM disk card (for example, this). Incidentally, this would also solve problems 1 and 2, but the cost is insane.

So yeah, you need an SSD ;-)

| improve this answer | |
  • 4
    Clearly this is why Windows sucks - I bet Linux could run off a ramdisk! (/s, partially) – user253751 Oct 12 '15 at 5:18
  • 1
    I remember people copying Windows 95 to a ramdisk during the boot process. I guess it was possible because it booted on top of MS-DOS back then. – hmp Oct 12 '15 at 6:24
  • 1
    @user20574, been there, done that. Netboot to an initrd, create a tmpfs, copy /usr there and finish booting. It's a neat trick, but you're better off mounting a network filesystem and just letting the disk-cache subsystem manage things. – Mark Oct 12 '15 at 9:04
  • 8
    @user20574: You kid, but that's actually how Linux boots normally! The particular piece of code is known as initrd - "Initial Ram Disk". This bit solves the chicken-and-egg problem of loading the drivers to speak to all kind of disk controllers. You don't need drivers to talk to RAM. And the contents of the Ram Disk are loaded alongside the kernel itself. Yes, this is warped - loading files from that Ram Disk copies data from RAM to RAM - but it's a convenient hack and fast enough in practice. (until systemd, initrd wasn't the bottleneck anyway) – MSalters Oct 12 '15 at 9:06
  • 1
    FWIW, Puppy Linux is an OS that boots from a flash drive and runs entirely on RAM. – CodeMouse92 Oct 12 '15 at 23:38
3

Yes you can and 16G RAM are more than enough

  • Shrink the size of any windows iso using tools like ntlite or winreducer
  • Feed the output wim in to NtSetup
  • Boot the output VHD and configure your Windows - add firadisk driver
  • Mount the VHD from your normal OS and capture it with wimlib
  • Apply the output wim to a new VHD using the compact=lzx switch
  • Use grub4dos to map that VHD in RAM and boot it

That's a rough sketch of the procedure, it's a lot more complicated than it sounds but it can be done. I'm using a 1.2G Windows 10 VHD booted from RAM right now. Windows 10 support LZX compression on the fly. Windows 7 too but with the help of wofadk.sys.

If you're still interested ask for details.

| improve this answer | |
2

After booting, copy a directory to the ramdisk and use symbolic links to make that transparent to the OS.

But really, the OS already caches the disk using available ram.

No matter what, it won't help boot time, since the files are not copied to ram until after it boots, and you'll spend more time copying them.

The "live CD" of Linux systems often work using a ramdisk. But you wait for the compressed image to be read into ram, slowing boot time.

Compression...hmmm... if you have a fast Xeon but a slow disk, you could compress the drive and have less data to read from the disk.

Win10 should have fast-boot image caching though, so between that and defragmenting the disk your boot speed should be OK.

How slow is the boot speed you're complaining about?

| improve this answer | |
  • I found out that my boot time was slow because my hard drive was wearing out. I ended up buying an SSD and it worked wonders. I guess my hard drive was really limiting my computers performance. Now everything is insanely fast. I installed windows and all my crtitical software directly on the SSD – James Smith Oct 18 '15 at 15:39
2

Is it possible to put the entire operating system on a ram disk?

From some googling for "Windows bootable ramdisk" there are apparently ways to do it. I haven't tested them myself though.

You could also use a virtualisation platform to run a windows VM with a ramdrive as a backing store.

If I have 16 GB of RAM and it is an Intel Xeon.

16GB really isn't very much once you start talking installing software on ramdisks.

I don't have an SSD and my hard drive is killing my boot time. So can I just allocate some of my ram to work as if it were an SSD and install windows and vital software on it, to gain super fast speed.

The big problem here is that ramdisks are volatile. So even if you can get windows to run from a ramdrive and even if you have enough memory to run something that's not a crazy stripped down install, every time you do a cold boot you would have to re-copy stuff from your hard drive to the ram drive. If your goal is to reduce boot times that renders ramdrives fairly pointless.

Or is it more trouble then its worth and would be better off just buying an SSD?

Yes you would be much better off just buying a SSD.

| improve this answer | |
  • "every time you do a cold boot you would have to re-copy stuff from your hard drive to the ram drive. If your goal is to reduce boot times that renders ramdrives fairly pointless." A ram disk has 0 seek time, so even when you copy everything at one go sequentially first the ramdisk might then be faster at providing the random files that are actually needed. Depends on how much time is lost seeking versus how much of the data is accessed during boot... – masterxilo Nov 17 '18 at 14:19
2

You can use grub to create a ramdisk then load a vhd image into it and boot it.
Then you can save the image to disk before shutdown saving your work. It does indeed work with windows 10 and does have a point over sshd because it reduces the write cycles to the drive, and ram is much faster than sshd. Minimum size you can make windows 10 up and running is 3.9 g stripping everything out you do not need.

| improve this answer | |
  • How do you get Windows 10 down to 3.9g? I really want to know. – Rolf Mar 12 '18 at 12:53
0

What you are after is running from a physical disk made up from ram, is automatically stored on permanent media on power loss, and restored when powered on.

It isn't a new idea by anymeans. If you are willing to shell out the cash, it has been around for a while:

http://www.hyperossystems.co.uk/07042003/hardware.htm

| improve this answer | |
0

You could try getting a cheap SSD and Primocache. This software allows you to make a two tier caching system for any drive in your computer. The first tier usese the spare system ram, and the second tier uses an SSD.

The idea is that it writes changes to memory first, then to the ssd, and then when the system isn't busy, it writes the data to the actual slower drive.

30 day free trial http://www.romexsoftware.com/en-us/primo-cache/help.html

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.