root user with usb drive

Forum Forums New users New Users and General Questions root user with usb drive

  • This topic has 4 replies, 2 voices, and was last updated Jul 12-9:08 am by CalY.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #24329
    Member
    CalY

      to use usb hard drive one needs to be root. How can one write to usb drive as user: demo including from web browser? Suspect a command could allow usage from any user.

      #24330
      Member
      Xecure
        Helpful
        Up
        0
        ::

        Hello.

        to use usb hard drive one needs to be root. How can one write to usb drive as user: demo including from web browser? Suspect a command could allow usage from any user.

        I think more information is needed. In my experience with both USB pendrives or USB HDDs, I never had to use root permissions to be able to read or write to them, only for internal Hardrives have I had to open as root, so I am not sure what problem you are experiencing. If you can give us more info, we may be able to help you find the way to solve your troubles.

        First, we need information about your system. Are you using antiX 17.4 or 19b1 ? Is it a live environment or an installed antiX? Is it 32 or 64 bits? To answer this and more, please paste this to the terminal and come back to reply with the output:
        inxi -Fdplurz
        Second: We need to know what devices are you trying to write to. Are they USB or internal hard drives? What format do they have? To answer this, do the same as before with these three commands:

        blkid
        sudo fdisk -l
        sudo parted -l

        Third, explain to us what are the steps you follow to access your device. Do you connect the device when you are in antiX or before starting up the system? Do you mount it manually or does it automount? Do you use ROX filer or SpaceFM? What are the steps you follow to open and write on the device? These steps are important so we know a bit more about what we can do to help you.

        Let us know all this next time you can reply.

        Welcome to antiX!

        • This reply was modified 3 years, 10 months ago by Xecure. Reason: Fixing inxi command

        antiX Live system enthusiast.
        General Live Boot Parameters for antiX.

        #24361
        Member
        CalY
          Helpful
          Up
          0
          ::

          System: Host: antix1 Kernel: 4.9.87-antix.1-486-smp i686 bits: 32
          Desktop: IceWM 1.4.2 Distro: antiX-17.1_386-base Heather Heyer 17 March 2018
          Machine: Device: desktop System: Hewlett-Packard product: HP d530 CMT(DG768A)
          —-
          Disk /dev/sdb: 28.6 GiB, 30735581184 bytes, 60030432 sectors
          Units: sectors of 1 * 512 = 512 bytes
          Sector size (logical/physical): 512 bytes / 512 bytes
          I/O size (minimum/optimal): 512 bytes / 512 bytes
          Disklabel type: dos
          Disk identifier: 0x00000000

          Device Boot Start End Sectors Size Id TypeDisk /dev/sdb: 28.6 GiB, 30735581184 bytes, 60030432 sectors
          Units: sectors of 1 * 512 = 512 bytes
          Sector size (logical/physical): 512 bytes / 512 bytes
          I/O size (minimum/optimal): 512 bytes / 512 bytes
          Disklabel type: dos
          Disk identifier: 0x00000000

          Device Boot Start End Sectors Size Id Type
          /dev/sdb1 32 60028927 60028896 28.6G 7 HPFS/NTFS/exFATDisk /dev/sdb: 28.6 GiB, 30735581184 bytes, 60030432 sectors
          Units: sectors of 1 * 512 = 512 bytes
          Sector size (logical/physical): 512 bytes / 512 bytes
          I/O size (minimum/optimal): 512 bytes / 512 bytes
          Disklabel type: dos
          Disk identifier: 0x00000000
          —-
          Device Boot Start End Sectors Size Id Type
          /dev/sdb1 32 60028927 60028896 28.6G 7 HPFS/NTFS/exFAT

          Model: Maxtor 5 T030H3 (scsi)
          Disk /dev/sdb: 30.7GB
          Sector size (logical/physical): 512B/512B
          Partition Table: msdos
          Disk Flags:

          Number Start End Size Type File system Flags
          1 16.4kB 30.7GB 30.7GB primary jfs

          Procedure: start AntiX with bootcode: automount, IceWm-Rox (same results booting SpaceFM), desktop up, attach usb drive, Rox window pops up listing files on usb drive. Try to open file with Leafpad: permission denied. With SpaceFM same result.

          What does work: boot as root, Fluxbox as window manager, only half app menu of demo IceWM. No Firefox listing. Use either FM can write files with editor. Start Firefox from terminal, it writes to usb drive. Using Fluxbox menu from root not very useful.

          Every linux distro tried has required root access to write to usb drive, AntiX makes it the most difficult. Every app has to be run from root to access. Is there a command something like: sudo chmod /mnt/sdb1 something?

          #24367
          Member
          Xecure
            Helpful
            Up
            0
            ::

            So, confirm if this is true:
            – You are using a live environment of antiX 17 ?
            – You boot it up.
            – You later connect the Hard drive USB device.
            – This USB device has a JFS partition?
            – When mounted, you only have read permissions but no write permissions.
            – You want wright permissions without having to login your user as root.

            Easy workarounds for all window managers (Three different options – have to do each time): Load antiX the same as before (normal user)

            a) For ROX Filer
            Go to any Terminal emulator (lxterminal for example)
            sudo rox-filer
            That will open ROX FM as “root”. Navigate to your media device. Now all read/write actions can be performed.

            b) With SpaceFM
            Open SpaceFM
            Up in the menu, select File > Root Window
            A new SpaceFM root window will pop up. You can navigate to your USB and do whatever you want there.

            c) Edit as root (only for editing files. Works in SpaceFM)
            Open the USB folder as normal user. Right click the file you want to edit. Open > Edit as Root
            (to change what editor it uses as default, in SpaceFM go to View > Preferences > Advance > Root’s Editor and change leafpad for your preferred editor)

            For Firefox, simply copy the files you download from ~/Downloads to you USB device using method a or b.

            Terminal solution for writing NEW files as normal user
            Once the device is mounted check to see its path. For example /media/device-name
            Go to terminal and give your user rights to write

            sudo chmod 0774 /media/device-name
            sudo chown username:users /media/device-name

            You will have to change username for your username and users for whatever group you want. For example, on live system with persistence it would look like:
            sudo chown demo:demo /media/device-name
            You will have to do this each time the device is mounted. You can save it a script and execute it each time.

            For a permanent solution (only for installed and persistent systems), you will have to add the device UUID (you get it from sudo bkid -o full) to /etc/fstab so that it mounts in /mnt/device-name with right permissions. You would then create the /mnt/device-name folder (mkdir) and give it the same permissions (previous script). I don’t know how to make it automount from there, so I will not attempt to explain. My tests only allowed me to create this mount point but I had to mount manually each time. Probably someone more knowledgeable can explain how to make it automount.

            Next time, start the question giving all the data. The problem you are experiencing is because you are using a USB device formatted as JFS. Someone more knowledgeable would have answered already your query, but because we had so little information, you had to wait until I tested it myself. I am a newbie mounting complicated stuff, as the partition formats I handle always automount with no write restrictions. To test if the solutions proposed worked, I formatted a USB device to this JFS partition format. My test show that this works for me, so it should also work for you.

            I hope this helps pave a path to a better antiX future.
            Good luck in your endeavors!

            antiX Live system enthusiast.
            General Live Boot Parameters for antiX.

            #24392
            Member
            CalY
              Helpful
              Up
              0
              ::

              Thank you for detailed explanation. The chmod/chown commands were what was looking for.

            Viewing 5 posts - 1 through 5 (of 5 total)
            • You must be logged in to reply to this topic.