Announcement

Collapse
No announcement yet.

External hard drive; Lost&Found folder; formatting

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    External hard drive; Lost&Found folder; formatting

    I have a new 2TB external drive. I want to split it into two partitions, one formatted with ext4 and the other with NTFS. I can create the partitions using Gparted, and they then show up in Dolphin, but the partition that I want to format ext4 will not allow me to make new folders in it. The NTFS partition will.
    In Gparted, the ext4 partition line has a padlock right after the partition identifier (/dev/sde1). I don't seem to have a key.
    Suggestions? Thanks much.
    Last edited by Don; Dec 04, 2015, 06:36 AM.

    #2
    when you create the partition with gparted, they are assigned to root. You will need to change ownership

    For the ext4 partition
    Code:
    sudo chown (user) (mountpoint)
    you may also need
    Code:
    sudo chgrp (user) (mountpoint)
    Had to do this with my external.

    Someone correct me if I am wrong

    Comment


      #3
      You were absolutely right. Thank you.

      Comment


        #4
        The "Padlock" symbol Gparted displayed doesn't mean the file system is locked (inaccessible), it means the partition is - usually because a file system on it is mounted. It's to protect you from reformatting or deleting a file system you're using. The inability to access a file system is due to how it's mounted - not how it's created. By way of purely technical clarity: partitions aren't actually "owned" by any user. They're simply a divisional barrier dividing a storage medium, a hard drive drive in this case. The fact that you must have root access (via sudo or admin rights) to create and delete partitions doesn't mean root "owns" them. Think of a hard drive like a file cabinet and partitions like drawers. Then, once a partition exists, you create a file system on it so the operating system knows how to address the space in the partition. In this example, one drawer is NTFS and the other EXT4.

        You then must mount the file systems and this is where ownership and permissions come in. NTFS doesn't natively support the file ownership and permission system that linux uses, so when you mount it, usually all users can access it. EXT(234) do support (obviously) linux ownership and permissions. How you mount these partitions controls who has access rights. So, vsreeser was correct in his solution, but the reasons it was needed were just a bit off. The default mounting of an EXT file system sets permissions to those of the mount point but NTFS to all users.

        Here's the results of an experiment I did to illustrate:

        I created two new mount points - /nnt/ntfs and /mnt/ext4. Here's the ownership and permissions of the mount point prior to doing any mounting:

        Code:
        drwxr-xr-x 1 root root    0 Dec  4 09:00 ext4
        drwxr-xr-x 1 root root    0 Dec  4 08:59 ntfs
        Taking a USB thumb drive, I formatted it to NTFS, created a mount point (/mnt/ntfs) and mounted it:

        sudo mount /dev/sdj1 /mnt/ntfs

        Now the mount point permissions are:

        Code:
        drwxr-xr-x 1 root root    0 Dec  4 09:00 ext4
        drwxrwxrwx 1 root root 4096 Dec  4 08:47 ntfs
        so you can see, everyone has access to the ntfs mount. Now I mounted an already existing ext4 partition to /mnt/ext4:

        sudo mount /dev/sda2 /mnt/ext4

        and now the mount points show:

        Code:
        drwxr-xr-x 4 root root 4096 Sep 14 14:19 ext4
        drwxrwxrwx 1 root root 4096 Dec  4 08:47 ntfs
        You can see the difference clearly in the permissions (also note the mount points take on the date and time of the creation of the filesystems). However, I can force permissions on the ntfs mount by using the umask option when mounting, thusly:

        sudo mount -o umask=022 /dev/sdj2 /mnt/ntfs

        Now the ntfs mount looks just like the ext4 does:

        Code:
        drwxr-xr-x 4 root root 4096 Sep 14 14:19 ext4
        drwxr-xr-x 1 root root 4096 Dec  4 08:47 ntfs
        Taking this a bit further, I can mount the ntfs partition so only my user can access it:

        sudo mount -o umask=022,uid=1000,gid=1000 /dev/sdj1 /mnt/ntfs

        and the results:

        Code:
        drwxr-xr-x 4 root   root   4096 Sep 14 14:19 ext4
        drwxr-xr-x 1 stuart stuart 4096 Dec  4 08:47 ntfs
        This difference is in the default behavior. ntfs mounts defaults to wide-open permissions and others do not, but you can change this at will. If you want to make your preferred mount settings permanent, put an entry for the ntfs file system in /etc/fstab that contains your options.

        The expected behavior/setup is that root owns the mounted file system, but users may own subfolders within it. Thus, root owns /mnt, /home/ etc. but your user owns a folder in /home and all it's subfolders. ntfs is not a native file system for linux so it's treated differently, as are removable devices like thumb drives.
        Last edited by oshunluvr; Dec 04, 2015, 08:29 AM.

        Please Read Me

        Comment

        Working...
        X