18
votes
Accepted
How can I determine the rainbow book color of a CD on Linux?
You can use cd-info from the libcdio project. This will list all your CD’s tracks, and for each one, give you information about its contents: CD-DA (red book), Photo CD (beige), Video CD (white), etc.
17
votes
Is ext4 and xfs only for usage with internal file systems?
Can I utilize them both safely with removable media?
Yes. The description in the user interface is concerned about compatibility with other operating systems rather than the mobility of the medium ...
14
votes
Accepted
Mount drive not as removable drive
/media is intended for removable media, which is why your desktop environment shows the mountpoint as removable. To avoid that, mount your file system somewhere else, e.g. /mnt/ramdisk.
10
votes
Permission denied using pv for copying image to USB drive
Your problem with
sudo pv image.iso > /dev/sdb
bash: /dev/sdb: Permission denied
is that > it is a redirect of the output of sudo and therefore runs as the original user, not as root.
You need to ...
6
votes
Accepted
Permission denied using pv for copying image to USB drive
You cannot use redirection with sudo and expect unprivileged bash to be able to open a root-writable file for writing. See How to run a command that involves redirecting or piping with sudo?
You need ...
4
votes
Is ext4 and xfs only for usage with internal file systems?
Since you need encryption, this doesn't really apply as you'll have to resort to a filesystem that supports it anyways.
But answering the question in a more general sense: beware that the fact that ...
3
votes
Accepted
How the disk geometry (C/H/S) was determined on the partition table of flash memory storage?
In the 1980s, the BIOS in a PC needed to know the geometry of a hard disk in order to operate it properly. Users had to enter the correct number of cylinders, heads and sectors.
At some point (with ...
2
votes
Accepted
Solving the USB drive/mass storage stall issue
A udev rule, /etc/udev/rules.d/99-adjust-writeback-cache.rules:
ACTION=="add", KERNEL=="sd?", SUBSYSTEM=="block", ENV{ID_BUS}=="usb", \
RUN+="/usr/local/...
2
votes
Accepted
What happens if a root partition, mounted over USB, disconnects?
Typically, if a mounted USB is pulled, the mounted filesystem will become unreadable and unwritable. The state of the filesystem on the USB may also be corrupt if there are unwritten dirty pages in ...
2
votes
Prevent Linux Probing for Partitions
From Linux kernel 4 and on, you can use a livepatch module to block reading the partition table. This is much faster and easier than recompiling the entire kernel. I've created a module that covers ...
2
votes
Prevent Linux Probing for Partitions
Update: I've posted a quicker/safer method below using a kernel module
As @grochmal notes, there's no built in way to do this, although if you are willing to compile your own kernel, it's pretty ...
2
votes
Accepted
Is it wrong to fill the reserved space in an external USB drive for archiving purposes?
I assume that you are using an ext4 file system: You can modify the size of the reserved space with tune2fs. The following command line reduces the reserved space to 1% (from default 5%).
sudo ...
2
votes
Hide entries in grub menu when device is unavailable?
Using Artem suggestion about dynamic adding the entries, this is what I did (could not make case/esac work in my grub.cfg):
for dev in LIVEBOOT VTOYEFI ESP; do
set preroot=""
search --no-...
1
vote
Prevent Linux Probing for Partitions
The best solution I found works from kernel 2.6 and up; It works by using kretprobe to intercept the add_disk function and setting a flag that blocks partition reads. When the function returns, the ...
1
vote
Accepted
How to format a USB stick to be "Normal"
You just reset the partition table, you don't have a filesystem there. You need to run mkfs on the partition to do it:
mkfs -tvfat /dev/sdb1
Note that you want to create the filesystem on the ...
1
vote
Accepted
Why does default mount point of removable media contains username?
Having per-user directories under media allows the system to set things up so that users can’t list others’ mounted media. The username chosen for a mount point when a device is inserted is that of ...
1
vote
Where am I hitting the invisible SD card cache?
I notice dd it only copies 3.8 GiB when the drive is 14.5 GiB. So what you're writing to is most likely not the sd card. Unplug the SD card and then check ls -lh /dev/sdb.
I suspect you have ...
1
vote
Accepted
Linux specific problem with Write Protected Compact Flash
Maybe you can fix this with the quirks mode of the usb_storage driver for this specific device, see https://askubuntu.com/a/1088434
If you have to use the quirks mode this probably means that the ...
1
vote
Accepted
Are there any pitfalls to having a file-system directly on the hard disk with no partitions?
It's perfectly fine to do that. I've done it on some disks previously.
The only thing is: it might confuse you and others if you/they have to attach that disk to something else. I've had trouble with ...
1
vote
Does mounting external media read only make ejecting the media unnessesary? If so, how to mount all external media read only?
It's always recommended to umount properly any media , a file can still be opened for example
You can force media to mount read only with mount command options dedicated to options
mount -o ro /...
1
vote
Accepted
Marking filesystems as unremovable in CentOS
Problem was not on the kernel level, but on the XFCE (thunar to be exact) level. Without gvfs and udisks, XFCE cannot get advanced information about disks, and opts to show everything to be on the ...
1
vote
How the disk geometry (C/H/S) was determined on the partition table of flash memory storage?
I might have solved my problem. What I confused is how does the partition program decide the geometry of a device when it making partition tables. But after some experiments, I found that there is no ...
1
vote
How to set default auto mount options for removable media?
This functionality is now available in udisks2 since version 2.9.0.
See the documentation here for how to configure default and allowed mount options.
1
vote
Eject USB drives / eject command
Based on two top answers. Just using udisksctl results in error if still mounted and eject alone does not power-off, only unmounts USB. Therefore I wrote simple one-liner to create a function in bash:
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
removable-storage × 89linux × 24
mount × 15
usb-drive × 14
storage × 12
usb × 8
ubuntu × 7
block-device × 7
filesystems × 6
partition × 5
debian × 4
grub2 × 4
automounting × 4
sd-card × 4
command-line × 3
permissions × 3
security × 3
udev × 3
external-hdd × 3
centos × 2
linux-mint × 2
hard-disk × 2
symlink × 2
ext4 × 2
dd × 2