Comments (21)
We are after the Volume label specifically.
https://en.wikipedia.org/wiki/Volume_(computing)#Volume_label
from filer.
How, precisely, was the disk formatted? Using what tool(s)?
from filer.
I don't remember. Possibly on a Mac with Disk Utility.
from filer.
gpart show da0
lsblk da0
sudo gdisk /dev/da0
from filer.
% sudo hexdump -C /dev/da0 | grep FAT
00007e20 96 7b 0f 00 80 01 29 fb 07 d5 1d 46 41 54 20 20 |.{....)....FAT |
from filer.
% gpart show da0
=> 32 1014752 da0 MBR (496M)
32 31 - free - (16K)
63 1014678 1 fat32 (495M)
1014741 43 - free - (22K)
% lsblk da0
DEVICE MAJ:MIN SIZE TYPE LABEL MOUNT
da0 0:160 496M MBR - -
<FREE> -:- 16K - - -
da0s1 0:161 495M fat32 - /media/da0s1
<FREE> -:- 22K - - -
% sudo gdisk /dev/da0
sudo: gdisk: command not found
from filer.
This does the trick but for whatever reason needs sudo:
% fstyp -l /dev/da0s1
fstyp: /dev/da0s1: Permission denied
% sudo fstyp -l /dev/da0s1
msdosfs FAT
Maybe @trasz knows why one needs sudo to find out the Volume label on FreeBSD...
from filer.
On the Mac, these "Volume labels" are used as the directory names for the mountpoints as well, unlike what we currently have:
If there is more than one disk with the same "Volume label" attached at the same time, then the Mac adds an appendix to the name of the mount point.
And the directories for the mount points get automatically deleted after unmounting so that the directory does not get cluttered up.
Something we should consider as well @vermaden?
from filer.
fstyp(8)
https://man.freebsd.org/fstyp(8)
If required: https://cgit.freebsd.org/src/tree/usr.sbin/fstyp
from filer.
glabel(8)
https://man.freebsd.org/glabel(8)
glabel list
… and so on.
Hint: you'll not get the label whilst the file system is mounted.
from filer.
Hint: you'll not get the label whilst the file system is mounted.
That kinda defeats the purpose then. After all we want Filer to display the "Volume labels" (LIVE
, FAT
,...) instead of those cryptic device names.
With sudo fstyp
it works but I wonder why it needs sudo
.
@DamjanJovanovic is this something bsdisks could help us with?
from filer.
bsdisks already uses fstyp
to find the filesystem type, so it knows which mount command to use, but there's no -l
. It uses the GEOM label, but maybe should use something else, for the "IdLabel" property in:
sudo dbus-send --system --print-reply \
--dest=org.freedesktop.UDisks2 \
/org/freedesktop/UDisks2/block_devices/da1 \
org.freedesktop.DBus.Properties.GetAll \
string:org.freedesktop.UDisks2.Block
I'll do some further tests and let you know.
from filer.
GEOM does expose the volume label, parse the XML output of sysctl kern.geom.confxml
and look under the "LABEL" class. A "MYUSB" label on /dev/da1 has the form:
<class id="0xffffffff81afcda0">
<name>LABEL</name>
<geom id="0xfffff800c9aa9800">
<name>da1</name>
<provider id="0xfffff800ca320a00">
<name>msdosfs/MYUSB</name>
...
</provider>
...
</geom>
...
</class>
Note that apart from trimming the filesystem prefix and slash, the label from GEOM has to be URL-decoded (unless your XML library already did that for you).
However that disappears when the filesystem is mounted.
bsdisks also exposes it over D-Bus, obtained from GEOM before mounting (for the filesystems it manages, anyway):
sudo dbus-send --system --print-reply \
--dest=org.freedesktop.UDisks2 \
/org/freedesktop/UDisks2/block_devices/da1 \
org.freedesktop.DBus.Properties.Get \
string:org.freedesktop.UDisks2.Block \
string:IdLabel
If you need the label of a mounted filesystem even when unmanaged by bsdisks, I think fstyp -l
is the only way.
ZFS volumes don't have labels, and their dataset names (eg. zroot/var/log) seem to come from the first string in the output of zfs get -H canmount
instead.
from filer.
A PCManFM-Qt view of a non-mounted ZFS file system in my copperbowl pool:
- an unusual example, in that the icon for the device must not be clicked
- I later set
canmount
tooff
to prevent mounting.
Ambiguity can be problematic:
- each of the six
/
bookmarks was for a separate location - none refers to
/
from filer.
@DamjanJovanovic unfortunately this does not work for me:
% sysctl kern.geom.confxml | grep '<label'
<label></label>
<label>zfs0</label>
<label>gptboot0</label>
<label>efiboot0</label>
% sudo dbus-send --system --print-reply \
--dest=org.freedesktop.UDisks2 \
/org/freedesktop/UDisks2/block_devices/da0s1 \
org.freedesktop.DBus.Properties.GetAll \
string:org.freedesktop.UDisks2.Block
method return time=1617007998.984579 sender=:1.14 -> destination=:1.16 serial=23 reply_serial=2
array [
dict entry(
string "Configuration"
variant array [
]
)
dict entry(
string "CryptoBackingDevice"
variant object path "/"
)
dict entry(
string "Device"
variant array of bytes "/dev/da0s1"
)
dict entry(
string "DeviceNumber"
variant uint64 0
)
dict entry(
string "Drive"
variant object path "/org/freedesktop/UDisks2/drives/da0"
)
dict entry(
string "HintAuto"
variant boolean false
)
dict entry(
string "HintIconName"
variant string ""
)
dict entry(
string "HintIgnore"
variant boolean false
)
dict entry(
string "HintName"
variant string ""
)
dict entry(
string "HintPartitionable"
variant boolean false
)
dict entry(
string "HintSymbolicIconName"
variant string ""
)
dict entry(
string "HintSystem"
variant boolean false
)
dict entry(
string "Id"
variant string "0000000000000000000"
)
dict entry(
string "IdLabel"
variant string ""
)
dict entry(
string "IdType"
variant string "vfat"
)
dict entry(
string "IdUUID"
variant string ""
)
dict entry(
string "IdUsage"
variant string "filesystem"
)
dict entry(
string "IdVersion"
variant string ""
)
dict entry(
string "MDRaid"
variant object path "/"
)
dict entry(
string "MDRaidMember"
variant object path "/"
)
dict entry(
string "PreferredDevice"
variant array of bytes "/dev/da0s1"
)
dict entry(
string "ReadOnly"
variant boolean false
)
dict entry(
string "Size"
variant uint64 519515136
)
dict entry(
string "Symlinks"
variant array [
]
)
]
This does:
% sudo fstyp -l /dev/da0s1
msdosfs FAT
The label is FAT
.
from filer.
According to @crees
fstyp -l /dev/disk gets you the label
but you will have to be in group operator
or just put in devfs rules to give 644 rather than just 640 on drive nodes are you're all good
So changing to 644 in https://github.com/helloSystem/ISO/blob/experimental/overlays/uzip/furybsd-settings/files/etc/devfs.rules should do the trick?
ls -l /dev/da0*
should be or crw-r--r---
Also see https://www.youtube.com/watch?v=U1fzMjj4Gv8
Trying 0666
, sudo /etc/rc.d/devfs restart
, re-plug USB drive, ls -h
still shows crw-r-----
:-(
from filer.
I am using device nodes as mount point as its consistent and I that way each devices behaves the same.
Remember that:
- many removable devices does not have labels for filesystems
- you can also use device model as mount point but with many partitions you must 'artificially' enumerate these partitions
- you also need to make sure that all those labels and model names are sanitized ...
tr -c -d
comes handy here
I have better proposal ... leave the 'technical' mount points as they are now - they are sure to work properly - and change these names in the graphical/presentation layer. For example you can display different names (labels or model) on the desktop then the actual mountpoint. You can also leave current device naming and add caption (text displayed after on-mounse-over a device) with its label and/or model.
from filer.
Needed to run sudo devfs ruleset 10
, now I get
% fstyp -l /dev/da0s1
msdosfs FAT
from filer.
Need in /etc/rc.conf
:
devfs_load_rulesets="YES"
devfs_system_ruleset="system"
Then the following seems to work: /etc/devfs.rules
[system=10]
add path 'acd*' mode 0644 group operator
add path 'cd*' mode 0644 group operator
add path 'da*' mode 0644 group operator
add path 'pass*' mode 0644 group operator
add path 'xpt*' mode 0644 group operator
add path 'fd*' mode 0644 group operator
add path 'md*' mode 0644 group operator
add path 'uscanner*' mode 0644 group operator
add path 'ugen*' mode 0644 group operator
add path 'video*' mode 0644 group operator
add path 'cuse*' mode 0644 group operator
add path 'usb*' mode 0644 group operator
# https://www.freebsd.org/doc/en_US.ISO8859-1/articles/cups/printing-cups-configuring-server.html
add path 'lpt*' mode 0644 group cups
add path 'ulpt*' mode 0644 group cups
add path 'unlpt*' mode 0644 group cups
Is this the correct way to do this?
from filer.
In perparation for this, I committed
Possibly we also need to edit
- https://github.com/helloSystem/ISO/blob/experimental/overlays/uzip/furybsd-live-settings/files/usr/local/bin/furybsd-init-helper (remains to be seen)
from filer.
We are getting somewhere.
from filer.
Related Issues (20)
- Folder/window open/close animations HOT 5
- If move the folder on the desktop, a window with the same file will appear HOT 3
- In the right-click menu of files, there will be "Eject" option HOT 1
- There is a blank line in the cursor hover content
- Dragging a document onto the white area of an opened folder window crashes HOT 10
- The file filer on the LiveCD does not show the hard disk where hello os is installed
- Right-click menu customization options
- Global Menu should receive keyboard command combinations even if a file browser window is the focused window.
- Wayland does not support QWindow::requestActivate()
- plasmashell Global Menu 2.0 does not show the menu for the desktop
- The name of the hard disk is displayed incorrectly on the desktop HOT 1
- Add play feature for audio and video HOT 4
- Hinged folders
- Recursive calculation of folder sizes
- The selection of text is too wide but the selection of icons is normal
- The desktop should not scroll when dragging the Icon HOT 1
- The specified location for moving files to the desktop is wrong HOT 1
- Desplay-preference "Wallpaper mode and image file position" needs to be swapped HOT 1
- The media remains on after the media is removed HOT 1
- Right-clicking still displays the Paste option even if there is no copy.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from filer.