Permission problem. I can't use /dev/sdb1 (ext4) to copy or save files
Ubuntu 20.04 user. I have enough space in SSD.
Using Disks/GParted in a Linux system, how to convert my internal HDD into a storage drive so that I can use it as a USB.
Since that disks shows root as owner, I have no permission to use it. I just want to solve this issue any way. When I try to drag a folder to copy it there, it doesn't copy; it returns to its original position (repels).
Is it a mounting error? Error in choosing file type?
I have doubts in formatting using Disks app.
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Manfred Hampl
- Solved:
- Last query:
- Last reply:
Revision history for this message
|
#1 |
Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 1947256831 1947254784 928.5G 83 Linux
/dev/sdb2 1947258878 1953523711 6264834 3G 5 Extended
/dev/sdb5 1947258880 1953523711 6264832 3G 82 Linux swap / Solaris
Revision history for this message
|
#2 |
Did you create a mount point for /dev/sda1 or how do you access it?
Revision history for this message
|
#3 |
Is is sda or sdb?
On which device is your root file system?
Revision history for this message
|
#4 |
Ok. I think there is something wrong. This has sda also. I didn't mentioned it. Let me try to format it. I think I must format it. Am I right?
Revision history for this message
|
#5 |
/dev/sda1 2048 1050623 1048576 512M EFI System
/dev/sda2 1050624 468860927 467810304 223.1G Linux filesystem
Revision history for this message
|
#6 |
Why do you think that you have to format any partition? They are already formatted. Be careful with re-formatting, because you will lose all data that is stored in a partition if you re-format that partition.
What is the output of the commands
mount
cat /etc/fstab
Revision history for this message
|
#7 |
Took time for formatting. Sorry for the delay.
Now my drives look like this: file system ends in /dev/sda2. I wish to use the other drive like a USB
Device Start End Sectors Size Type
/dev/sda1 2048 19531775 19529728 9.3G Linux swap
/dev/sda2 19531776 468860927 449329152 214.3G Linux filesystem
Device Boot Start End Sectors Size Id Type
/dev/sdb1 976760832 1953523711 976762880 465.8G 83 Linux
/dev/sdb2 2048 976760831 976758784 465.8G 83 Linux
=======
madhu@madhu:
sysfs on /sys type sysfs (rw,nosuid,
proc on /proc type proc (rw,nosuid,
udev on /dev type devtmpfs (rw,nosuid,
devpts on /dev/pts type devpts (rw,nosuid,
tmpfs on /run type tmpfs (rw,nosuid,
/dev/sda2 on / type ext4 (rw,relatime,
securityfs on /sys/kernel/
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /run/lock type tmpfs (rw,nosuid,
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,
cgroup2 on /sys/fs/
cgroup on /sys/fs/
pstore on /sys/fs/pstore type pstore (rw,nosuid,
none on /sys/fs/bpf type bpf (rw,nosuid,
cgroup on /sys/fs/
cgroup on /sys/fs/
cgroup on /sys/fs/
cgroup on /sys/fs/
cgroup on /sys/fs/
cgroup on /sys/fs/
cgroup on /sys/fs/
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,
cgroup on /sys/fs/
cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,
cgroup on /sys/fs/
systemd-1 on /proc/sys/
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,
mqueue on /dev/mqueue type mqueue (rw,nosuid,
configfs on /sys/kernel/config type configfs (rw,nosuid,
fusectl on /sys/fs/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
/var/lib/
binfmt_misc on /proc/sys/
tmpfs on /run/snapd/ns type tmpfs (rw,nosuid,
nsfs on /run/snapd/
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,
/dev/fuse on /run/user/1000/doc type fuse (rw,nosuid,
nsfs on /run/snapd/
/dev/sdb1 on /media/madhu/Family type ext4 (rw,nosuid,
madhu@madhu:
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda2 during installation
UUID=2adc7727-
# swap was on /dev/sda1 during installation
UUID=bf26ee19-
madhu@madhu:
Revision history for this message
|
#8 |
I thought my file systems are distributed in the two partitions/drives. So I decided to format. Now HDD is separated from filesystem. But still the problem persists. So need I format that drive into another type?
Revision history for this message
|
#11 |
See # 7 & # 8 also.
I wish to know which type from this list should I use while formatting the storage partition (HDD):
(Linux Swap, Linux, Linux LVM, Linux RAID auto)
if don't use other OS in my PC.
Of the four, which one would you prefer or should I use? ..... Is it Linux RAID auto?
Revision history for this message
|
#12 |
That is your current setup:
Device Start End Sectors Size Type
/dev/sda1 2048 19531775 19529728 9.3G Linux swap
/dev/sda2 19531776 468860927 449329152 214.3G Linux filesystem
Device Boot Start End Sectors Size Id Type
/dev/sdb1 976760832 1953523711 976762880 465.8G 83 Linux
/dev/sdb2 2048 976760831 976758784 465.8G 83 Linux
/dev/sda2 on / type ext4 (rw,relatime,
/dev/sdb1 on /media/madhu/Family type ext4 (rw,nosuid,
sda1 is the swap partition
sda2 is your root file system, there are all programs, your home directory, etc.
sdb1 is an additional file system for storage, for accessing it you have to use the directory "/media/
There is an additional partition /dev/sdb2 which seems not formatted yet.
Is there a specific reason why the sdb disk is partitioned into two partitions (465 GB each)?
"I wish to use the other drive like a USB" What exactly do you want to do?
Revision history for this message
|
#13 |
"Is there a specific reason why the sdb disk is partitioned into two partitions (465 GB each)?"
~ For two users.
"I wish to use the other drive like a USB" What exactly do you want to do?"
~ I want the HDD to use just as a storage..without using it as a file system...which can be partitioned easily. It is an internal HDD. So I don't want to detach it from the CPU. It must be user friendly and it must have all the provisions of a USB (except attaching and detaching.)...Not as a permanently mounted one.
Now I can't save anything on that drive. Need I format it?.....into which type of linux (as mentioned in #11?
Revision history for this message
|
#14 |
Since nothing is in it I am not afraid to format it.
Revision history for this message
|
#15 |
"I want the HDD to use just as a storage..without using it as a file system"
This is contradictory. To be able to store files on a device that device has to have a file system.
"Now I can't save anything on that drive. Need I format it?"
The sdb1 partition is already formatted. If you cannot store files on it, then most probably the access rights settings are wrong.
What is the output of the commands
ls -l /media
ls -l /media/madhu
ls -l /media/madhu/Family
Revision history for this message
|
#16 |
madhu@madhu:
total 4
drwxr-x---+ 2 root root 4096 Jan 15 13:55 madhu
madhu@madhu:
total 0
madhu@madhu:
ls: cannot access '/media/
madhu@madhu:
Revision history for this message
|
#17 |
Seven hours ago the sdb1 partition was mounted on /media/
What is the output of
sudo fdisk -l /dev/sda /dev/sdb
mount | grep '/sd'
Revision history for this message
|
#18 |
ok
madhu@madhu:
[sudo] password for madhu:
Sorry, try again.
[sudo] password for madhu:
Disk /dev/sda: 223.58 GiB, 240057409536 bytes, 468862128 sectors
Disk model: WDC WDS240G2G0A-
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 4448DC69-
Device Start End Sectors Size Type
/dev/sda1 2048 19531775 19529728 9.3G Linux swap
/dev/sda2 19531776 468860927 449329152 214.3G Linux filesystem
Disk /dev/sdb: 931.53 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: WDC WD10EZEX-08W
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x91487640
Device Boot Start End Sectors Size Id Type
/dev/sdb1 976760832 1953523711 976762880 465.8G 83 Linux
/dev/sdb2 2048 976760831 976758784 465.8G 83 Linux
Partition table entries are not in disk order.
madhu@madhu:
Revision history for this message
|
#19 |
And please the output of
mount | grep '/sd'
Revision history for this message
|
#20 |
madhu@madhu:
/dev/sda2 on / type ext4 (rw,relatime,
madhu@madhu:
Revision history for this message
|
#21 |
Ok, /deb/sdb1 is not mounted any more (for whatever reason).
If you want to access or create files on a disk partition you have to mount that partition into the root file system tree.
If you plug an USB stick into the computer (and if you have configured the system accordingly), mounting is done automatically and a mount point (e.g. /media/
Setting up automatic mounting of an additional disk partition requires the following:
Create an empty directory for the mount point
Set the directory access protections such that the persons who should be able to access the files have the correct access rights (and everybody else hasn't).
Create an entry with mount point and partition (and eventually additional options) in the /etc/fstab file.
Another possibility is just using the file explorer program (nautilus) to mount the partition whenever you need (by clicking on the icon for the disk partition). After doing this for the first time you have to verify whether the access rights are correct (and changing them if required).
Revision history for this message
|
#22 |
I think my first disk is Ok.
Now, to the second disk, need I use the Live USB again? I think I needn't.
I just watched this video: https:/
The devices must appear after Trash (but in the second drive). If so should I depend on file system of SSD?
Need I create one more mount point (/)? If so three partitions on the second disc and two equal size disks?
I wish to use GParted for creating such partition. I think that might be easier.
Revision history for this message
|
#23 |
I just watched this video: ... I wish to make my disk appear like that."
In the video it is a USB stick, but you have a built-in hard disk.
Besides that the operating system and thus the versions of nautilus are different and do not look the same.
Revision history for this message
|
#24 |
#21 & #23 are highly valuable to me. But didn't solve the problem.
I think my doubts would be cleared and the problem would be solved if you could tell me "the details" and "tick marks" I should enter in the "Disk" application.
-------
I wish to fill in the Mount options:
Mount system startup
Show in user interface
Required additional authorization to mount
Display Name
Icon Name
Symbolic Icon Name
Mount Point
Identify As
Filesystem type
-------
Need I insert anything in front of in the last 3?
Revision history for this message
|
#25 |
See #24 also
Here I have
Mount point: /mnt/1cxxxxxxxx
Identify As: /dev/disk/
Filesystem Type: auto
I don't know whether my (following) guess is ok.
Display Name.......(Name of that disk)
Icon Name.......(Title under which the disk should appear)
Mount Point..
Revision history for this message
|
#26 |
Sorry, but I do not understand your last two comments.
Revision history for this message
|
#29 |
It is about the default application "Disks". If you click on the button for unmount (while clicking on the specified disk) you can see Edit options for entering those details in one of the window of that app (in format button).
I strongly believe that this issue can be solved if I know the entries for that window--for editing.
The last three lines are my guess. I don't know whether the entries are right or wrong.
Revision history for this message
|
#30 |
If my words are not clear please see figure C of this link:
https:/
Revision history for this message
|
#31 |
The first step that you have to do is deciding on the mount point. This is needed in any case, independent whether you configure by editing the fstab file or using a GUI.
I advise against using complicated names with hex IDs like /mnt/1cxxxxxxxx
For the additional options that you might need see the advice in the linked document: "If you're not sure about the mount options (such as nosuid, nodev, nofail, etc), issue the command man mount and look through the FILESYSTEM-
Revision history for this message
|
#32 |
At present it has (nosuid,
Revision history for this message
|
#33 |
I don't think terminal commands are not needed for this kind of use...with different partitions/drives. Isn't this a normal case?
Revision history for this message
|
#35 |
At present it has (nosuid,
I don't think terminal commands or gedit are not needed for this kind of issues...about different partitions/drives. Isn't this a normal case?
The guy who came to install Ubuntu installed it on SSD and after the installation he partitioned it into two; without using any Live USB and formatted that drive.
Revision history for this message
|
#36 |
Just to explain:
Configuration settings in Linux systems are stored in configuration files.
If someone has to change some settings, the contents of the related configuration file have to be adapted.
This usually can be done by editing the config file with a text editor (with the potential risk of adding nonsense values into the config file such that the system does not work as desired), but for several frequently used configuration actions there is also a GUI program that helps you (by proposing only allowed values, doing syntax and consistency checks before saving, etc.).
Revision history for this message
|
#37 |
Have you already decided on a mount point?
You have to create an empty directory there and set the access rights the way you need them.
Already written in comment #21. This has nothing to do with wrong formatting.
Revision history for this message
|
#39 |
Yes. How to create an empty directory there and set the access rights? Is it by right-clicking and giving permission as we do in the case of folders?
When I mount it, its parent folder is /mnt/1c1xxxxxxx
Revision history for this message
|
#40 |
You need admin rights to create a directory in the area outside your home directory, and that is best done via command line using sudo.
e.g. something like
sudo mkdir /mnt/madhu
sudo chown madhu:madhu /mnt/madhu
mkdir /mnt/madhu/data
Revision history for this message
|
#42 |
I couldn't notice post #36.
That HDD had Ubuntu 16.04. The guy didn't give slow format option while installing Ubuntu.
Since I encountered the same issue I was compelled to delete the two partitions and format (slow format) (Named as ARCHIVES) and changed the file type to W95 FAT32(LBA).
Now "Permission" section and the mount point on the windows shows good. But I face the same problem. I rebooted the system and tried. But the same issue....
Now which terminal command should I use to detect the fault and proceed? Need I use the same command since there are only two disks (one with a new name)?
Here are the screenshots:
http://
Revision history for this message
|
#43 |
Whaat is now the output of the commands
ls -la /media
ls -la /media/madhu
ls -la /media/
mount | grep sd
cat /etc/fstab
In my opinion it does not make much sense to use a file system in Microsoft proprietary format on a Linux system unless you want to access that disk partition from both Windows and Ubuntu, but that was your decision.
Revision history for this message
|
#44 |
madhu@madhu:
total 16
drwxr-xr-x 4 root root 4096 Jan 17 17:25 .
drwxr-xr-x 20 root root 4096 Jan 14 21:19 ..
drwxr-x---+ 2 root root 4096 Jan 17 17:31 jayanth
drwxr-x---+ 2 root root 4096 Jan 17 17:07 madhu
madhu@madhu:
total 8
drwxr-x---+ 2 root root 4096 Jan 17 17:07 .
drwxr-xr-x 4 root root 4096 Jan 17 17:25 ..
madhu@madhu:
ls: cannot access '/media/
madhu@madhu:
/dev/sda2 on / type ext4 (rw,relatime,
cgroup2 on /sys/fs/
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,
madhu@madhu:
Revision history for this message
|
#45 |
See # 44 also
I don't wish to use Windows in future also.
Revision history for this message
|
#46 |
You have to change ownership to yourself for the /media/madhu directory
Revision history for this message
|
#50 |
The ownership of /media/madhu directory is to root. So I don't know how to change it. Need I open that folder in Terminal?
Is this the command?
chmod o+rwx file1
Revision history for this message
|
#51 |
See #50
If it is the command, need I add any sign or make any change in the command line?
Revision history for this message
|
#52 |
I have already given the answer in comment #40
sudo chown madhu:madhu /media/madhu
Revision history for this message
|
#53 |
That command didn't work.
madhu@madhu:
[sudo] password for madhu:
madhu@madhu:
Is it because there is a space before / ?
Revision history for this message
|
#54 |
How do you know that the command didn't work?
Revision history for this message
|
#55 |
What is the output of
ls -la /media
ls -la /media/madhu
Revision history for this message
|
#56 |
Gave permission
But not working.
Revision history for this message
|
#57 |
What is not working?
Is the partition of the second hard disk already mounted there?
Revision history for this message
|
#58 |
Still nothing can't copy into (HDD) ie ARCHIVE. The second hard disk is already mounted. ARCHIVES shows the folder is empty and I can't copy anything into that folder.
Revision history for this message
|
#59 |
madhu@madhu:
total 16
drwxr-xr-x 4 root root 4096 Jan 17 17:25 .
drwxr-xr-x 20 root root 4096 Jan 14 21:19 ..
drwxr-x---+ 2 root root 4096 Jan 17 17:31 jayanth
drwxrwxrwx+ 2 madhu madhu 4096 Jan 17 22:42 madhu
madhu@madhu:
Revision history for this message
|
#60 |
What is the output of
ls -la /media/madhu
mount | grep sd
?
Revision history for this message
|
#61 |
madhu@madhu:
total 8
drwxrwxrwx+ 2 madhu madhu 4096 Jan 17 22:46 .
drwxr-xr-x 4 root root 4096 Jan 17 17:25 ..
madhu@madhu:
Revision history for this message
|
#65 |
Luckily now it is working. Thanks
Copy paste is working;. Dragging is not working. But I that is never a must. So, need I still wait for editing any configuration?
Even though I didn't install Ubuntu by myself, I wish to get some basic advice from you while attempting this type of installation. Before this installation I didn't need this type of installation since I had only a single hard disk. But from next year onwards I will need to install Ubuntu like this--without touching HDD while installing Ubuntu. That was why I am not interested terminal command in this case. And the reason for using "Disks" App and GParted. But now in 20.04 GParted is not a default app. So I will need to use "Disks" App from now on.
You commented about the File type in #43. I wish to know your best choice for a linux-only-system for this type of a partition.
Revision history for this message
|
#66 |
What kind of dragging is not working? What are you dragging where?
And file system type: My suggestion would have been ext4 (or ext3) and not FAT* or ntfs. If you have specific needs then also other file systems could be the recommended choice (e.g. btrfs), see also https:/
Revision history for this message
|
#71 |
From this image mine is ext4
http://
Clicking and dragging, I mean "Clicking and dragging a new file/folder to ARCHIVES for copying".
I got a comparison chart from Gpart..
GParted shows ext4
http://
Revision history for this message
|
#72 |
Thanks Manfred Hampl, that solved my question.
Revision history for this message
|
#73 |
Thanks, Manfred Hampl.
I was confused while using a system installed by a person who was not familiar with Linux. I didn't know whom to contact. Also I couldn't inform the details in #65 earlier. All the pieces of information are very valuable to me. I have edited the title so that your great effort should help others also who google for "permission", "copy" etc.
Thanks. Thanks a lot.