Internal SATA drive in ext4, no permissions to write as user

Hi all,

New Linux user, just installed OpenSuse 11.2 a few days ago. Made the plunge from Windows XP, and did a full install.

I still had my second internal SATA 500GB HDD formatted as NTFS, and decided to reformat it to ext4, after mving all my files to an external NTFS HDD.

Used the Yast partitioner, everything seems to have gone smoothly, alothough my available drive space has shrunk another 30GB for some reason.

My main problem now, is I don’t have permission to write to the drive… copying my files from my external HDD back on.

Ideally, I’d like to use this drive for all home directories for each user on the system.

Thanks for the help.

Stephane

Post result of:

cat /etc/fstab

Thanks for the prompt reply… will do. At work now, so will post output this evening.

You might find all you need is in this guide of mine:
FSTAB - Editing Manually - openSUSE Forums

@OP

unless you post fstab we can’t really do much. However, if you want to copy something, you’d need to have permissions to do so. So if your partition is mounted in say /media/data, then you’ll have to, after mounting, set permissions on the data directory so you’ll have write access to it. Usually as root on console, you can do it by issuing the following:

chown stegouin:users /media/data

(assuming stegouin is your username on your system too, if not, change accordingly)

Also, if you’d want to be able to mount your partition as normal user, you’d have to add either the ‘users’ or ‘user’ to /etc/fstab partition params (first one gives permission for all users to be able to mount/unmount, while second one only to the user who mounted it)

I usually avoid setting the permissions on the root mount folder (in the above example of /media/data, the ‘data’ directory is the “root” mount point for that partition). I usually create a directory on the partition(s) (say Data) and set my user permissions on it so I can copy stuff easily… so on my machine, I have /media/storage as mount point, and when I mount the partition, there’s only one directory on it (Data) where I have access to and can copy/delete/etc stuff

Thanks for the replies so far… I’ll take a look at that post.

For now, here is my fstab output:


stephane@linux-k9y6:~> cat /etc/fstab
/dev/disk/by-id/ata-SAMSUNG_SP8004H_-part1 swap                 swap       defaults              0 0
/dev/disk/by-id/ata-SAMSUNG_SP8004H_-part2 /                    ext4       acl,user_xattr        1 1
/dev/disk/by-id/ata-SAMSUNG_SP8004H_-part3 /home                ext4       acl,user_xattr        1 2
/dev/sda1                                      /bigdrive            ext4       user,acl,user_xattr                                         1 2
proc                 /proc                proc       defaults              0 0
sysfs                /sys                 sysfs      noauto                0 0
debugfs              /sys/kernel/debug    debugfs    noauto                0 0
usbfs                /proc/bus/usb        usbfs      noauto                0 0
devpts               /dev/pts             devpts     mode=0620,gid=5       0 0

The drive I’m concerned about is /bigdrive (I probably need a good readme on partition names and ideal partition set-up as well!) This is a big drive, 500GB and I use it to store my media… pics, videos and music.

Change it to this

/dev/sda1    /media/storage   ext4       user,acl,user_xattr 1 2

then as root on console, mkdir -p /media/storage/Data and mount it by issuing mount /dev/sda1 then change permissions on the Data directory to your username with chown stegouin:users /media/storage/Data and just throw your files into the Data directory

of course, you’re free to choose any location/file names/ etc for the mounting. Above is just an example

PS: you may want to add noatime to the options above. It can speed up a file system up to 30% in some cases :wink:

That did it! One thing though is I had to mount /dev/sda1 before creating the data directory…

Other than that, looks like I’m the owner of the Data directory and have full rights to it.

One thing I noticed as well, and this might be because I am the owner, I now see in my Nautilus browser under “Places”, a new “500 GB Filesystem” entry… my external HDD also mounts under the /media directory…

In any case, I might tweak some of this as I can more familiar with Linux and the command-line.

I have the Linux Bible on order from the library, and plan to do some reading. :wink:

Thanks again for all the help!

Stephane

A quick follow-up question…

When I changed the mount point from /bigdrive to /media/storage… I could still see /bigdrive in the filesystem, and it’s showing 15.3 GB of free space.

I did a umount as su in terminal… it says not mounted, but still visible in file system?

Can I simply do rmdir of it and have the space re-allocated?

My fstab looks better now I think:

stephane@linux-k9y6:~> cat /etc/fstab
/dev/disk/by-id/ata-SAMSUNG_SP8004H_-part1 swap                 swap       defaults              0 0
/dev/disk/by-id/ata-SAMSUNG_SP8004H_-part2 /                    ext4       acl,user_xattr        1 1
/dev/disk/by-id/ata-SAMSUNG_SP8004H_-part3 /home                ext4       acl,user_xattr        1 2
/dev/sda1                                      /media/storage            ext4       user,acl,user_xattr                                         1 2
proc                 /proc                proc       defaults              0 0
sysfs                /sys                 sysfs      noauto                0 0
debugfs              /sys/kernel/debug    debugfs    noauto                0 0
usbfs                /proc/bus/usb        usbfs      noauto                0 0
devpts               /dev/pts             devpts     mode=0620,gid=5       0 0

if /bigdrive is unmounted (which you can check just by typing mount in console) then it becomes part of the root file system, part of /

So if your / is 15.3 GB big (or has that much space left over), then /bigdrive will also be that big

about creating other mount point in /media… sure, you can have /media/storage1, /media/storage2, /media/storage3, etc

of course, these are just examples