Welcome!

The kernel problem with recent updates has been solved. Find the solution here

Important information
-- Required MX 15/16 Repository Changes
-- Information on torrent hosting changes
-- Information on MX15/16 GPG Keys
-- Spectre and Meltdown vulnerabilities

News
-- Introducing our new Website
-- MX Linux on social media: here

Current releases
-- MX-18.3 Point Release release info here
-- Migration Information to MX-18 here
-- antiX-17.4.1 release info here

New users
-- Please read this first, and don't forget to add system and hardware information to posts!
-- Here are the Forum Rules

Access my USB stick

User avatar
JmaCWQ
Forum Regular
Forum Regular
Posts: 159
Joined: Fri Sep 09, 2016 4:42 am

Re: Access my USB stick

#11

Post by JmaCWQ » Sat Jun 01, 2019 12:04 am

What's the dot do?
I've never needed it.

User avatar
JayM
Forum Guide
Forum Guide
Posts: 1339
Joined: Tue Jan 08, 2019 4:47 am

Re: Access my USB stick

#12

Post by JayM » Sat Jun 01, 2019 2:12 am

JmaCWQ wrote:
Sat Jun 01, 2019 12:04 am
What's the dot do?
I've never needed it.
What are you talking about?
Please read How To Ask For Help and How to Break Your System.
MX User Manual: hold down ALT and press F1. Further information may be found in the MX Wiki.

User avatar
fehlix
Forum Veteran
Forum Veteran
Posts: 4233
Joined: Wed Apr 11, 2018 5:09 pm

Re: Access my USB stick

#13

Post by fehlix » Sat Jun 01, 2019 8:04 am

JmaCWQ wrote:
Sat Jun 01, 2019 12:04 am
What's the dot do?
I've never needed it.
Linux filesystems are organized by inode-data structures to access filesystem objects like files, directories and other.
Manipulating/using/changing filesystem entries involves accessing the inode number of those entries.
Acceessing a directory can be formulated in different ways like

/path/to/stick
/path/to/stick/
/path/to/stick/.

Those above resulting in access the identical inode.
Example: "ls -idl"

Code: Select all

ls -idl /mnt/ssd_data /mnt/ssd_data/ /mnt/ssd_data /mnt/ssd_data/.

2 drwxr-xr-x 8 root root 4096 Feb  7 20:32 /mnt/ssd_data
2 drwxr-xr-x 8 root root 4096 Feb  7 20:32 /mnt/ssd_data
2 drwxr-xr-x 8 root root 4096 Feb  7 20:32 /mnt/ssd_data/
2 drwxr-xr-x 8 root root 4096 Feb  7 20:32 /mnt/ssd_data/.
The first column displays the unique inode number of the filesystem object.
So the /path/to/stick/. and /path/to/stick are identical pointing to the identical inode data structure.
Or another example using "stat" command to display some more information:

Code: Select all

stat  /mnt/ssd_data   /mnt/ssd_data/   /mnt/ssd_data/. 

  File: /mnt/ssd_data
  Size: 4096      	Blocks: 8          IO Block: 4096   directory
Device: 803h/2051d	Inode: 2           Links: 8
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2019-03-30 00:50:27.400476491 +0100
Modify: 2019-02-07 20:32:24.798858506 +0100
Change: 2019-02-07 20:32:24.798858506 +0100
 Birth: -
  File: /mnt/ssd_data/
  Size: 4096      	Blocks: 8          IO Block: 4096   directory
Device: 803h/2051d	Inode: 2           Links: 8
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2019-03-30 00:50:27.400476491 +0100
Modify: 2019-02-07 20:32:24.798858506 +0100
Change: 2019-02-07 20:32:24.798858506 +0100
 Birth: -
  File: /mnt/ssd_data/.
  Size: 4096      	Blocks: 8          IO Block: 4096   directory
Device: 803h/2051d	Inode: 2           Links: 8
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2019-03-30 00:50:27.400476491 +0100
Modify: 2019-02-07 20:32:24.798858506 +0100
Change: 2019-02-07 20:32:24.798858506 +0100
 Birth: -
HTH
:puppy:
Gigabyte Z77M-D3H, Intel Xeon E3-1240 V2 (Quad core), 32GB RAM,
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB

User avatar
JmaCWQ
Forum Regular
Forum Regular
Posts: 159
Joined: Fri Sep 09, 2016 4:42 am

Re: Access my USB stick

#14

Post by JmaCWQ » Sat Jun 01, 2019 9:41 am

JayM wrote:
Sat Jun 01, 2019 2:12 am
What are you talking about?
This
figueroa wrote:
Sat Jun 01, 2019 12:02 am
Then:

Code: Select all

chown user:group /path/to/stick/.
Yes, that's a dot at the end...
fehlix wrote:
Sat Jun 01, 2019 8:04 am
HTH
:puppy:
It did.
Thank you once again fehlix :cool:

User avatar
figueroa
Forum Regular
Forum Regular
Posts: 396
Joined: Fri Dec 21, 2018 12:20 am

Re: Access my USB stick

#15

Post by figueroa » Sat Jun 01, 2019 10:44 am

The dot, aka ., in the usb flash drive's root directory, i.e. /path/to/stick/. represents the whole stick's root directory. If you own the dot, you own the stick, so your user can write to it with user permission.

People don't usually see the dot because dots and filenames that begin with dot are hidden by default. But, if you type in the terminal, (example):

Code: Select all

ls -la /path/to/stick/
you will see the dot in the root directory. The . is the root directory itself, and .. is the parent directory in the path to the device.
Andy Figueroa
Using Unix from 1984; GNU/Linux from 1993

Post Reply

Return to “General”