Announcement

Collapse
No announcement yet.

[Resolved] Trying to claim a partition

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [Resolved] Trying to claim a partition

    I have Kubuntu installed on partition 5 of my SSD where Windows 10 is installed. So, it's dev/sda5

    I have set aside 500GB of my HDD for my data as /dev/sdb2

    No matter how I try to add this partition, it ends up being owned by Root.

    I want it to mount as media/myname/mylux and have it owned by me.

    So far all my attempts to take ownership have resulted in being booted into emergency mode and I've had to reinstall Kubuntu three times.

    At the moment, I have sdb2 as unallocated space and don't know where to go from here.

    Is it possible to format the partition as mine just using Kubuntu or do I need to install an application to do that?

    I need step-by-step instructions, as I'm 71 years old and this is all very confusing to me. Any help would be greatly appreciated.

    #2
    Welcome.

    You can format and name the partition with -> Application Menu -> System -> KDE Partition Manager.
    If you want to use the partition for Kubuntu I would suggest to use ext4 as file system.

    Then (part 2 is for the ext4 file system only!):
    1. -
      Open -> Application Menu -> Settings -> System Settings and navigate to -> Hardware -> Removable Storage -> Removable Devices

      (I had to first activate "All known devices" there and change to another category in the System Settings and then back to
      -> Removable Storage -> Removable Devices, so the information could be updated (I suppose). Afterwards I deactivated "All known devices" and then the partitions of my drives showed up under "Atached devices"…)

      Click on the drop-down arrow beside "Attached devices", choose the partition you want to mount "On Login" and click "Apply".
      Close System Settings.
      You should see the partition mounted in the Dolphin file manager now.
    2. -
      Now open -> Application Menu -> System -> Konsole and enter
      cd /media/your_name (e.g. cd /media/michael)
      ls -l (to make sure your partition is there)
      sudo chown your_name:your_name name_of_mounted_partition and enter your password (to make you the sole owner of this partition,
      e.g. sudo chown michael:michael video-partition)
      Close Konsole.
    That should be it.
    Last edited by Schwarzer Kater; Mar 23, 2024, 02:03 PM. Reason: typos
    Debian KDE & LXQt • Kubuntu & Lubuntu • openSUSE KDE • Windows • macOS X
    Desktop: Lenovo ThinkCentre M75s • Laptop: Apple MacBook Pro 13" • and others

    get rid of Snap script (20.04 +)reinstall Snap for release-upgrade script (20.04 +)
    install traditional Firefox script (22.04 +)​ • install traditional Thunderbird script (24.04)

    Comment


      #3
      Originally posted by Bandicoot View Post
      partition 5 of my SSD where Windows 10 is installed. So, it's dev/sda5
      Not necessarily. It is good idea to verify this. Same for sdb2 being correct.

      Originally posted by Bandicoot View Post
      I want it to mount as media/myname/mylux and have it owned by me.
      In future version pf Plasma and the Partition Manger, there is a button that will do this. Or rather have it accessible to all users. But it won't change the ownership or permissions for the actual mount point (/media/myname/mylux).

      Originally posted by Bandicoot View Post
      So far all my attempts to take ownership have resulted in being booted into emergency mode and I've had to reinstall Kubuntu three times.
      What have you actually done in your attempts, exactly and specifically?
      What file system are you using for it?
      What have you added to your /etc/fstab for this new partition, if you have done so?

      All that needs to be done is to set ownership of /media/myname/mylux to your user account
      Code:
      sudo chown username:username /media/myname/mylux
      There is nothing here that would mess with or booting.
      If your fstab file is incorrectly set up, that would likely just fail to mount the new partition, and move on.​ (Assuming that there were no changes to the other entries in it, and depending on the exact mount options applied)

      You can add it to your /etc/fstab if you want it mounted during boot. Otherwise, the new partition should be accessed from Dolphin's sidebar, and even set to be mounted at login from System Settings' removable devices section.
      Last edited by claydoh; Mar 23, 2024, 12:16 PM.

      Comment


        #4
        For some reason I can't quote just a block of text, so I've done it manually.

        You can format and name the partition with -> Application Menu -> System -> KDE Partition Manager.
        If you want to use the partition for Kubuntu I would suggest to use ext4 as file system.
        That was the first thing I did and it was owned by root. Yes, I used ext4.

        What have you actually done in your attempts, exactly and specifically?
        What file system are you using for it?
        What have you added to your /etc/fstab for this new partition, if you have done so?
        All that needs to be done is to set ownership of /media/myname/mylux to your user account​
        The system is booting fine with sda5 and sdb2 showing in the right place. I tried adding the UUID for sdb2 to fstab as:

        UUID=bf941b9b-0c1c-4d06-a463-4f5b45f6310a / ext4 noatime,errors=remount-ro 0 1

        That caused the emergency boot.

        But these were all done with sdb already formatted.

        I could try again now it's unformatted and see what happens. Worse case, reinstall again. It's 3am here so time to call it quits for the day.

        Comment


          #5
          I'd like to make a couple points here, define some terms, then hopefully answer your request.

          You said some things that have confused me: you claim to have "set aside" 500gb for data but then state it is "unallocated" space. "Unallocated" space is usually said to refer to drive space that is either not defined as a partition or a partition without a file system. Since you refer to this space as /dev/sdb2 I must assume it is partitioned space either with or without a file system on it (aka "unformatted").

          Also, the file system chosen matters because not all file systems follow the same rules for access.

          Generally or historically, the accepted practice to access fixed (non-removable) storage is by mounting the file system using the /etc/fstab file and defining the mount parameters and options - and removable storage like USB devices are mounted automatically by the operating system in the users' media folder for access. It's your computer and there's nothing wrong with how and where you want to mount it - it's just not the typical way it's done.

          It is also not clear what you are doing that causes your system to boot into emergency mode because you've mounted an additional device. Normally, the system will boot with or without extra file systems mounted unless you've done something abnormal to cause this. More specific details would be required to figure out why this is happening.

          Regardless of all the above and assuming you currently have no data on /dev/sdb2, here's my steps to do what you ask. You must follow them exactly and in order:

          Step 1 create the file system (aka format the partition):
          1. Boot your system normally.
          2. Open "KDE Partition Manager"
          3. In partition manager, select /dev/sdb in the "Devices" window
          4. Double-click on /dev/sdb2 in the partition window to open a "Properties" pop-up window.
          5. In the Properties window where it says "File system: unformatted" click on "unformatted"
          6. Select "ext4" in the list of file system types.
          7. This will warn you that you are changing the file system - select " > Change the file system"
          8. In the "Label:" field, enter "mylux" (without the quotes)
          9. Click "OK" in the window, then click on "Apply" in the toolbar.
          10. It will ask you again if you really want to do this. Click on " > Apply Pending Operations"
          11. This may take a several minutes to complete. Click "OK" when it's done.
          You may close the partition manager.

          Step 2: Take ownership of the file system:
          1. Open Dolphin (the file manager).
          2. In the left column near the bottom of the Dolphin window you should see a section titled "Devices" and in there you should see "mylux"
          3. Click on "mylux" to mount the file system at /media/username/mylux
          Note at this point, "mylux" will open in Dolphin but you still can't access it because you do not "own" it.
          1. Close Dolphin
          2. Open "Konsole" and enter this exactly as shown:
          sudo chown 1000:1000 /media/username/mylux

          This will prompt you to enter your password.
          I have assumed you are the primary account on this system - which is the default if you installed the system yourself.
          ​Use your actual usename in place of "username". You should see no response from this command. You may now close Konsole.
          You should now have full ownership of the file system on /dev/sdb2 and be able to access it.

          Step 3: Access the file system:
          1. Open Dolphin and click on "mylux" in Devices.
          2. The Dolphin window should change to "mylux" and only the "lost+found" folder is displayed.
          3. Right-click in the blank space and select "Create new" and select "Folder" in the pop-up menu.
          4. Type in any name you wish and the folder should be created and now show in the window.​
          This proves you have successfully accessed the file system. If you have and problems, stop and post back with a description of what went wrong.

          The "Take ownership..." steps are required because a new file system can only be created as "root" user and thus "root" is the owner. Once the EXT4 file system had been created and mounted, root can change the ownership to another user, in this case - you. This change will remain unless you change it again at some later time.
          Last edited by oshunluvr; Mar 23, 2024, 01:25 PM.

          Please Read Me

          Comment


            #6
            Ok:
            Originally posted by Bandicoot View Post
            UUID=bf941b9b-0c1c-4d06-a463-4f5b45f6310a / ext4 noatime,errors=remount-ro 0 1
            This is attempting to mount this partition (sdb2?) as your root ("/"), which you already have.


            Originally posted by Bandicoot View Post
            UUID=bf941b9b-0c1c-4d06-a463-4f5b45f6310a
            is this correct for sdb2, from using the blkid command (can be found in Partition Manager as well)?
            You can leave off the errors=remount-ro

            or for more useful options for user access/mounting, I'd use this
            UUID=blablablablabla /media/myname/mylux ext4 users,noauto,noatime,diratime 0 0​
            though using ext4 defaults 0 2 should work as well
            (there are a LOT of options available, they still confuse the heck out of me all the time)

            You still need to change ownership of the directory used as the mount point, as mentioned previously.
            Last edited by claydoh; Mar 23, 2024, 01:23 PM.

            Comment


              #7
              Originally posted by Bandicoot View Post
              […] I tried adding the UUID for sdb2 to fstab as […]
              Don't use /etc/fstab (unless you know what you are doing without a doubt…) - revert everything you have changed in /etc/fstab and use the method where Plasma mounts the volume on login instead - see post #2
              So you will never have problems booting and ending up in emergency mode because of errors in /etc/fstab.
              By the way: I always advise to make a backup of a system file before modifying it - in this case it would have been e.g.
              sudo cp /etc/fstab /etc/fstab.orig - so one can always revert any changes (in this example one would have
              sudo cp /etc/fstab.orig /etc/fstab to get back the unmodified file).

              Also in my post it is explained how you change the ownership of a mounted partition from root to your user after you have formatted it with the KDE Partition Manager in ext4 and mounted it with Plasma's System Settings (mounting in 1., changing ownership in 2.)…
              Last edited by Schwarzer Kater; Mar 23, 2024, 02:15 PM.
              Debian KDE & LXQt • Kubuntu & Lubuntu • openSUSE KDE • Windows • macOS X
              Desktop: Lenovo ThinkCentre M75s • Laptop: Apple MacBook Pro 13" • and others

              get rid of Snap script (20.04 +)reinstall Snap for release-upgrade script (20.04 +)
              install traditional Firefox script (22.04 +)​ • install traditional Thunderbird script (24.04)

              Comment


                #8
                @oshunluvr

                Thank you for the step-by-step instructions. They worked and I now have full ownership of sdb2. Although I had to create the new partition in step 1, double clicking on it didn't work.

                I had never seen "sudo chown 1000:1000 /media/username/mylux" before. I had used other versions that obviously didn't work.

                Thank you to everyone who offered advice. Because I had tried multiple attempts in my various installations, explaining what I had done each time was impossible and therefore causing you confusion.

                That's why this time I left sdb2 as unformatted, so I had a clean system to work with. Normally, I just format my partitions before installation and they get picked up in the removable devices screen. But for some reason that wasn't happening.

                Putting an invalid entry into fstab was what locked me out and into emergency mode. I tried to edit it using the installation USB, but I couldn't access it. So I had to do a new install.

                Comment


                  #9
                  Originally posted by Bandicoot View Post
                  @oshunluvr

                  Thank you for the step-by-step instructions. They worked and I now have full ownership of sdb2. Although I had to create the new partition in step 1, double clicking on it didn't work.

                  I had never seen "sudo chown 1000:1000 /media/username/mylux" before. I had used other versions that obviously didn't work.

                  Thank you to everyone who offered advice. Because I had tried multiple attempts in my various installations, explaining what I had done each time was impossible and therefore causing you confusion.

                  That's why this time I left sdb2 as unformatted, so I had a clean system to work with. Normally, I just format my partitions before installation and they get picked up in the removable devices screen. But for some reason that wasn't happening.

                  Putting an invalid entry into fstab was what locked me out and into emergency mode. I tried to edit it using the installation USB, but I couldn't access it. So I had to do a new install.
                  Great. Glad I was able to help.

                  As I said, file systems aren't all the same. EXT4 is sort of the default file system so most commonly what's used, so I went that direction. It is one that requires the ownership change and, as an almost thirty year linux user, I don't know a GUI way to make that change.

                  As Schwarzter Kater pointed out, fstab is a more delicate way to use a partition but at the same time offers more control to the user. It didn't seem that would be an issue for you so I suggested the simplest route.

                  Also, welcome to KFN. We hope you stick around.

                  Please Read Me

                  Comment

                  Working...
                  X