Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

help with command lines

Featured Replies

 

Hey all,

 

Here is my issue. I got my new disks installed over the weekend. In Windows, I went to my network places tower\disk3\tv 3 which contained a bunch of Seinfeld backups and I wanted to move those files to a folder on another disk which contains the rest of the show to have them all in the same place. I did just that copied all the files to the new disk no problem.

 

Then once I verified the files copied Ok. I went back to disk3\TV 3 to delete those files here's the problem it got half way through deleting and then came up with the error " cannot delete "file" the network connection is no longer available" So I rebooted ther server and my desktop machine. Now if I go to my network places and open up disk 3 and try to even click on the folder TV 3 it locks up My network places I have to go to task manager and end the task that way.

 

what would be the command at root to delete the folder.

 

\\tower\disk3\TV 3

 

Thanks,

 

DVS

Don't ever use spaces in file names or directory names.... ever.... ever... ever.

 

Rename the directory, then delete it.

  • Author

HI,

 

I cannot even click on the folder in windows without it locking up my network places.

 

Regards,

 

DVS

This is all from memory since I'm not at home to try it out, but I believe the command you're looking for is 'rm' (remove).  It doesn't allow you to rm a folder unless it is empty, but if you pass it the -r option it will recursively delete everything inside the folder for you.

 

So the command is something like rm -r /mnt/user/disk3/TV 3

 

I'm not sure how the space works in linux, so as you type the command when you get to TV, just type TV then press the tab key.  It will fill in the rest of the name for you.  If you have more than 1 directory in disk3 that begins with TV then hit tab twice and it will list them for you and show you if the space needs some kind of special key combo. (like "TV\ 3".

 

Again, I didn't try any of this out and I'm still pretty new to linux so sorry if it's not what you need.

try these commands:

 

First, we do not know which drive the "TV 3" folder was created on.  We need to learn that first.

 

ls -ld /mnt/disk*/TV*

 

Once we know where it is, or where they are (there might be more than one) we can see what is in them. (no sense removing them unless we know the contents are what we expected to see and what we want to remove)

 

Let's assume it exists on disk3 and disk5

 

ls -l /mnt/disk5/TV\ 3

ls -l /mnt/disk3/TV\ 3

 

You will need to preface the "space" in the name with a backslash.  As already noted, you could instead put the entire name in quote marks like this:

 

ls -l "/mnt/disk3/TV 3"

 

If both of the ls commands come up empty (listing only the top level TV 3 directory) then you can remove the folder by using the rmdir command:

 

rmdir /mnt/disk3/TV\ 3

or

rmdir "/mnt/disk3/TV 3"

 

If you want to remove the contents, but leave the top level folder, type:

