• More formatting USB

    From db@21:1/5 to All on Wed Aug 23 12:49:15 2023
    I got a lot of advice on how to format a USB stick and ended up
    typing in

    sudo mkfs.ext4 /dev/sdb1

    This worked, except for a few things. Firstly I guess there
    must be an option for the final name of the device (I can
    find this out). Secondly, in order to copy stuff on the
    device, I must preface the command with sudo and type in
    my password. OK, I can do that, but why?
    Thirdly, and most irritatingly, after the first (largish)
    copy, subsequent copy operations gave the notice that the
    job was stopped. Why is this? I must find out how to resume
    a stopped job, which I think I can.
    But why is all this happening? What should I type in to
    format a USB stick?

    As mentioned before, I work under Kubuntu 23.04.

    --
    Dieter Britz

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marco Moock@21:1/5 to All on Wed Aug 23 13:39:56 2023
    Am 23.08.2023 um 12:49:15 Uhr schrieb db:

    I got a lot of advice on how to format a USB stick and ended up
    typing in

    sudo mkfs.ext4 /dev/sdb1

    This worked, except for a few things. Firstly I guess there
    must be an option for the final name of the device (I can
    find this out).

    https://unix.stackexchange.com/questions/289477/what-is-the-difference-between-a-name-and-a-label-in-gparted
    e2label can change the label.

    Secondly, in order to copy stuff on the device, I must preface the
    command with sudo and type in my password. OK, I can do that, but why?

    Change the permissions on the device, so you can write there. If the
    owner is root and only the owner is allowed to write, this is what
    happens.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David W. Hodgins@21:1/5 to dieterhansbritz@gmail.com on Wed Aug 23 11:28:19 2023
    On Wed, 23 Aug 2023 06:49:15 -0400, db <dieterhansbritz@gmail.com> wrote:

    I got a lot of advice on how to format a USB stick and ended up
    typing in

    sudo mkfs.ext4 /dev/sdb1

    This worked, except for a few things. Firstly I guess there
    must be an option for the final name of the device (I can

    Use the option "-L volume-label" as per man mkfs.ext4 when formatting the partition. To add a label to an unmounted existing formatted partition use "tune2fs -L volume-label /dev/sdb1".

    find this out). Secondly, in order to copy stuff on the
    device, I must preface the command with sudo and type in
    my password. OK, I can do that, but why?

    It was mounted by root. Unmount it, unplug the device and plug it back in.
    I'm assuming Kubuntu uses udev and it's kde has the removable devices system tray applet enabled.
    If desired, use systemsettings5/Hardware/Removable storage to enable auto mounting of the file system owned by the currently logged in user.

    Thirdly, and most irritatingly, after the first (largish)
    copy, subsequent copy operations gave the notice that the
    job was stopped. Why is this? I must find out how to resume
    a stopped job, which I think I can.

    How are you doing the copy? If using a command with & to put it in the background,
    use the fg command to bring the job back to the foreground.

    But why is all this happening? What should I type in to
    format a USB stick?

    The formatting is done. The problems described are about how to mount it with the desired owner, and a how copying files work.

    As mentioned before, I work under Kubuntu 23.04.

    I'm using Mageia, but any distribution using a recent version of the kde plasma desktop environment should be the same.

    Regards, Dave Hodgins

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kenny McCormack@21:1/5 to mo01@posteo.de on Wed Aug 23 19:31:51 2023
    In article <uc4r6c$2tam7$2@dont-email.me>, Marco Moock <mo01@posteo.de> wrote: >Am 23.08.2023 um 12:49:15 Uhr schrieb db:

    I got a lot of advice on how to format a USB stick and ended up
    typing in

    sudo mkfs.ext4 /dev/sdb1

    This worked, except for a few things. Firstly I guess there
    must be an option for the final name of the device (I can
    find this out).
    ...
    Secondly, in order to copy stuff on the device, I must preface the
    command with sudo and type in my password. OK, I can do that, but why?

    Change the permissions on the device, so you can write there. If the
    owner is root and only the owner is allowed to write, this is what
    happens.

    Use "-E root_owner=1000:1000" on the mkfs command.

    (Assuming 1000:1000 is you)

    Note that if you do the mkfs as you, you won't need the =1000:1000, but of course, since you are accessing a device, you need to use sudo for the
    mkfs, so you will need to specify it.

    As far as I can tell, from the man page, you have to use numeric IDs; you
    can't do myuser:myuser.

    --
    The randomly chosen signature file that would have appeared here is more than 4 lines long. As such, it violates one or more Usenet RFCs. In order to remain in compliance with said RFCs, the actual sig can be found at the following URL:
    http://user.xmission.com/~gazelle/Sigs/FiftyPercent

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Carlos E. R.@21:1/5 to David W. Hodgins on Wed Aug 23 21:50:01 2023
    On 2023-08-23 11:28, David W. Hodgins wrote:
    On Wed, 23 Aug 2023 06:49:15 -0400, db <dieterhansbritz@gmail.com> wrote:

    I got a lot of advice on how to format a USB stick and ended up
    typing in

    ...

    find this out). Secondly, in order to copy stuff on the
    device, I must preface the command with sudo and type in
    my password. OK, I can do that, but why?

    It was mounted by root. Unmount it, unplug the device and plug it
    back in. I'm assuming Kubuntu uses udev and it's kde has the
    removable devices system tray applet enabled. If desired, use systemsettings5/Hardware/Removable storage to enable auto mounting
    of the file system owned by the currently logged in user.

    Will not work when using ext4 or any other Linux filesystem.

    There are several methods. One that has not been mentioned yet is
    creating a directory inside owned by the normal user. Notice that this
    user will be a different user if the stick is connected to another
    computer. It is the uuid number that matters.

    ...

    --
    Cheers,
    Carlos E.R.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David W. Hodgins@21:1/5 to Carlos E. R. on Thu Aug 24 00:37:45 2023
    On Wed, 23 Aug 2023 21:50:01 -0400, Carlos E. R. <robin_listas@es.invalid> wrote:


    On 2023-08-23 11:28, David W. Hodgins wrote:
    On Wed, 23 Aug 2023 06:49:15 -0400, db <dieterhansbritz@gmail.com> wrote:

    I got a lot of advice on how to format a USB stick and ended up
    typing in

    ...

    find this out). Secondly, in order to copy stuff on the
    device, I must preface the command with sudo and type in
    my password. OK, I can do that, but why?

    It was mounted by root. Unmount it, unplug the device and plug it
    back in. I'm assuming Kubuntu uses udev and it's kde has the
    removable devices system tray applet enabled. If desired, use
    systemsettings5/Hardware/Removable storage to enable auto mounting
    of the file system owned by the currently logged in user.

    Will not work when using ext4 or any other Linux filesystem.

    There are several methods. One that has not been mentioned yet is
    creating a directory inside owned by the normal user. Notice that this
    user will be a different user if the stick is connected to another
    computer. It is the uuid number that matters.

    My mistake. Thanks for the correction.

    It gets mounted with "drwxr-xr-x 3 root root" so the user has read access, but not write access.

    So either the uid has to be specified during the mkfs.ext4 or mount it
    using the device notifier and then chown the directory used as the
    mount point using sudo. The chown only has to be run the first time it's mounted, not after subsequent mounts.

    Regards, Dave Hodgins

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From 51b.1055@21:1/5 to Marco Moock on Thu Aug 24 00:48:08 2023
    On 8/23/23 7:39 AM, Marco Moock wrote:
    Am 23.08.2023 um 12:49:15 Uhr schrieb db:

    I got a lot of advice on how to format a USB stick and ended up
    typing in

    sudo mkfs.ext4 /dev/sdb1

    This worked, except for a few things. Firstly I guess there
    must be an option for the final name of the device (I can
    find this out).

    https://unix.stackexchange.com/questions/289477/what-is-the-difference-between-a-name-and-a-label-in-gparted
    e2label can change the label.

    Secondly, in order to copy stuff on the device, I must preface the
    command with sudo and type in my password. OK, I can do that, but why?

    Change the permissions on the device, so you can write there. If the
    owner is root and only the owner is allowed to write, this is what
    happens.


    Perfectly correct, 'chmod' to 777 or thereabouts.

    And, if a GUI environment, use gparted instead of
    the tricky CL stuff.

    But it's STILL "best" to format USB sticks as FAT-32
    to ensure maximum compatibility. So long as your files
    are under 4gb it'll work just perfectly.

    USB HDDs ... do whatever you want. FAT-32 isn't adequate.
    NTFS *is* often an option for both worlds.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Natural Philosopher@21:1/5 to David W. Hodgins on Thu Aug 24 08:38:35 2023
    On 24/08/2023 05:37, David W. Hodgins wrote:
    On Wed, 23 Aug 2023 21:50:01 -0400, Carlos E. R.
    <robin_listas@es.invalid> wrote:


    On 2023-08-23 11:28, David W. Hodgins wrote:
    On Wed, 23 Aug 2023 06:49:15 -0400, db <dieterhansbritz@gmail.com>
    wrote:

    I got a lot of advice on how to format a USB stick and ended up
    typing in

    ...

    find this out). Secondly, in order to copy stuff on the
    device, I must preface the command with sudo and type in
    my password. OK, I can do that, but why?

    It was mounted by root. Unmount it, unplug the device and plug it
    back in. I'm assuming Kubuntu uses udev and it's kde has the
    removable devices system tray applet enabled. If desired, use
    systemsettings5/Hardware/Removable storage    to enable auto mounting >>> of the file system owned by the currently logged in user.

    Will not work when using ext4 or any other Linux filesystem.

    There are several methods. One that has not been mentioned yet is
    creating a directory inside owned by the normal user. Notice that this
    user will be a different user if the stick is connected to another
    computer. It is the uuid number that matters.

    My mistake. Thanks for the correction.

    It gets mounted with "drwxr-xr-x 3 root root" so the user has read
    access, but
    not write access.

    So either the uid has to be specified during the mkfs.ext4 or mount it
    using the device notifier and then chown the directory used as the
    mount point using sudo. The chown only has to be run the first time it's mounted, not after subsequent mounts.

    Regards, Dave Hodgins

    It's normal to have mount points 777 perms. Then you can adjust the rest
    on the device itself.



    --
    Those who want slavery should have the grace to name it by its proper
    name. They must face the full meaning of that which they are advocating
    or condoning; the full, exact, specific meaning of collectivism, of its
    logical implications, of the principles upon which it is based, and of
    the ultimate consequences to which these principles will lead. They must
    face it, then decide whether this is what they want or not.

    Ayn Rand.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From db@21:1/5 to Marco Moock on Mon Aug 28 11:34:16 2023
    On 23.08.2023 13.39, Marco Moock wrote:
    Am 23.08.2023 um 12:49:15 Uhr schrieb db:

    I got a lot of advice on how to format a USB stick and ended up
    typing in

    sudo mkfs.ext4 /dev/sdb1

    This worked, except for a few things. Firstly I guess there
    must be an option for the final name of the device (I can
    find this out).

    https://unix.stackexchange.com/questions/289477/what-is-the-difference-between-a-name-and-a-label-in-gparted
    e2label can change the label.

    Secondly, in order to copy stuff on the device, I must preface the
    command with sudo and type in my password. OK, I can do that, but why?

    Change the permissions on the device, so you can write there. If the
    owner is root and only the owner is allowed to write, this is what
    happens.

    How do I do that? I know about chmod but not how to use it on a
    device.
    --
    Dieter Britz

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Natural Philosopher@21:1/5 to All on Mon Aug 28 11:02:46 2023
    On 28/08/2023 10:34, db wrote:
    On 23.08.2023 13.39, Marco Moock wrote:
    Am 23.08.2023 um 12:49:15 Uhr schrieb db:

    I got a lot of advice on how to format a USB stick and ended up
    typing in

    sudo mkfs.ext4 /dev/sdb1

    This worked, except for a few things. Firstly I guess there
    must be an option for the final name of the device (I can
    find this out).

    https://unix.stackexchange.com/questions/289477/what-is-the-difference-between-a-name-and-a-label-in-gparted
    e2label can change the label.

    Secondly, in order to copy stuff on the device, I must preface the
    command with sudo and type in my password. OK, I can do that, but why?

    Change the permissions on the device, so you can write there. If the
    owner is root and only the owner is allowed to write, this is what
    happens.

    How do I do that? I know about chmod but not how to use it on a
    device.

    IIRC, but its a long time since I had this problem, you need to ensure
    first of all that the mount point is accessible permissions-wise without
    any device mounted on it.

    Then once mounted all you 'see' are directories - even the root
    directory of the device is just a directory, so changing that directory permissions is possible.

    So again to the best of my memorry if you are say going to mount on /mnt

    #chmod 777 /mnt
    followed by
    #mount /dev/whatever /mnt
    and then
    #chmod 777 /mnt

    AGAIN
    has effectively opened up the root directory of the device to all and
    sundry.



    --
    "What do you think about Gay Marriage?"
    "I don't."
    "Don't what?"
    "Think about Gay Marriage."

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David W. Hodgins@21:1/5 to dieterhansbritz@gmail.com on Mon Aug 28 10:57:07 2023
    On Mon, 28 Aug 2023 05:34:16 -0400, db <dieterhansbritz@gmail.com> wrote:

    On 23.08.2023 13.39, Marco Moock wrote:
    Am 23.08.2023 um 12:49:15 Uhr schrieb db:

    I got a lot of advice on how to format a USB stick and ended up
    typing in

    sudo mkfs.ext4 /dev/sdb1

    This worked, except for a few things. Firstly I guess there
    must be an option for the final name of the device (I can
    find this out).

    https://unix.stackexchange.com/questions/289477/what-is-the-difference-between-a-name-and-a-label-in-gparted
    e2label can change the label.

    Secondly, in order to copy stuff on the device, I must preface the
    command with sudo and type in my password. OK, I can do that, but why?

    Change the permissions on the device, so you can write there. If the
    owner is root and only the owner is allowed to write, this is what
    happens.

    How do I do that? I know about chmod but not how to use it on a
    device.

    $ sudo mkfs.ext4 -E root_owner[=uid:gid] /dev/sdb1
    or if the device is already formatted, but not mounted
    $ sudo tune2fs -u user -g group /dev/sdb1

    Then unplug the device an reinsert it, and once mounted, the specified user
    can write to it.

    Note that the uid and gid must be numerical, while the user and group can be either the login/group or the uid/gid.

    This was posted earlier by Carlos E. R. on Aug. 23rd.

    Regards, Dave Hodgins

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kenny McCormack@21:1/5 to David W. Hodgins on Mon Aug 28 20:01:48 2023
    In article <op.2ad6hhyla3w0dxdave@hodgins.homeip.net>,
    David W. Hodgins <dwhodgins@nomail.afraid.org> wrote:
    ...
    This was posted earlier by Kenny McCormack on Aug. 23rd.

    FTFY

    --
    Never, ever, ever forget that "Both sides do it" is strictly a Republican meme.

    It is always the side that sucks that insists on saying "Well, you suck, too".

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jerry Peters@21:1/5 to The Natural Philosopher on Mon Aug 28 23:32:38 2023
    The Natural Philosopher <tnp@invalid.invalid> wrote:
    On 28/08/2023 10:34, db wrote:
    On 23.08.2023 13.39, Marco Moock wrote:
    Am 23.08.2023 um 12:49:15 Uhr schrieb db:

    I got a lot of advice on how to format a USB stick and ended up
    typing in

    sudo mkfs.ext4 /dev/sdb1

    This worked, except for a few things. Firstly I guess there
    must be an option for the final name of the device (I can
    find this out).

    https://unix.stackexchange.com/questions/289477/what-is-the-difference-between-a-name-and-a-label-in-gparted
    e2label can change the label.

    Secondly, in order to copy stuff on the device, I must preface the
    command with sudo and type in my password. OK, I can do that, but why?

    Change the permissions on the device, so you can write there. If the
    owner is root and only the owner is allowed to write, this is what
    happens.

    How do I do that? I know about chmod but not how to use it on a
    device.

    IIRC, but its a long time since I had this problem, you need to ensure
    first of all that the mount point is accessible permissions-wise without
    any device mounted on it.

    Then once mounted all you 'see' are directories - even the root
    directory of the device is just a directory, so changing that directory permissions is possible.

    So again to the best of my memorry if you are say going to mount on /mnt

    #chmod 777 /mnt
    followed by
    #mount /dev/whatever /mnt
    and then
    #chmod 777 /mnt

    AGAIN
    has effectively opened up the root directory of the device to all and sundry.

    You just need to change the permissions/owner on the root directory on
    the device, to do this mount the device, assuming it's /mnt, then as
    root: chown user.group /mnt
    chmod a+rwx /mnt

    I don't change the permissions of the mountpoint so that if I
    accidently try to write to it without anything mounted there I get a
    permission denied message.

    Jerry

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Natural Philosopher@21:1/5 to Jerry Peters on Tue Aug 29 07:43:18 2023
    On 29/08/2023 00:32, Jerry Peters wrote:
    The Natural Philosopher <tnp@invalid.invalid> wrote:
    On 28/08/2023 10:34, db wrote:
    On 23.08.2023 13.39, Marco Moock wrote:
    Am 23.08.2023 um 12:49:15 Uhr schrieb db:

    I got a lot of advice on how to format a USB stick and ended up
    typing in

    sudo mkfs.ext4 /dev/sdb1

    This worked, except for a few things. Firstly I guess there
    must be an option for the final name of the device (I can
    find this out).

    https://unix.stackexchange.com/questions/289477/what-is-the-difference-between-a-name-and-a-label-in-gparted
    e2label can change the label.

    Secondly, in order to copy stuff on the device, I must preface the
    command with sudo and type in my password. OK, I can do that, but why? >>>>
    Change the permissions on the device, so you can write there. If the
    owner is root and only the owner is allowed to write, this is what
    happens.

    How do I do that? I know about chmod but not how to use it on a
    device.

    IIRC, but its a long time since I had this problem, you need to ensure
    first of all that the mount point is accessible permissions-wise without
    any device mounted on it.

    Then once mounted all you 'see' are directories - even the root
    directory of the device is just a directory, so changing that directory
    permissions is possible.

    So again to the best of my memorry if you are say going to mount on /mnt

    #chmod 777 /mnt
    followed by
    #mount /dev/whatever /mnt
    and then
    #chmod 777 /mnt

    AGAIN
    has effectively opened up the root directory of the device to all and
    sundry.

    You just need to change the permissions/owner on the root directory on
    the device, to do this mount the device, assuming it's /mnt, then as
    root: chown user.group /mnt
    chmod a+rwx /mnt

    I don't change the permissions of the mountpoint so that if I
    accidently try to write to it without anything mounted there I get a permission denied message.

    Jerry

    Right. More accurate info than I had in my memory.

    I couldn't remember how Unix/Linux treats the permissions on a mount point.


    --
    Religion is regarded by the common people as true, by the wise as
    foolish, and by the rulers as useful.

    (Seneca the Younger, 65 AD)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From candycane@21:1/172 to Jerry Peters on Tue Aug 29 23:34:33 2023
    You just need to change the permissions/owner on the root directory on
    the device, to do this mount the device, assuming it's /mnt, then as
    root: chown user.group /mnt
    chmod a+rwx /mnt

    Some fsystems (fat32) let you set ownership in the mount settings, letting you create a mountpt group and assigning it in the fstab

    I don't change the permissions of the mountpoint so that if I
    accidently try to write to it without anything mounted there I get a permission denied message.

    Pretty smart.

    ---------------
    user <candycane> is generated from /dev/urandom

    ... Internal Error: The system has been taken over by sheep at line 19960
    ___ MultiMail/Linux v0.52

    --- Mystic BBS/QWK v1.12 A45 2020/02/18 (Linux/64)
    * Origin: The Bottomless Abyss BBS * bbs.bottomlessabyss.net (21:1/172)
  • From Carlos E. R.@21:1/5 to The Natural Philosopher on Wed Aug 30 22:15:10 2023
    On 2023-08-28 06:02, The Natural Philosopher wrote:
    On 28/08/2023 10:34, db wrote:
    On 23.08.2023 13.39, Marco Moock wrote:
    Am 23.08.2023 um 12:49:15 Uhr schrieb db:

    I got a lot of advice on how to format a USB stick and ended up
    typing in

    sudo mkfs.ext4 /dev/sdb1

    This worked, except for a few things. Firstly I guess there
    must be an option for the final name of the device (I can
    find this out).

    https://unix.stackexchange.com/questions/289477/what-is-the-difference-between-a-name-and-a-label-in-gparted
    e2label can change the label.

    Secondly, in order to copy stuff on the device, I must preface the
    command with sudo and type in my password. OK, I can do that, but why?

    Change the permissions on the device, so you can write there. If the
    owner is root and only the owner is allowed to write, this is what
    happens.

    How do I do that? I know about chmod but not how to use it on a
    device.

    IIRC, but its a long time since I had this problem, you need to ensure
    first of all that the mount point is accessible permissions-wise without
    any device mounted on it.

    Then once mounted all you 'see' are directories - even the root
    directory of the device is just a directory, so changing that directory permissions  is possible.

    So again to the best of my memorry if you are say going to mount on /mnt

    #chmod 777 /mnt
     followed by

    No, don't do that.

    #mount /dev/whatever /mnt
    and then
    #chmod 777 /mnt

    That, yes.


    AGAIN
     has effectively opened up the root directory of the device to all and sundry.




    --
    Cheers,
    Carlos E.R.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)