techPowerUp! Forums

Go Back   techPowerUp! Forums > Software > Linux / BSD / Mac OS X

Reply
 
Thread Tools
Old Nov 18, 2012, 10:12 AM   #1
<<Onafets>>
500 Posts
 
<<Onafets>>'s Avatar
 
Join Date: Nov 2008
Location: Sydney, Australia
Posts: 757 (0.45/day)
Thanks: 490
Thanked 77 Times in 73 Posts

System Specs

Locked out of drive on Ubuntu Server

Hey guys,
I was trying to delete some torrents that I had downloaded with transmission-daemon and was unable to from my samba share on windows. I figured the best solution was to 'sudo chmod -R 0777 /media/Storage' (my drive with samba) but apparently not.
This locked both my windows user and my user on my ubuntu server out of the drive completely with a message saying 'ls: cannot access /media/Storage: Permission denied'.
I am able to login as root with 'sudo bash' and make changes however I am uncertain as to how to make my drive accessible again.
Doing a 'ls -ld' on the directory shows 'drwsrwsrwx 39 root root 4096 Nov 17 21:20 /media/Storage'
Any ideas?
__________________
“As long as you bypass the quantum septicular rings and interconnect the transmission module 3/4 the way down the flux capacitor you'll do just fine.” -Soylent Joe
“Don't go all flash. Your website would be a resource hog, slow down people's browsers and kill little baby seals.” -xbonez
<<Onafets>> is offline  
Reply With Quote
Old Nov 18, 2012, 10:37 AM   #2
Aquinus
3500 Posts
 
Aquinus's Avatar
 
Join Date: Jan 2012
Location: Dover, New Hampshire, USA
Posts: 4,508 (8.86/day)
Thanks: 1,441
Thanked 1,424 Times in 1,064 Posts

System Specs

Quote:
Originally Posted by <<Onafets>> View Post
Hey guys,
I was trying to delete some torrents that I had downloaded with transmission-daemon and was unable to from my samba share on windows. I figured the best solution was to 'sudo chmod -R 0777 /media/Storage' (my drive with samba) but apparently not.
This locked both my windows user and my user on my ubuntu server out of the drive completely with a message saying 'ls: cannot access /media/Storage: Permission denied'.
I am able to login as root with 'sudo bash' and make changes however I am uncertain as to how to make my drive accessible again.
Doing a 'ls -ld' on the directory shows 'drwsrwsrwx 39 root root 4096 Nov 17 21:20 /media/Storage'
Any ideas?
try chowning it first:

Code:
sudo chown -R [username]:[group] /to/some/path
Then try granting user permissions.

Code:
sudo chmod -R u+rw /to/some/path
__________________
MyHeat
Aquinus is offline  
Crunching for Team TPU
Reply With Quote
The Following User Says Thank You to Aquinus For This Useful Post:
Old Nov 18, 2012, 10:51 AM   #3
<<Onafets>>
500 Posts
 
<<Onafets>>'s Avatar
 
Join Date: Nov 2008
Location: Sydney, Australia
Posts: 757 (0.45/day)
Thanks: 490
Thanked 77 Times in 73 Posts

System Specs

Quote:
Originally Posted by Aquinus View Post
try chowning it first:

Code:
sudo chown -R [username]:[group] /to/some/path
Then try granting user permissions.

Code:
sudo chmod -R u+rw /to/some/path
Both commands executed without errors however I am still unable to access/ls the directory from either Windows or Ubuntu. Still getting the same 'ls: cannot access /media/Storage: Permission denied' message.
__________________
“As long as you bypass the quantum septicular rings and interconnect the transmission module 3/4 the way down the flux capacitor you'll do just fine.” -Soylent Joe
“Don't go all flash. Your website would be a resource hog, slow down people's browsers and kill little baby seals.” -xbonez
<<Onafets>> is offline  
Reply With Quote
Old Nov 18, 2012, 10:52 AM   #4
Aquinus
3500 Posts
 
Aquinus's Avatar
 
Join Date: Jan 2012
Location: Dover, New Hampshire, USA
Posts: 4,508 (8.86/day)
Thanks: 1,441
Thanked 1,424 Times in 1,064 Posts

System Specs

Quote:
Originally Posted by <<Onafets>> View Post
Both commands executed without errors however I am still unable to access/ls the directory from either Windows or Ubuntu. Still getting the same 'ls: cannot access /media/Storage: Permission denied' message.
Stop trying to access it in Windows until you can actually get into it in Linux.

Is the drive even mounted?

How does the output of
Code:
sudo mount
look?
__________________
MyHeat
Aquinus is offline  
Crunching for Team TPU
Reply With Quote
The Following User Says Thank You to Aquinus For This Useful Post:
Old Nov 18, 2012, 11:02 AM   #5
<<Onafets>>
500 Posts
 
<<Onafets>>'s Avatar
 
Join Date: Nov 2008
Location: Sydney, Australia
Posts: 757 (0.45/day)
Thanks: 490
Thanked 77 Times in 73 Posts

System Specs

Quote:
Originally Posted by Aquinus View Post
Stop trying to access it in Windows until you can actually get into it in Linux.

Is the drive even mounted?

How does the output of
Code:
sudo mount
look?
sudo mount dumps
Code:
/dev/sdb1 on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
/dev/sda1 on /media/Storage type ext4 (rw)
/dev/sda1 on /media/Storage type ext4 (rw) is the drive
__________________
“As long as you bypass the quantum septicular rings and interconnect the transmission module 3/4 the way down the flux capacitor you'll do just fine.” -Soylent Joe
“Don't go all flash. Your website would be a resource hog, slow down people's browsers and kill little baby seals.” -xbonez
<<Onafets>> is offline  
Reply With Quote
Old Nov 18, 2012, 12:25 PM   #6
Aquinus
3500 Posts
 
