SliTaz SliTaz Forum

You are not logged in.

#1 2015-11-29 15:54:42

linuxscripts
Member
Registered: 2015-11-28
Posts: 53

Help on slitaz mountpoint changing script

Hi,

I've started on a project making some scripts (along with a files download) to update slitaz (and other linux distro's).

The project is at https://github.com/linuxscripts/linuxefficiencyscripts

and http://sourceforge.net/projects/linuxefficiencyscripts/?source=navbar

I was hoping some of you could help me on the https://github.com/linuxscripts/Linuxefficiencyscripts/blob/master/LES_Linuxdirectorytree_changing.sh

script. Disregard the createrootlessenvironment part of it, I just want to get the top section working for the moment. The idea with the createrootlessenvironment part was to make the linux filesystem hierarchy a bit simpler, though I don't intent to go as far as that particular script, simplifying some folders, ... would be enough. In any case, this is something to be tackled later.

The focus now is on the altering of the mount points, as said (top section).

In slitaz, there have been some changes integrated compared to other (mainstream) linux distro's, such as:

/media/disk,

/media/usbdisk

/media/cdrom

folders, and the automatic mounting of drives which inserting them to the pc (ie usbsticks mount automatically, ...)

I'd like to know where those changed files (compared to regular linux distro's) are located (automatic mounting program, and the changed config files having made the /media/disk, ... mountpoints

Also, besides providing the location, can you also tell me how exactly to change everything so the mountpoints will be changed the way I want it/described it ?

Alternatively, people can also directly change things via github (just type in the changes needed, and click commit. I'll then accept the changes and things will be automatically changed.

Offline

#2 2015-11-29 17:18:34

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: Help on slitaz mountpoint changing script

Hi linuxscripts,

AFAIK /media folder is absolutely useless since SliTaz 4.0 because of udev using.

You still can use /media/* folders to manual mounting, and can describe them in your /etc/fstab.

But USB flashes mounts automatically by udev, and /media not used anymore for automatic mounts.

Offline

#3 2015-11-29 20:37:41

llev
Member
Registered: 2011-12-09
Posts: 568

Re: Help on slitaz mountpoint changing script

I may also add that automounting is now very widespread among major distros (e.g. opensuse), activated by default, and usually may be disabled in the desktop environment settings (e.g. Xfce).

As for SliTaz, automounting may be disabled in your file manager settings. I use Spacefm; that setting is in the context menu of the "Devices" panel. Pcmanfm must have a similar setting.

Offline

#4 2015-11-29 21:55:18

mojo
Administrator
Registered: 2011-03-29
Posts: 2,174

Re: Help on slitaz mountpoint changing script

Data optical disk is auto-mounted on /media/cdrom in /etc/fstab

slitaz-base-files owns /etc/fstab ->  http://hg.slitaz.org/slitaz-base-files/file/efc8f188db6e/rootfs/etc/fstab

/org/freedesktop/UDisks2/block_devices/sr0:

  org.freedesktop.UDisks2.Block:

    Configuration:              [('fstab', {'fsname': <b'/dev/cdrom'>, 'dir': <b'/media/cdrom'>, 'type': <b'iso9660'>, 'opts': <b'user,ro,noauto'>, 'freq': <0

>, 'passno': <0>})]

    CryptoBackingDevice:        '/'

    Device:                     /dev/sr0

    DeviceNumber:               2816

    Drive:                      '/org/freedesktop/UDisks2/drives/Optiarc_DVD_RW_AD_7280S_Optiarc_DVD_RW_AD_7280S'

    HintAuto:                   true

    HintIconName:

    HintIgnore:                 false

    HintName:

    HintPartitionable:          false

    HintSymbolicIconName:

    HintSystem:                 false

    Id:                         by-uuid-2013-03-23-14-39-53-28

    IdLabel:                    MY_DATA_032313

    IdType:                     iso9660

    IdUUID:                     2013-03-23-14-39-53-28

    IdUsage:                    filesystem

    IdVersion:                  Joliet Extension

    MDRaid:                     '/'

    MDRaidMember:               '/'

    PreferredDevice:            /dev/sr0

    ReadOnly:                   true

    Size:                       616089600

    Symlinks:                   /dev/cdrom

                                /dev/cdrw

                                /dev/disk/by-id/ata-Optiarc_DVD_RW_AD-7280S

                                /dev/disk/by-label/MY_DATA_032313

                                /dev/disk/by-path/pci-0000:00:11.0-scsi-0:0:0:0

                                /dev/disk/by-uuid/2013-03-23-14-39-53-28

                                /dev/dvd

                                /dev/dvdrw

  org.freedesktop.UDisks2.Filesystem:

    MountPoints:        /media/cdrom

Offline

#5 2015-11-30 15:16:09

llev
Member
Registered: 2011-12-09
Posts: 568

Re: Help on slitaz mountpoint changing script

Hi mojo,

How do you get this info?

Offline

#6 2015-11-30 17:26:58

mojo
Administrator
Registered: 2011-03-29
Posts: 2,174

Re: Help on slitaz mountpoint changing script

Hi llev,

[c]udisksctl dump[/c]

http://udisks.freedesktop.org/docs/latest/udisksctl.1.html

Offline

#7 2015-12-01 14:23:52

linuxscripts
Member
Registered: 2015-11-28
Posts: 53

Re: Help on slitaz mountpoint changing script

Hi Aleksej,

the plan isn't to use /media/* folders, but rather use /mnt/* folders with the exact port name (see https://github.com/linuxscripts/Linuxefficiencyscripts/blob/master/LES_Linuxdirectorytree_changing.sh )

I assume the only file I need to edit is /etc/fstab.

I'll look into it.

I'm using slitaz 4 btw.

Offline

#8 2015-12-11 10:29:43

linuxscripts
Member
Registered: 2015-11-28
Posts: 53

Re: Help on slitaz mountpoint changing script

I switched to slitaz 5. Given that slitaz 5 makes mountpoints that are named with the uuid instead, I think a change is in order: rather than using the ports are foldername (ie /mnt/PATA1), ... we can just have the uuid folder placed directly under /mnt/.

At present, this wasn't the case (folders were made under /run/.../...).

No detecting of the drive ports is hence needed, which will simplify things to code into fstab. Perhaps that later-on, this can still be integrated, ie by putting the uuid folder under the port folder (so say /mnt/PATA1/uuid-number/)

Offline

#9 2015-12-11 12:39:18

llev
Member
Registered: 2011-12-09
Posts: 568

Re: Help on slitaz mountpoint changing script

Not sure about what you want to do exactly, but anyway...

- Mount point for hotplugged devices is made by udev, so this is the direction where you should look to answer your needs, I think.

- In fstab you can refer to devices by UUID or label instead of by the device filename (/dev/sda1 e.g.): UUID= or LABEL=

Offline

#10 2015-12-22 18:00:23

linuxscripts
Member
Registered: 2015-11-28
Posts: 53

Re: Help on slitaz mountpoint changing script

I found the folder /etc/udev

there is a file there (udev.conf) but I doubt this is the file I need. There's a line that has a vague connotation to the drive paths mentioned (ie:

# udev_db - The name and location of the udev database.

#udev_db="/run/udev/tdb" )

but that's still not the same as /run/media/tux/uuid-name so changing that to /mnt/tdb won't work, and I doubt I actually need to have the database relocated anyway

The idea now is to just have all harddisks, usb drives, ... mounted to /mnt/uuid-name rather than /run/media/tux/uuid-name

For cdroms, I'm not sure whether a uuid-name can be given (I assume so but I'm not sure) ? If it is possible, then the same approach can be followed, or if not possible, then the exact same method as outlined in https://github.com/linuxscripts/Linuxefficiencyscripts/blob/master/debianscripts/LES_fstab-simple_mountpoints.sh can be followed; meaning that if the cdrom is a PATA cdrom, it would just get the appropriate PATA name, if it's a scsi cdrom, it gets a name like SCSI1, SCSI2

I just changed tactic to the uuid-name approach if possible, because there is no detecting of the drive needed with this, and so it's probably easier to set up for me. I'm still new to working on linux ... The downside with the uuid-name off course is that it's still less easy to understand/use for the actual users of slitaz than the port name method.

Offline

#11 2015-12-22 22:09:32

llev
Member
Registered: 2011-12-09
Posts: 568

Re: Help on slitaz mountpoint changing script

Under /etc/udev/rules.d/ you should find all the rules files that result into these mountpoints. Good luck though! (I don't speak that language wink )

Offline

#12 2015-12-23 13:52:48

linuxscripts
Member
Registered: 2015-11-28
Posts: 53

Re: Help on slitaz mountpoint changing script

I examined /etc/fstab in detail, but this appears to me to be a list of mountpoints for the devices I have on my particular machine (I assume this as many drives/controllers that seem to be missing, for example there's a /dev/sda3 mentioned in the file, but sda1, sda2, sda4, sdb1, sdb2, sdb3, sdb4 are not to be found, same for many other drives). So, the file is auto-generated specific to my machine from other files. I actually want to have the package I'd make change the drive names of any machine, so /etc/fstab is probably useless to this end.

Offline

#13 2015-12-23 18:51:20

llev
Member
Registered: 2011-12-09
Posts: 568

Re: Help on slitaz mountpoint changing script

Yes, fstab is probably written by tazinst, with a part depending on your actual hardware. I guess you'd find out by reading the script, if you're interested.

So, for your package, you "just" have to learn udev rules...

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.019 seconds, 7 queries executed - Memory usage: 1.57 MiB (Peak: 1.77 MiB) ]