2

I am here to ask you if it is possible for a ramdisk to get corrupted and if so, is it possible to verify the surface of it?

MarianoM
  • 655
  • Please attempt to post your exact error – eyoung100 Nov 06 '18 at 08:32
  • What you should verify is your RAM. –  Nov 06 '18 at 08:34
  • @GabrielaGarcia With a simple pass of Memtest + it would be enough to make sure that the ramdisk contains no errors? I ask this because having a lot of memory would be a process of much delay, instead, in windows for example, I can check the surface of the ramdisk; No need to scan all the memory. – MarianoM Nov 06 '18 at 08:37
  • @eyoung100 I have no error, I just wonder if it is possible to scan the surface of a ramdisk to make sure that the surface is good enough to store important information temporarily. – MarianoM Nov 06 '18 at 08:39
  • RAMdisks are in RAM, they're a sort of virtual drives, I believe. So, no surface like in a physical drive therefore I'm assuming that can't be done. Do you actually have a problem or is this just theoretical? –  Nov 06 '18 at 08:41
  • Are you talking about the initial RAM Disk or an actual RAM Disk? Those are two different things – eyoung100 Nov 06 '18 at 08:42
  • @GabrielaGarcia It's just a curiosity that I have, if in Windows I can do it, I do not understand why in Linux I would not allow it. So I ask, to see if someone with more knowledge explains to me if this is possible and if not, why would not be possible or necessary. – MarianoM Nov 06 '18 at 08:46
  • @eyoung100 Sorry, but how do I know the difference between the two? I mean the ramdisk that one creates running mount -t tmpfs -o size = 1024m tmpfs /mnt/ramdisk – MarianoM Nov 06 '18 at 08:47
  • Try completing: Create a RAM disk in Linux. What exactly is happening that makes you think that your command is faulty? Did you forget to add it to fstab? – eyoung100 Nov 06 '18 at 08:55
  • @eyoung100 I finally did it. I added an answer with the details to follow. Thanks for everything! – MarianoM Nov 06 '18 at 11:27
  • @GabrielaGarcia I finally did it. I added an answer with the details to follow. Thanks for everything! – MarianoM Nov 06 '18 at 11:27

1 Answers1

2

I am going to autoresponder because I have continued looking and I managed to deduce how I can check if there is a defect in the allocated space of the ramdisk.

First let's create the ramdisk. In this example it will have a size of 1 GB:

sudo mkdir -p /media/ramdisk
sudo mount -t tmpfs -o size=1024M tmpfs /media/ramdisk
sudo chmod 1777 /media/ramdisk

To make the ramdisk permanently available, add it to /etc/fstab.

grep /media/ramdisk /etc/mtab | sudo tee -a /etc/fstab

Once mounted, we proceed to install F3 rom the link of the official page F3 (Fight Flash Fraud) or with the command:

sudo apt-get update
sudo apt-get install f3

Assuming that they have installed it using the above command, in the terminal they should write the following and in the following order:

Write the data in the free space:

f3write /media/ramdisk

Read the test data:

f3read /media/ramdisk

And enjoy the storage in a space free of errors.

Sources consulted:

https://askubuntu.com/a/453755/889244

https://askubuntu.com/a/666926/889244

MarianoM
  • 655
  • F3 only determines if the declared size is equal to actual size. Primarily used for sorting out "mis-sold" SDHC and flash drives. You do NOT want to try and run a "surface scan" or "badblocks" utility on a SSD. – heynnema Nov 06 '18 at 20:41
  • @heynnema That's right, I understand perfectly what he is referring to. However, this utility when saving files and then being checked, can be useful in flash memories where badblock is not able to detect errors; I have checked this on my own as well. What it does basically is save a file with random content and then check it; in case there was a defective sector or address of memory, in the verification the check would indicate the defect in the unit. – MarianoM Nov 08 '18 at 08:12
  • @heynnema Anyway, I have to edit this because after posing the question, I realized that it is impossible to know if the RAM disk is safe to store information, since the operating system can vary the memory addresses for the storage of the information. Therefore, the only effective way is to do a complete test. – MarianoM Nov 08 '18 at 08:14
  • Oh, you're talking about a RAM disk, not a SSD? Your language was a little unclear when you said surface check. F3 only writes a file at determinate memory locations, and then later goes to read the file to check if it got made. SDHC cards sold as 32G that have only really 8G will fail F3, as file locations from 8-32G never got written, and your SDHC dealer ripped you off. Use memtest to check your main RAM. – heynnema Nov 08 '18 at 13:48