Aquinus's Avatar
 
Join Date: Jan 2012
Location: Dover, New Hampshire, USA
Posts: 4,508 (8.86/day)
Thanks: 1,441
Thanked 1,424 Times in 1,064 Posts

System Specs

So after you chmod and chown the directory, what does "ls -l /media/" show?

Preferably a before and after would be nice.
__________________
MyHeat
Aquinus is offline  
Crunching for Team TPU
Reply With Quote
The Following User Says Thank You to Aquinus For This Useful Post:
Old Nov 18, 2012, 12:36 PM   #7
<<Onafets>>
500 Posts
 
<<Onafets>>'s Avatar
 
Join Date: Nov 2008
Location: Sydney, Australia
Posts: 757 (0.45/day)
Thanks: 490
Thanked 77 Times in 73 Posts

System Specs

before
Code:
sudo ls -la /media/Storage
drwsrwsrwx 39 root root 4096 Nov 17 21:20 /media/Storage
after
Code:
ls -l /media
ls: cannot access /media/cdrom: Permission denied
ls: cannot access /media/Storage: Permission denied
total 0
d????????? ? ? ? ?            ? cdrom
d????????? ? ? ? ?            ? Storage

sudo ls -l
total 8
drwxr-xr-x  2 root      root      4096 Oct  8 20:30 cdrom
drwsrwsrwx 39 onafets onafets 4096 Nov 17 21:20 Storage
__________________
“As long as you bypass the quantum septicular rings and interconnect the transmission module 3/4 the way down the flux capacitor you'll do just fine.” -Soylent Joe
“Don't go all flash. Your website would be a resource hog, slow down people's browsers and kill little baby seals.” -xbonez
<<Onafets>> is offline  
Reply With Quote
Old Nov 18, 2012, 01:45 PM   #8
Aquinus
3500 Posts
 
Aquinus's Avatar
 
Join Date: Jan 2012
Location: Dover, New Hampshire, USA
Posts: 4,508 (8.86/day)
Thanks: 1,441
Thanked 1,424 Times in 1,064 Posts

System Specs

Quote:
Originally Posted by <<Onafets>> View Post
before
Code:
sudo ls -la /media/Storage
drwsrwsrwx 39 root root 4096 Nov 17 21:20 /media/Storage
after
Code:
ls -l /media
ls: cannot access /media/cdrom: Permission denied
ls: cannot access /media/Storage: Permission denied
total 0
d????????? ? ? ? ?            ? cdrom
d????????? ? ? ? ?            ? Storage

sudo ls -l
total 8
drwxr-xr-x  2 root      root      4096 Oct  8 20:30 cdrom
drwsrwsrwx 39 onafets onafets 4096 Nov 17 21:20 Storage
Hmmm, and you can't access it now? I'm assuming "onafets" is your account.

When you restart are the permissions the same?

These are the permissions that I have on my workstation for /media

maybe

Code:
sudo chown -R root:root /media
sudo chmod -R 775 /media
Restart before you try anything else then tell me how it works. Also are you mounting the drive or is Ubuntu doing it for you?
__________________
MyHeat
Aquinus is offline  
Crunching for Team TPU
Reply With Quote
The Following User Says Thank You to Aquinus For This Useful Post:
Old Nov 18, 2012, 07:46 PM   #9
<<Onafets>>
500 Posts
 
<<Onafets>>'s Avatar
 
Join Date: Nov 2008
Location: Sydney, Australia
Posts: 757 (0.45/day)
Thanks: 490
Thanked 77 Times in 73 Posts

System Specs

Code:
sudo chmod -R 775 /media
Allows me to access the drive and its contents however I ended up modifying it to 777 so I was able to delete my files. Thank you!
__________________
“As long as you bypass the quantum septicular rings and interconnect the transmission module 3/4 the way down the flux capacitor you'll do just fine.” -Soylent Joe
“Don't go all flash. Your website would be a resource hog, slow down people's browsers and kill little baby seals.” -xbonez
<<Onafets>> is offline  
Reply With Quote
Old Nov 18, 2012, 07:54 PM   #10
Aquinus
3500 Posts
 
Aquinus's Avatar
 
Join Date: Jan 2012
Location: Dover, New Hampshire, USA
Posts: 4,508 (8.86/day)
Thanks: 1,441
Thanked 1,424 Times in 1,064 Posts

System Specs

Quote:
Originally Posted by <<Onafets>> View Post
Code:
sudo chmod -R 775 /media
Allows me to access the drive and its contents however I ended up modifying it to 777 so I was able to delete my files. Thank you!
You're welcome but make sure you're setting the right permissions to the right directory.

Code:
sudo chown root:root /media
sudo chmod 775 /media
sudo chmod -R 777 /media/Storage
Just make sure /media itself belongs to root and is chmod'ed to 775, even if Storage is 777.
__________________
MyHeat
Aquinus is offline  
Crunching for Team TPU
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ubuntu 12.04 LTS out Easy Rhino Linux / BSD / Mac OS X 3 Apr 26, 2012 10:22 PM
Headless ubuntu 10.04 media streaming server Killer_Rubber_Ducky Linux / BSD / Mac OS X 9 Aug 7, 2011 01:14 PM
Ubuntu 10.04 LTS officially out! Easy Rhino Linux / BSD / Mac OS X 37 May 31, 2010 12:49 AM
Ubuntu 8.04 is out!! mab1376 Linux / BSD / Mac OS X 5 Apr 25, 2008 10:00 AM
Ubuntu 7.10 Is Out malware News 10 Oct 19, 2007 11:49 PM


All times are GMT. The time now is 06:56 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
no new posts