Jump to content
We're Hiring! Full Stack Developer ×

How to access /dev/sda ????


Recommended Posts

I've managed to accidentally move a file to /dev/sda and now need to delete it.

 

However I am unable to gain access to /dev/sda as it returns "Permission Denied", can anyone tell me how to get access to it in order to delete the file?

 

Thanks.

 

 

Link to comment

I've managed to accidentally move a file to /dev/sda and now need to delete it.

 

However I am unable to gain access to /dev/sda as it returns "Permission Denied", can anyone tell me how to get access to it in order to delete the file?

 

Thanks.

 

 

/dev/sda would normally be one of your raw disk devices.  (might be your flash drive, or one of your SATA disks)

Only way for us to know is for you to attach a copy of your syslog for analysis to your next post.

 

In any case, you might want to describe what specific exact command you used to move the file. 

(since /dev/sda will not have a file system, odds are you clobbered the master-boot-record on that device and overwrote it. You might have some damage to fix.) 

 

You can get a listing of the devices on your server by typing

ls -l /dev/disk/by-id

 

post the output here.

 

Joe L.

Link to comment

/dev/sda is your disk1.

 

Aug 18 23:39:26 NAS kernel: md: import disk0: [8,32] (sdc) WDC WD20EARX-00P WD-WCAZA6580478 size: 1953514552

Aug 18 23:39:26 NAS kernel: md: import disk1: [8,0] (sda) WDC WD20EARS-00M WD-WCAZA3646980 size: 1953514552

Aug 18 23:39:26 NAS kernel: md: import disk2: [8,16] (sdb) WDC WD10EADS-11M WD-WCAV53474284 size: 976762552

 

  You've clobbered its MBR, that is certain, but you are in luck... you can get it re-constructed by unRAID by

 

Stopping the array

un-assign disk1

start the array with it un-assigned

stop the array once more

re-assign disk1

Start the array and let unRAID re-construct it.

 

Unfortunately, the file itself is gone. (since you moved it).

 

Joe L.

Link to comment

What evidence suggests the MBR is actually clobbered? I don't see the disk being disabled due to the partition missing.

 

It still wouldn't surprize me if you somehow just copied the files into the ram file system.

 

In either case, try an array stop and re-start. If the disks all appear fine then there was likely no damage done.

 

Peter

 

Link to comment

What evidence suggests the MBR is actually clobbered? I don't see the disk being disabled due to the partition missing.

 

It still wouldn't surprize me if you somehow just copied the files into the ram file system.

 

In either case, try an array stop and re-start. If the disks all appear fine then there was likely no damage done.

 

Peter

 

don't need to do that to verify.

 

Type

fdisk -l /dev/sda

and see what it prints.

 

and type

dd if=/dev/sda count=1 | od -x -A d

 

Nobody's looked at the MBR since the system was booted.  That is probably why it is still working.

 

A quick question... How big was the file you moved to /dev/sda?

 

Joe L.

Link to comment
Type

fdisk -l /dev/sda

and see what it prints.

 

and type

dd if=/dev/sda count=1 | od -x -A d

 

The output for both these commands is attached.

 

A quick question... How big was the file you moved to /dev/sda?

 

I think it was around 370MB, and the file itself was not important, I don't care if it is lost.

 

I haven't done the rebuild yet, am I right to go ahead and do it now??

 

I assume it will to take a while to reconstruct?? There is 1.5TB of data on the disk.

 

I should also mention the server appears to be functioning fine. It has been powered off twice since the file was moved. Data from that disk still shows up in the user shares and can be read. I haven't written to the disk yet incase it overwrites existing data or something.

 

Thanks, Ash

Output.txt

Link to comment

Type

fdisk -l /dev/sda

and see what it prints.

 

and type

dd if=/dev/sda count=1 | od -x -A d

 

The output for both these commands is attached.

 

A quick question... How big was the file you moved to /dev/sda?

 

I think it was around 370MB, and the file itself was not important, I don't care if it is lost.

 

I haven't done the rebuild yet, am I right to go ahead and do it now??

 

I assume it will to take a while to reconstruct?? There is 1.5TB of data on the disk.

 

I should also mention the server appears to be functioning fine. It has been powered off twice since the file was moved. Data from that disk still shows up in the user shares and can be read. I haven't written to the disk yet incase it overwrites existing data or something.

 

Thanks, Ash

Definitely, go through the steps I outlined.  The file was too large to not have caused damage.

 

Stop the array, un-assign the disk

Start the array with it un-assigned

Stop the array again

re-assign the disk to its same slot in the array.

let it reconstruct.  (This will take about as long as your original parity calculation)

 

Joe L.

Link to comment

Archived

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

×
×
  • Create New...