Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Thread: issue with chmod/chown

  1. #11
    Join Date
    Aug 2017
    Beans
    14

    Re: issue with chmod/chown

    ok sorry!!

    I dont know what it did what it did. I just ran the command that you mentioned.

    df -h

    Code:
    Filesystem      Size  Used Avail Use% Mounted on
    udev            2.0G     0  2.0G   0% /dev
    tmpfs           395M  6.3M  389M   2% /run
    /dev/sda1       290G  4.6G  271G   2% /
    tmpfs           2.0G  280K  2.0G   1% /dev/shm
    tmpfs           5.0M  4.0K  5.0M   1% /run/lock
    tmpfs           2.0G     0  2.0G   0% /sys/fs/cgroup
    tmpfs           395M   60K  395M   1% /run/user/1000
    /dev/sdb1       1.8T   68M  1.7T   1% /media/eightermoa/storage

    Code:
    ls -al /media/eightermoa/storage
    total 24
    drwx------  3 eightermoa eightermoa  4096 Aug 12 13:49 .
    drwxr-x---+ 3 root       root        4096 Aug 12 07:21 ..
    drwx------  2 root       root       16384 Aug 12 07:18 lost+found
    I hope the above is what you asked for. I will explain my exact steps if that helps

    downloaded ubuntu desktop from ubuntus website, used ubuntu to extract the iso file to my flash drive, booted to my flashdrive, clicked "try ubuntu", went in with gdisk and wiped all my partitions and everything, formated both drives to ext4, installed ubuntu, did all my updates/upgrades/dist-upgrades, my 1.8tb drive on /dev/sdb1 was owned by room, did sudo chmod/chown to the drive, the partition and nothing, so opened the drive, right clicked on the drive from the menu tree on the left, formated it again to ext4 and now i own it. hopefully that helps

  2. #12
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: issue with chmod/chown

    Exactly, what chown and chmod commands did you run?

    Did you run mkfs?
    Did you run mount?

    Also, you showed sda5 previously (post #7), but now you are showing sda1 and sdb1. Huh? I'm lost. Things aren't consistent.

  3. #13
    Join Date
    Aug 2017
    Beans
    14

    Re: issue with chmod/chown

    Quote Originally Posted by TheFu View Post
    Exactly, what chown and chmod commands did you run?

    Did you run mkfs?
    Did you run mount?

    Also, you showed sda5 previously (post #7), but now you are showing sda1 and sdb1. Huh? I'm lost. Things aren't consistent.
    lol you should see how lost I am LOL

    sorry for the confusion. When i posted post #7, I was running a 320 gig that had a dual boot with windows 7 and ubuntu. I replaced that hard drive last night with another 320 (i think the disc was TU) and reinstalled ubuntu on it but this time i JUST put ubuntu on, no windows 7 dual boot, maybe thinking (but highly unlikely) that the dual boot was screwing stuff up.

    I did not roun mkfs or any mount commands, I went to the search your computer thing, typed in disks and mounted it that way, didnt change any options when i mounted it just clicked mount and ok (which i am assuing is wrong).

    the commands I ran:
    Code:
    sudo chown -R eightermoa /dev/sdb
    sudo chmod ugo+wx /media/eightermoa/698052c2-c360-4c8b-9c1a-87f7bbe7c12e
    why does gparted format and lock it to root and when i do it the other way (right click on the drive in the explorer and click format) it owns it to me?

  4. #14
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: issue with chmod/chown

    We were all new at some point.

    Running commands with sudo that you don't understand is VERY DANGEROUS.

    That chown is bad - like I'd start over "bad." Never run a chown on a disk device like that. chown and chmod only work on mounted file systems (directories and files).

    That chmod command isn't so bad, but not very useful. You didn't provide "READ" access to anyone. If you want a userid or group or "other" to have read access, then the permissions need to have that.

    To save yourself confusion and frustration, my best advice is that you work through a Unix permissions tutorial (google "unix file permission tutor"). That should take about 45 minutes, tops. Most tutorials don't cover more than the basics, but that should be enough for the next 6 months.

    On your calendar, make a reminder 6 months from now to come back to learn all the permissions - there are about 4K different possible settings, but there are really just 4 groups of permissions with the specific settings for each group (just 8 really) repeating for each of the 4 groups. That means once you learn 8 permissions, you know them all, sorta.

    Ok - enough lecturing. Time for solutions.

    1. un-mount the drive. -
      Code:
      sudo umount /media/eightermoa/698052c2-c360-4c8b-9c1a-87f7bbe7c12e
      NEVER format or partition a mounted drive.
    2. create a new ext4 file system on the device. -
      Code:
      sudo mkfs -t ext4 /dev/sdb1
      sdb is the entire drive. sdb1 is the first partition inside the drive (which I assume you create somehow).
    3. create an empty directory to mount this new file system onto. That is called "a mount point" - it is just an empty directory.
      Code:
      sudo mkdir -p /D/media
    4. mount the new file system onto /D/media.
      Code:
      sudo mount -t ext4  /dev/sdb1 /D/media
      check that the mount is working using df.
      Code:
      df -h
      That should show that /dev/sdb1 is mounted to /D/media. All good?
    5. fix the owner and group for the new storage.
      Code:
      sudo chown -R  eightermoa:eightermoa /D/media
    6. make a few different media directories, as required by kodi, plex, and most other media servers.
      Code:
      cd /D/media ; mkdir Music Movies TV Photos; chmod 775 Music Movies TV Photos
      See how we didn't need sudo for that?
    7. Lastly, let's force all new files and subdirectories to use the same group, automatically in the future.
      Code:
      chmod g+s Music Movies TV Photos


    If you want to mount this storage through the fstab - and you should - then https://help.ubuntu.com/community/Au...temwide_Mounts has what you want. Basically, it comes down to 3 steps.
    a) determine the UUID for the specific partition (sdb1) that you want to mount - use blkid for that.
    b) open the fstab using sudoedit /etc/fstab (using sudoedit is the safest way to edit system files). Copy an existing line in the /etc/fstab that is working, using ext4, and modify the UUID, "mount point" and change the last field from 1 --> 2. Multiple spaces are the same as 1 space. Be certain to keep the exact number of fields, as separated by spaces. Mistakes in the fstab are bad - like your system won't boot "bad". Any line that begins with a #, is a comment. That is a common thing across almost every text file on a Unix system.
    c) Assuming the fstab is edited correctly, run sudo mount -a This will read the fstab and mount any devices specified inside there as the options request. Already mounted storage will be left alone. If you umount (there isn't an 'n' in the command) the sdb1 storage (either the /dev/sdb1 or path to the file can be used or any of the other links under /dev/mapper or /dev/disk/by- ... can be used). Don't worry about those other places for disk links now.

    That should be it. If I didn't make any mistakes or you don't see them and fix them.

    You should look up every command above, learn to read the man pages for each, to solidify knowledge. man mount will show the manual for the mount command, for example.
    Last edited by TheFu; August 14th, 2017 at 06:37 PM. Reason: grammar/incorrect words (nothing important)

  5. #15
    Join Date
    Aug 2017
    Beans
    14

    Re: issue with chmod/chown

    wow man thank you for taking the time to write that book!!! Let me get started and I will get back to you!!!

  6. #16
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: issue with chmod/chown

    Quote Originally Posted by eightermoa View Post
    wow man thank you for taking the time to write that book!!! Let me get started and I will get back to you!!!
    If you hadn't posted the exact commands (which didn't work and were bad), I wouldn't have known what you knew and didn't know. That was very helpful. Much of this stuff isn't intuitively obvious, until someone tells you. Eventually, things "just click" and it all makes sense.


    Ok, and I type over 50 wpm, easily - perhaps over 80wpm.
    Last edited by TheFu; August 14th, 2017 at 06:43 PM.

  7. #17
    Join Date
    Aug 2017
    Beans
    14

    Re: issue with chmod/chown

    Sweet, I clocked mine at 82 a week ago. and I ran everything you said and it went off without a hitch. So thank you!!. I will read up on the commands. I work on cisco stuff a lot for work but not a lot on the command line stuff so this is why I am trying to get this working at home.

    Got time for another question??

  8. #18
    Join Date
    Aug 2017
    Beans
    14

    Re: issue with chmod/chown

    The only issue I am having, when i restart my PC it doesnt keep the media mounted to D, how do you do it to where it auto mounts it?

  9. #19
    Join Date
    Aug 2017
    Beans
    14

    Re: issue with chmod/chown

    well after some reading i figured it out, edited my fstab and added:

    Code:
    # Automount of /D
    UUID=ab59dd0a-3128-484b-a3d0-fcfdff756b51 /D/media ext4 errors=remount-ro 0 1
    restarted and it work!!! Thanks!!
    Last edited by eightermoa; September 3rd, 2017 at 05:23 PM.

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •