0

I have bought a new 1TB hard disk and formatted in ext4 file system type and attached to my CPU(Already having a HD with Ubuntu installed). Following the answer given here, I tried mounting the partition inside my Home directory(/home/user) to the path /home/user/1TB, by issuing the command sudo mount -o rw,uid=1001,gid=1001,user /dev/sdb1 1TB/. But each time I am getting the following error.

mount: wrong fs type, bad option, bad superblock on /dev/sdb1,
   missing codepage or helper program, or other error
   In some cases useful info is found in syslog - try
   dmesg | tail  or so

This is dmesg | tail output.

[52645.165434] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[52647.978811] r8169 0000:02:00.0 eth0: link up
[52647.978823] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[52653.411041] systemd-hostnamed[5821]: Warning: nss-myhostname is not installed. Changing the local hostname might make it unresolveable. Please install nss-myhostname!
[52678.211828] usb 1-1.4: USB disconnect, device number 8
[52928.283129] type=1400 audit(1418185818.128:68): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/sbin/mysqld" pid=10379 comm="apparmor_parser"
[53659.877790] EXT4-fs (sdb1): Unrecognized mount option "uid=1001" or missing value
[56166.333706] EXT4-fs (sdb1): Unrecognized mount option "uid=1001" or missing value
[56257.211210] EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts:  (null)
[56439.684477] EXT4-fs (sdb1): Unrecognized mount option "uid=1001" or missing value

But when mounting by issuing command sudo mount -o rw /dev/sdb1 1TB/, it mouted succefully, but the user don't have the permission to create files or directories inside it.

Ultimately, what I need is, I could mount the extra HD to any folder inside my home directory and also want make it permanent. Please advice on this.

1
  • try tail -n 3 /etc/passwd and check the uid corresponds to your username.
    – sourav c.
    Dec 10, 2014 at 5:41

1 Answer 1

0

The uid= and gid= options do not apply to ext4 file systems.

All you need to do is mount the file system as you did (sudo mount -o rw /dev/sdb1 1TB/).

Then sudo chown myusername:mygroupname 1TB

Then you will own the file system you created and will be able to create files there as yourself.

2
  • How can i make it permanent by editing fstab ? Dec 10, 2014 at 6:55
  • Add this line to /etc/fstab: /dev/sdb1 /home/myusername/1TB ext4 rw 0 1 Dec 10, 2014 at 22:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.