rm -r /mnt/disk3/TV\ 3/*

or

rm -r "/mnt/disk3/TV 3/*"

 

Good luck.  You will probably need to stop and re-start the unRaid array so it re-builds the user-shares before windows will not lock up, since all these commands on the disks themselves will not magically show up in user-shares in the current version of unRaid.

 

Joe L.

 

  • Author

Joe,

 

I did not get a chance to do anything with the commands. I went into the management console to stop the array hit stop came up with the wait sign and just hung there for 15 minutes it would not refresh. had to go out, came home and it was still hung. did a hard shutdown and booted back up it booted to normal command and the loaded a bunch more info and then came up with this at the end

 

SH: Line 1: 1206 segmentation fault mount -t reiserfs -0 noatime,nodiratime /dev/md3 /mntdisk3 >dev/null 2>&1

 

left it alone, logged into the management console and now it says disk 3 is unformatted and it wants me to hit format and it is also running a parity check at the same time.

 

attached is the syslog or what I could get.

 

I think I lost disk 3's data by the looks of it.

 

ARRGHHHHH!

Whatever you do, DO NOT format that disk.  DO NOT HIT THE RESTORE BUTTON.  I would recommend that you do not even start the array unitl you know how you are going to recover.  I think you either have a drive failure or a cabling problem to that drive.  I would go in and make sure all of your cables are tight and well connected.  If that doesn't fix it, replace the data cable.  After you have eliminated the cabling problem, only then would I suspect the drive.

 

I think if you remove the disk from the array, you should be able to start the array in non-redundant mode.  You should then be able to replace the disk with a new one and have it rebuild the disk.  Others will be able to better advise you.  I do know that if you do the wrong thing, unRAID will lose the validity of the parity drive, and recovery will be much more difficult.

 

Unless you do something rash, your chances of data loss from this are small.

  • Author

Well I am lost, I removed the disk and rebooted and it came up with disk3 missing. I started the array as in redundant mode and this is what I got. main page attached.

 

It sees drive 3 without it being installed with full free space. I do not know what I did other that trying to delete some files from disk3 I checked all the cables and it is a brand new PSU installed on the weekend. but I do not know where to go from here I have just shut down the array and the system. To me it's acting like a virus in a MBR but I cannot see how there are no files on the server that have not came from me. IE internet dwnlds etc all go to a specific location for scanning first on another machine.

 

Confused and lost.

 

Regards,

 

DVS

what would be the command at root to delete the folder.

\\tower\disk3\TV 3

 

put quotes around the names if you use spaces ...

 

rmdir "/mnt/disk3/TV 3"

 

Regards

Harald

 

  • Author

 

I took the drive and installed it in my other machine just to see and yes it all free. 488 Gb worth of free space. How did this happen? I wanted to delete four folders from DISK 3 in windows, tried to delete them and windows crashes. try to shut down the server from management console - IT hangs have to do a hard shutdown, comes back up with the error above - shut down from management console again it hangs - have to do a hard shutdown - take the drive out and reboot now it says unformatted disk present. try the drive in another machine and YES it is already formatted.

 

A full week of ripping all those DVD's back to disk 3.

 

now that the disk is formatted obviously can I put it back in it's tray and start the array. So I can get to work replacing those files or is the disk the problem.

 

Regards,

 

DVS

 

I took the drive and installed it in my other machine just to see and yes it all free. 488 Gb worth of free space. How did this happen?

You have a second Linux machine?  If not, windows would not recognize the reiserfs and might just tell you it is empty.

I wanted to delete four folders from DISK 3 in windows, tried to delete them and windows crashes.

From the error message at the "mount" command, the file system on that disk might have some corruption.

try to shut down the server from management console - IT hangs have to do a hard shutdown, comes back up with the error above - shut down from management console again it hangs - have to do a hard shutdown - take the drive out and reboot now it says unformatted disk present. try the drive in another machine and YES it is already formatted.

If you have not re-formatted the drive, and not pressed "restore" the data is still there, protected by your parity drive.  With the drive "missing" as in your screen shot, you can still get to its data.

A full week of ripping all those DVD's back to disk 3.

Unless you pressed the "Restore" button, or had a second drive failure, your data on disk3 is still available from parity and the other remaining drives.

now that the disk is formatted obviously can I put it back in it's tray and start the array. So I can get to work replacing those files or is the disk the problem.

If it is formatted and readable and you re-install it, the array should just recognize it.  It probably has some file-system corruption.

use the reiserfsck command on it first, before you start your array. (I think you can find the actual syntax in the wiki)  If the drive is good you will be able to fix the errors.  If the drive is bad, it will simply be marked bad again. 

 

If your drive works in another computer, but not in your unRaid array, it could be the cabling, the power supply, of the disk controller that is actually at fault.

 

Joe L.

  • Author

Joe,

 

I had put the drive in the my other raid server which is brand new with no data yet and as a new drive Unraid sees a 488GB drive in the slot with 468 or so Gb free space.

 

Regards,

 

DVS

It sounds like to me that you have two issues.

 

1 - You may have mistyped a command and performed an unintentional recursive delete on every file on drive 3

2 - You have a connection problem to drive3

 

If your array is coming up without disk3, and disk3 is being reconstructed as empty, it is evidence of #1.

 

DO NOT GIVE UP.  DO NOT WRITE TO THE DISK.

 

Check into REISERFSCK.  It may be able to undelete your files.

 

Good luck!

  • Author

Well I put the drive back in and booted up. it found it no problem with all it's free space and started to do a data rebuild on DISK3. I am afraid to cancel the data rebuild to try reiserfsck util. I can at least see and access the drive in my netwrok places but it is a big white screen when I do - No Data there.

 

So all this aside. when it is done rebuilding (no)data and in either case there is or is not data. Is my parity up to date then? Will I be safe to re-rip those movies to that disk if need be.

 

  I am sure this is all caused by the nut behind the wheel (me) with my limited Linux skill but I still cannot see how deleting a folder can cause this much grief, especsially when it was done in windows and not on the server directly.

 

Thanks,

 

DVS

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.