Access Denied to HDD

no01BlackBear

New Member
Joined
Jun 19, 2023
Messages
4
Reaction score
0
Credits
35
Debian 12.4 is the OS, getting a message "Access Denied" when trying to make a hard drive into a backup, can not find any info on this problem I also get the same message on external SSD.
I used G parted to format and partition all the drives including that I am running Debian on. Any help to links will be appertained Thank you
 


There may be several reasons for this behavior, which can manifest as an “Access Denied” message when you try to create a hard drive backup or work with external SSDs in Debian 12.4. Below are some troubleshooting steps and suggestions to help you fix the problem.

Check Permissions
Confirm that you have the necessary rights to access and modify the drives using the following command. In some operations, sudo (superuser) privileges might be required.
sudo <your_backup_command_here>
Filesystem Mount Permissions
Examine permissions on filesystems of hard disk and external SSD. The file /etc/fstab could be checked to see how they are mounted and what permissions are set for them.
Check Ownership
Find out whether you own files and directories on those disks or not by listing file ownerships using ls -l command: ls -l /path/to/your/drive
Error Messages
When such “Access Denied” messages come up, there may be other error messages following them containing more details about the problem itself.
SMART Status
You can use tools like smartctl to test your hard drives’ SMART status; this helps identify any possible problems connected with hardware.
Check Logs
Go through system logs to find any helpful error messages. Data on login attempts could be found in /var/log/syslog or /var/log/messages.
 
Thank you Miles Web for the info. I will go though all these, and make i post the info for all. Thank you agin
 
Hi Miles Web according to the info i found out using the tools which i had to download Debian 12 no longer as root access it has sudo
when i made the hard drive partitions i was actually root this is a new install so i no longer have access to these drives, so this makes sense, all hard drives where completely erased when i was backing up my main drive, 2 puppies decided to play with my keyboard,
lost every thing. Yes starting over, so i need to be root user to have access to these drives. How do i accomplish this in Debian 12?
 
Try:
Code:
sudo passwd root
That should set a password for root. The sudo command will likely ask you to enter your user passwd. After setting root's password, you can run:
Code:
su -
enter root's password and then become the root user.
 
Hi I tried that but it did not give me access to the 2 drives. From what i have been reading you to do the root password when you make install, i never got that option so do i do the install agin or can i make a root account now?
 
Last edited:
Hi I tried that but it did not give me access to the 2 drives. From what i have been reading you to do the root password when you make install, i never got that option so do i do the install agin or can i make a root account now?
To be helpful perhaps provide information about exactly what you have done.

You do not need to re-install to create a root password and a root account. You can follow the commands in post #5 and that should be sufficient. If you've tried that and had a problem, then it would be helpful if you transcribed the exact commands and output from your terminal to this thread so that readers can see what the state of the matter is. You can cut and paste them so as to have the output exact.

In relation to the external drive, some more information would be helpful. Here is the output of a machine with two drives:
Code:
[fan@owl ~]$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda      8:0    0 931.5G  0 disk
├─sda1   8:1    0   200M  0 part
├─sda2   8:2    0    50G  0 part
├─sda3   8:3    0     6G  0 part
└─sda4   8:4    0 875.3G  0 part
sdb      8:16   0 931.5G  0 disk
├─sdb1   8:17   0   190M  0 part /boot/efi
├─sdb2   8:18   0  46.6G  0 part /
├─sdb3   8:19   0   5.6G  0 part [SWAP]
└─sdb4   8:20   0 879.2G  0 part /home
sr0     11:0    1  1024M  0 rom

You can run the command, lsblk on your machine with the external drive connected, transcribe the output here using code tags, so that readers can see what your kernel sees from the output.

In the above output, there are two drives, sda and sdb and the cdrom. To find the permissions of each one can run the following:
Code:
[fan@owl ~]$ ls -al /dev/sda
brw-rw---- 1 root disk 8, 0 Jan 31 09:07 /dev/sda

[fan@owl ~]$ ls -al /dev/sdb
brw-rw---- 1 root disk 8, 16 Jan 31 09:07 /dev/sdb

[fan@owl ~]$ ls -al /dev/sr0
brw-rw----+ 1 root cdrom 11, 0 Jan 31 09:07 /dev/sr0

From the output it is clear who owns what. It would be helpful if you could provide the same information from your system here so that readers can see the situation. And please use code tags.
 
Last edited:

Staff online


Top