• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

Locked out of drive on Ubuntu Server

Joined
Nov 8, 2008
Messages
779 (0.16/day)
Location
Sydney, Australia
System Name Gearbox || Server
Processor i5 3570K @ 4.0Ghz || E8400 @ Stock 3Ghz
Motherboard Gigabyte Z68XP-UD3 || Gigabyte EP41-UD3L
Cooling Stock || Stock
Memory 8GB G.Skill RipjawX DDR3 @ 1600mhz || 4GB Kingston Value DDR2 800Mhz
Video Card(s) ASUS R9 270X Direct CU II TOP @ 1120/1500 || N/A
Storage Samsung 840 EVO 250GB || 1TB WD Green, 2TB WD Green, 3TB WD Red
Display(s) HP x23 LED 23" Full HD Panel
Case Corsair 200R || Open-Air
Audio Device(s) Audioengine D1 + Logitech Z623/Audio Technica ATH-M50 || N/A
Power Supply Antec EarthWatts Platinum 650 W || Antec Neo Eco 450 W
Software Windows 8.1 Update 3 Pro 64 || Ubuntu Server 14.04 64
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? :confused:
 

Aquinus

Resident Wat-man
Joined
Jan 28, 2012
Messages
12,367 (3.47/day)
Location
Concord, NH
System Name Apollo
Processor Intel Core i9 9880H
Memory 64GB DDR4-2667
Video Card(s) AMD Radeon Pro 5600M, 8GB HBM2
Storage 1TB Apple NVMe, 4TB External
Display(s) Laptop @ 3072x1920 + 2x LG 5k Ultrafine TB3 displays
Case MacBook Pro (16", 2019)
Audio Device(s) AirPods Pro, Sennheiser HD 380s w/ FIIO Alpen 2, or Logitech 2.1 Speakers
Power Supply 96w Power Adapter
Mouse Logitech MX Master 3
Keyboard Full Size Wireless Apple Magic Keyboard
Software MacOS 10.15.7
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? :confused:

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
 
Joined
Nov 8, 2008
Messages
779 (0.16/day)
Location
Sydney, Australia
System Name Gearbox || Server
Processor i5 3570K @ 4.0Ghz || E8400 @ Stock 3Ghz
Motherboard Gigabyte Z68XP-UD3 || Gigabyte EP41-UD3L
Cooling Stock || Stock
Memory 8GB G.Skill RipjawX DDR3 @ 1600mhz || 4GB Kingston Value DDR2 800Mhz
Video Card(s) ASUS R9 270X Direct CU II TOP @ 1120/1500 || N/A
Storage Samsung 840 EVO 250GB || 1TB WD Green, 2TB WD Green, 3TB WD Red
Display(s) HP x23 LED 23" Full HD Panel
Case Corsair 200R || Open-Air
Audio Device(s) Audioengine D1 + Logitech Z623/Audio Technica ATH-M50 || N/A
Power Supply Antec EarthWatts Platinum 650 W || Antec Neo Eco 450 W
Software Windows 8.1 Update 3 Pro 64 || Ubuntu Server 14.04 64
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. :ohwell:
 

Aquinus

Resident Wat-man
Joined
Jan 28, 2012
Messages
12,367 (3.47/day)
Location
Concord, NH
System Name Apollo
Processor Intel Core i9 9880H
Memory 64GB DDR4-2667
Video Card(s) AMD Radeon Pro 5600M, 8GB HBM2
Storage 1TB Apple NVMe, 4TB External
Display(s) Laptop @ 3072x1920 + 2x LG 5k Ultrafine TB3 displays
Case MacBook Pro (16", 2019)
Audio Device(s) AirPods Pro, Sennheiser HD 380s w/ FIIO Alpen 2, or Logitech 2.1 Speakers
Power Supply 96w Power Adapter
Mouse Logitech MX Master 3
Keyboard Full Size Wireless Apple Magic Keyboard
Software MacOS 10.15.7
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. :ohwell:

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?
 
Joined
Nov 8, 2008
Messages
779 (0.16/day)
Location
Sydney, Australia
System Name Gearbox || Server
Processor i5 3570K @ 4.0Ghz || E8400 @ Stock 3Ghz
Motherboard Gigabyte Z68XP-UD3 || Gigabyte EP41-UD3L
Cooling Stock || Stock
Memory 8GB G.Skill RipjawX DDR3 @ 1600mhz || 4GB Kingston Value DDR2 800Mhz
Video Card(s) ASUS R9 270X Direct CU II TOP @ 1120/1500 || N/A
Storage Samsung 840 EVO 250GB || 1TB WD Green, 2TB WD Green, 3TB WD Red
Display(s) HP x23 LED 23" Full HD Panel
Case Corsair 200R || Open-Air
Audio Device(s) Audioengine D1 + Logitech Z623/Audio Technica ATH-M50 || N/A
Power Supply Antec EarthWatts Platinum 650 W || Antec Neo Eco 450 W
Software Windows 8.1 Update 3 Pro 64 || Ubuntu Server 14.04 64
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
 

Aquinus

Resident Wat-man
Joined
Jan 28, 2012
Messages
12,367 (3.47/day)
Location
Concord, NH
System Name Apollo
Processor Intel Core i9 9880H
Memory 64GB DDR4-2667
Video Card(s) AMD Radeon Pro 5600M, 8GB HBM2
Storage 1TB Apple NVMe, 4TB External
Display(s) Laptop @ 3072x1920 + 2x LG 5k Ultrafine TB3 displays
Case MacBook Pro (16", 2019)
Audio Device(s) AirPods Pro, Sennheiser HD 380s w/ FIIO Alpen 2, or Logitech 2.1 Speakers
Power Supply 96w Power Adapter
Mouse Logitech MX Master 3
Keyboard Full Size Wireless Apple Magic Keyboard
Software MacOS 10.15.7
So after you chmod and chown the directory, what does "ls -l /media/" show?

Preferably a before and after would be nice.
 
Joined
Nov 8, 2008
Messages
779 (0.16/day)
Location
Sydney, Australia
System Name Gearbox || Server
Processor i5 3570K @ 4.0Ghz || E8400 @ Stock 3Ghz
Motherboard Gigabyte Z68XP-UD3 || Gigabyte EP41-UD3L
Cooling Stock || Stock
Memory 8GB G.Skill RipjawX DDR3 @ 1600mhz || 4GB Kingston Value DDR2 800Mhz
Video Card(s) ASUS R9 270X Direct CU II TOP @ 1120/1500 || N/A
Storage Samsung 840 EVO 250GB || 1TB WD Green, 2TB WD Green, 3TB WD Red
Display(s) HP x23 LED 23" Full HD Panel
Case Corsair 200R || Open-Air
Audio Device(s) Audioengine D1 + Logitech Z623/Audio Technica ATH-M50 || N/A
Power Supply Antec EarthWatts Platinum 650 W || Antec Neo Eco 450 W
Software Windows 8.1 Update 3 Pro 64 || Ubuntu Server 14.04 64
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
 

Aquinus

Resident Wat-man
Joined
Jan 28, 2012
Messages
12,367 (3.47/day)
Location
Concord, NH
System Name Apollo
Processor Intel Core i9 9880H
Memory 64GB DDR4-2667
Video Card(s) AMD Radeon Pro 5600M, 8GB HBM2
Storage 1TB Apple NVMe, 4TB External
Display(s) Laptop @ 3072x1920 + 2x LG 5k Ultrafine TB3 displays
Case MacBook Pro (16", 2019)
Audio Device(s) AirPods Pro, Sennheiser HD 380s w/ FIIO Alpen 2, or Logitech 2.1 Speakers
Power Supply 96w Power Adapter
Mouse Logitech MX Master 3
Keyboard Full Size Wireless Apple Magic Keyboard
Software MacOS 10.15.7
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?
 
Joined
Nov 8, 2008
Messages
779 (0.16/day)
Location
Sydney, Australia
System Name Gearbox || Server
Processor i5 3570K @ 4.0Ghz || E8400 @ Stock 3Ghz
Motherboard Gigabyte Z68XP-UD3 || Gigabyte EP41-UD3L
Cooling Stock || Stock
Memory 8GB G.Skill RipjawX DDR3 @ 1600mhz || 4GB Kingston Value DDR2 800Mhz
Video Card(s) ASUS R9 270X Direct CU II TOP @ 1120/1500 || N/A
Storage Samsung 840 EVO 250GB || 1TB WD Green, 2TB WD Green, 3TB WD Red
Display(s) HP x23 LED 23" Full HD Panel
Case Corsair 200R || Open-Air
Audio Device(s) Audioengine D1 + Logitech Z623/Audio Technica ATH-M50 || N/A
Power Supply Antec EarthWatts Platinum 650 W || Antec Neo Eco 450 W
Software Windows 8.1 Update 3 Pro 64 || Ubuntu Server 14.04 64
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!
 

Aquinus

Resident Wat-man
Joined
Jan 28, 2012
Messages
12,367 (3.47/day)
Location
Concord, NH
System Name Apollo
Processor Intel Core i9 9880H
Memory 64GB DDR4-2667
Video Card(s) AMD Radeon Pro 5600M, 8GB HBM2
Storage 1TB Apple NVMe, 4TB External
Display(s) Laptop @ 3072x1920 + 2x LG 5k Ultrafine TB3 displays
Case MacBook Pro (16", 2019)
Audio Device(s) AirPods Pro, Sennheiser HD 380s w/ FIIO Alpen 2, or Logitech 2.1 Speakers
Power Supply 96w Power Adapter
Mouse Logitech MX Master 3
Keyboard Full Size Wireless Apple Magic Keyboard
Software MacOS 10.15.7
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.
 
Top