Deleting Shared Folder wiped all my data!!

    • OMV 4.x
    • Deleting Shared Folder wiped all my data!!

      I am having a lot of issues with OMV.

      I was trying to remove a Shared Folder so that I could re-link it to the correct device so I selected delete folder, not the one that says + content. It then proceeded to delete everything, including the content!! All my data is GONE.

      I actually had another backup so thankfully it:s just lost time.

      Now I have no more sharedfolder, and it wont let me even link it to a device. I dont know what to do here.
      I is the quizat haderach
      --
      OMV 4.x - Raspi 4 4g 4tb R1

      The post was edited 1 time, last by Cori ().

    • Good for you having backups! You are way ahead of many!

      I'm not sure what you did. A shared folder typically contains a lot of data. And if you delete it you loose the data as well.

      When you delete a shared folder, using the OMV GUI, you are asked if you want to delete the shared folder or delete the shared folder + content.

      I suspect you messed up. I suggest that you reinstall from scratch. When I started using OMV I reinstalled several times before I had everything figured out. And then I reinstalled a few times more.

      It is pretty quick to reinstall OMV. But you might save time if you also figure out how to backup the root filesystem. The system drive. Then you can test stuff and revert back to the previous backup instead of doing a reinstall from scratch.

      One important thing to know about OMV is that you remove stuff in the exact reverse as you added them.

      For instance:

      You wipe a disk
      You create a new filesystem on the disk.
      You mount the new filesystem.
      You create a shared folder on the filesystem.
      You enable one or more services to use that shared folder.

      If you want to remove or swap the disk you need to:

      Delete services that use shared folders on the disk.
      Delete shared folders on the disk.
      Unmount the filesystem on the disk.

      Now you can shut down and remove the drive, without messing things up.

      Same if you want to remove a shared folder. First you must delete services that use the shared folder. Only then can you delete the shared folder in the OMV GUI.

      Tip: Unless you know exactly why, only have one single shared folder per drive. Possibly with the exception of a shared folder for docker. It is tempting to create a lot of shared folders for various purposes. But you may soon find that a single shared folder with subfolders is MUCH easier to manage.
      OMV 4: 9 x Odroid HC2 + 1 x Odroid HC1 + 1 x Raspberry Pi 4
    • Adoby wrote:

      Good for you having backups! You are way ahead of many!

      I'm not sure what you did. A shared folder typically contains a lot of data. And if you delete it you loose the data as well.

      When you delete a shared folder, using the OMV GUI, you are asked if you want to delete the shared folder or delete the shared folder + content.

      I suspect you messed up. I suggest that you reinstall from scratch. When I started using OMV I reinstalled several times before I had everything figured out. And then I reinstalled a few times more.

      It is pretty quick to reinstall OMV. But you might save time if you also figure out how to backup the root filesystem. The system drive. Then you can test stuff and revert back to the previous backup instead of doing a reinstall from scratch.

      One important thing to know about OMV is that you remove stuff in the exact reverse as you added them.

      For instance:

      You wipe a disk
      You create a new filesystem on the disk.
      You mount the new filesystem.
      You create a shared folder on the filesystem.
      You enable one or more services to use that shared folder.

      If you want to remove or swap the disk you need to:

      Delete services that use shared folders on the disk.
      Delete shared folders on the disk.
      Unmount the filesystem on the disk.

      Now you can shut down and remove the drive, without messing things up.

      Same if you want to remove a shared folder. First you must delete services that use the shared folder. Only then can you delete the shared folder in the OMV GUI.

      Tip: Unless you know exactly why, only have one single shared folder per drive. Possibly with the exception of a shared folder for docker. It is tempting to create a lot of shared folders for various purposes. But you may soon find that a single shared folder with subfolders is MUCH easier to manage.
      First, thanks for your help and information.

      I ran omv-mkconf fstab and it brought back the shared folders although it:s back to automounting them from /srv location which I dont want. This breaks automounts and my storage wont get mounted properly for /sharedfolders where the data should go after a reboot. The device will never come up even and get network. It just hangs. Moreover, my disks wont even mount like that unless i unplug them, let the system come up and then plug them back in.

      I have installed this thing a few times previously. I get what you are saying about the proceedures but in this case I selected to remove the Shared Folder but not the content and it wiped the content anyway. I was extremely careful when I picked it so I am sure.

      #1, this thing should NEVER EVER DELETE YOUR DATA. Make them go to the command line and manually remove it, or show them all of what they are about to loose and say are you SUREEEE.. something. Not just delete it all.

      Now when trying to browse CIFS share I get an error that says The operation can’t be completed because the original item for “SMB-Shares” can’t be found.

      This is the same error I was trying to rectify by removing the Shared-Folders to begin with so I could re-create it.

      Any idea how to get rid of this error so I could browse my shares again? And then I need to fix it show I can do a reboot and have the RAID automount without hanging up the box.

      Thanks!
      I is the quizat haderach
      --
      OMV 4.x - Raspi 4 4g 4tb R1
    • I'd just start over from scratch. Even if I got things working I would have a nagging suspicion that something I haven't noticed (yet) is wrong. And I would have to start over anyway sometime in the future and loose even more time/work.

      The most common ways to loose data is program error and user error. I have never tried to delete any shared folder that I didn't first made sure was empty.

      What would you expect to happen if you delete a shared folder? I don't understand the difference between delete shared folder and delete shared folder + content. But I don't have to. I assume the worst.
      OMV 4: 9 x Odroid HC2 + 1 x Odroid HC1 + 1 x Raspberry Pi 4
    • Adoby wrote:

      I'd just start over from scratch. Even if I got things working I would have a nagging suspicion that something I haven't noticed (yet) is wrong. And I would have to start over anyway sometime in the future and loose even more time/work.
      So I wiped all the old Shared Folders and everything. Remade them and now I can access the CIFS shares again. This time the RAID seems to be auto mounting correctly under /sharedfolders I'm not sure why it wasn't working before. I only noticed it when syncing data and my 32g SD card filled up quick.

      I guess the only reason I haven't started over is so I can figure this thing out. OMV seems to have it's own mind. A lot of changes I make to the system from CLI get over-written. Some just cause errors etc.

      Anyway if I do start over and make a new image of OMV on the SD card, will it pick up my old RAID config from the drives and just use it or do I need to do all that over again? I'd hope not since that really would defeat the whole purpose.

      Thanks!
      I is the quizat haderach
      --
      OMV 4.x - Raspi 4 4g 4tb R1
    • So how about adding a button in OMV "Protect Data" which would essentially do a chattr +a to the /sharedfolders/Share directories. This would make all the files immuntable and still allow ppl to drop files in the share and read them.
      I is the quizat haderach
      --
      OMV 4.x - Raspi 4 4g 4tb R1

      The post was edited 1 time, last by Cori ().

    • cabrio_leo wrote:

      Cori wrote:

      This time the RAID seems to be auto mounting correctly under /sharedfolders I'm not sure why it wasn't working before.
      Please have a look at this post Mods please help
      Thanks for your info. I did and that issue seems still un-resolved. I had the same issue but i fixed that already.

      I guess my main concern at this time, which is still un-answered, is how in the world I could delete a shared folder, without the option to delete shared folder+content and get no prompt for confirmation and have it wipe ALL of my data. That friends is a serious flaw in the code and someone should be looking at this.

      I feel at this point it is probably because I had manually changed my mounts. At that point everything was greyed out as in the post you referred to above. I tried to access the share from another machine via CIFS and it kept giving me an error, so I thought to manually remove the Samba setup + shared folders and redo it. When I deleted the /sharedfolders/SMB-Share where all my files were at the time, it also deleted all my files. There was no confirmation, warning or anything.

      I am going to set +a attribute on that folder after I get all my data synced back so hopefully this accident won't happen again. I feel this should be an option in OMV as well. Click a button to set +a on select directories under /sharedfolders/* Click it again to remove.

      As an aside, I ran omv-firstaide and tried to restore from backup, but it couldn't find my backup. I stored it under /sharedfolders/Backups as a 'dd' copied zip file. What is the expectation for backup/restore in this case?
      I is the quizat haderach
      --
      OMV 4.x - Raspi 4 4g 4tb R1
    • cabrio_leo wrote:

      Cori wrote:

      This time the RAID seems to be auto mounting correctly under /sharedfolders I'm not sure why it wasn't working before.
      Please have a look at this post Mods please help
      Thanks for your info. I did and that issue seems still un-resolved. I had the same issue but i fixed that already.

      I guess my main concern at this time, which is still un-answered, is how in the world I could delete a shared folder, without the option to delete shared folder+content and get no prompt for confirmation and have it wipe ALL of my data. That friends is a serious flaw in the code and someone should be looking at this.

      I feel at this point it is probably because I had manually changed my mounts. At that point everything was greyed out as in the post you referred to above. I tried to access the share from another machine via CIFS and it kept giving me an error, so I thought to manually remove the Samba setup + shared folders and redo it. When I deleted the /sharedfolders/SMB-Share where all my files were at the time, it also deleted all my files. There was no confirmation, warning or anything.

      I am going to set +a attribute on that folder after I get all my data synced back so hopefully this accident won't happen again. I feel this should be an option in OMV as well. Click a button to set +a on select directories under /sharedfolders/* Click it again to remove.

      As an aside, I ran omv-firstaide and tried to restore from backup, but it couldn't find my backup. I stored it under /sharedfolders/Backups as a 'dd' copied zip file. What is the expectation for backup/restore in this case?
      I is the quizat haderach
      --
      OMV 4.x - Raspi 4 4g 4tb R1
    • Cori wrote:

      That friends is a serious flaw in the code and someone should be looking at this.
      Out of curiosity having read this thread I have just tested this on my own system, created a share in the GUI, confirmed the share appears in /srv/dev-disk-by-label etc and under /sharedfolders using WinSCP.

      Using WinSCP from my W10 workstation copied a folder to the new share on OMV, created a simple text file in that share, confirmed it all showed in the mount point /srv/dev etc and /sharedfolders.

      Back to the GUI -> Shared Folders -> select the share -> Delete -> Shared folder, result shared folder no longer displays in the GUI but the content is still there confirmed by WinSCP and Docker Cloud Commander, so it does what it says on the tin. :)
      Raid is not a backup! Would you go skydiving without a parachute?
    • geaves wrote:

      Cori wrote:

      That friends is a serious flaw in the code and someone should be looking at this.
      Out of curiosity having read this thread I have just tested this on my own system, created a share in the GUI, confirmed the share appears in /srv/dev-disk-by-label etc and under /sharedfolders using WinSCP.
      Using WinSCP from my W10 workstation copied a folder to the new share on OMV, created a simple text file in that share, confirmed it all showed in the mount point /srv/dev etc and /sharedfolders.

      Back to the GUI -> Shared Folders -> select the share -> Delete -> Shared folder, result shared folder no longer displays in the GUI but the content is still there confirmed by WinSCP and Docker Cloud Commander, so it does what it says on the tin. :)
      Great, but I'm saying in my situation it didn't work. You didn't manually move your mount point, before doing all that. Give that a shot?
      I is the quizat haderach
      --
      OMV 4.x - Raspi 4 4g 4tb R1
    • Cori wrote:

      You didn't manually move your mount point, before doing all that. Give that a shot?
      Why would I do that, the system works as it is, you change something like the mount point you not only have to change OMV's config to ensure that it continues to function correctly but any scripts that have been created/written for OMV's default settings.

      The fact that mine worked would suggest that that the delete function in shared folders in the GUI is simply deleting the reference to the share not the actual share itself.

      The point I was trying to make is that OMV works, you change the way it functions you have to ensure all bases are covered, this is not a code issue, if it was there would be more users on this forum with the same problem, me included.
      Raid is not a backup! Would you go skydiving without a parachute?
    • geaves wrote:

      Cori wrote:

      You didn't manually move your mount point, before doing all that. Give that a shot?
      Why would I do that, the system works as it is, you change something like the mount point you not only have to change OMV's config to ensure that it continues to function correctly but any scripts that have been created/written for OMV's default settings.
      The fact that mine worked would suggest that that the delete function in shared folders in the GUI is simply deleting the reference to the share not the actual share itself.

      The point I was trying to make is that OMV works, you change the way it functions you have to ensure all bases are covered, this is not a code issue, if it was there would be more users on this forum with the same problem, me included.
      Why would you have tried anything to begin with?

      Look, I appreciate your advice and input. There are a lot of possible hardwares OMV can run on. Then you will always have people like me who will dive right in and break/fix it. Just because it works perfectly for you doesn't mean it will for everyone else.

      That all said I don't know enough about all the scripting that OMV has YET, so I was only using my knowledge as a sysadmin to make the mounts and get everything working again. I saw later that I needed to run omv-mkconf fstab to fix some other backend stuff.

      Currently it's all working again, and I plan on marking the directories under /sharedfolders +a so they are immutable going forward.
      I is the quizat haderach
      --
      OMV 4.x - Raspi 4 4g 4tb R1
    • Cori wrote:

      Look, I appreciate your advice and input.
      Fair enough, but OMV is aimed at home users, yes users do get problems setting this up and it is usually related to hardware or an error on their part and with reasonable information a solution can be found.

      Cori wrote:

      so I was only using my knowledge as a sysadmin
      So was I but I'm now retired and restrict myself to part time work on an ad hoc basis, but that doesn't make us all knowing, if I wanted to change the way a specific distro works such as OMV, Freenas, or XigmaNAS I would get it set up poke around then ask in their forums. The reason being any fundamental change to the way it basically functions will break it as you have discovered, this recent thread asks that question

      Cori wrote:

      I saw later that I needed to run omv-mkconf fstab to fix some other backend stuff.
      You have to do more than that from my understanding you will have to update monit.

      Cori wrote:

      Currently it's all working again, and I plan on marking the directories under /sharedfolders +a so they are immutable going forward.
      :thumbup: but /sharedfolders/ is a bind/symlink to the actual mount point, this makes it easier to access a share from the command line, so making changes to the mount point correctly that option would not be necessary. That's like adding some glue in the hope that it stays together :)
      Raid is not a backup! Would you go skydiving without a parachute?
    • Users Online 1

      1 Guest