LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   dev/loopX when mounting a regular file (https://www.linuxquestions.org/questions/linux-general-1/dev-loopx-when-mounting-a-regular-file-4175723842/)

banderas20 04-06-2023 04:39 PM

dev/loopX when mounting a regular file
 
Hi!

I have created a filesystem inside a regular file:

1. Created a dummy 2GB file.
2. Created the partition with
Code:

fdisk <file>
3. Formatted it with
Code:

mkfs.ext4 <file>
4. Checked it with
Code:

file <file>
. I got the UUID.
5. Added it to
Code:

/etc/fstab
starting with the UUID.
6. Remounted all with
Code:

mount -a
But I can't find any reference to the file. Neither with
Code:

lsblk
nor
Code:

df -h
. Instead, I see a new /dev/loopX device.

I don't know how to interpret this. Moreover, am I missing something?

Thanks a lot!

michaelk 04-06-2023 06:33 PM

Use the absolute path to the file not the UUID. /etc/fstab line like:

Code:

/path/to/file /mount/point  ext4 loop 0 0

banderas20 04-07-2023 06:44 AM

Quote:

Originally Posted by michaelk (Post 6422870)
Use the absolute path to the file not the UUID. /etc/fstab line like:

Code:

/path/to/file /mount/point  ext4 loop 0 0

I will :)

Anyway, what does the "loop" mean? I have plenty of /dev/loopX in the system.

Thanks!

michaelk 04-07-2023 06:52 AM

Those loops are used for other stuff. A loop let's the system use a file like a block device, filesystem.

banderas20 04-07-2023 10:47 AM

Quote:

Originally Posted by michaelk (Post 6422963)
Those loops are used for other stuff. A loop let's the system use a file like a block device, filesystem.

Understood. Thanks!


All times are GMT -5. The time now is 07:53 PM.