Fstab

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Fstab

Jorin Gedamke
Hello. I want to use a USB stick, but it never appears in fstab. Nor can I use genfstab; it's not installed. Please, can someone tell me which package contains genfstab, or how to search apt for it?
Reply | Threaded
Open this post in threaded view
|

Re: Fstab

Roberto C. Sánchez-2
On Sun, Dec 30, 2018 at 10:09:59PM -0500, Jorin Gedamke wrote:
>    Hello. I want to use a USB stick, but it never appears in fstab. Nor can I
>    use genfstab; it's not installed. Please, can someone tell me which
>    package contains genfstab, or how to search apt for it?

Are you using a graphical desktop environment or text console?  If a
graphical desktop, which one?

As far as searching for something, you can use this command

apt search <one-or-more-search-terms>

However, there does not appear to be a genfstab utility in Debian, at
least in the stable version.

Regards,

-Roberto

--
Roberto C. Sánchez

Reply | Threaded
Open this post in threaded view
|

Re: Fstab

Carl Fink-6
In reply to this post by Jorin Gedamke
On 12/30/18 10:09 PM, Jorin Gedamke wrote:
> Hello. I want to use a USB stick, but it never appears in fstab. Nor
> can I use genfstab; it's not installed. Please, can someone tell me
> which package contains genfstab, or how to search apt for it?

I did a duck.com search for "site:debian.org genfstab" which tells me
that gensftab is part of the arch-install-scripts package. Some
additional searches seems to confirm that is is an Arch
Linux-specific program.

I hope that's helpful.
--
Carl Fink [hidden email]
Thinking and logic and stuff at Reasonably Literate
http://reasonablyliterate.com

Reply | Threaded
Open this post in threaded view
|

Re: Fstab

Jude DaShiell-3
In reply to this post by Roberto C. Sánchez-2
So far as I know, genfstab is an archlinux utility.

On Sun, 30 Dec 2018, Roberto C. S?nchez wrote:
At least I've found it there and used it when installing archlinux.

> Date: Sun, 30 Dec 2018 22:37:37
> From: Roberto C. S?nchez <[hidden email]>
> To: [hidden email]
> Subject: Re: Fstab
> Resent-Date: Mon, 31 Dec 2018 03:37:56 +0000 (UTC)
> Resent-From: [hidden email]
>
> On Sun, Dec 30, 2018 at 10:09:59PM -0500, Jorin Gedamke wrote:
> >    Hello. I want to use a USB stick, but it never appears in fstab. Nor can I
> >    use genfstab; it's not installed. Please, can someone tell me which
> >    package contains genfstab, or how to search apt for it?
>
> Are you using a graphical desktop environment or text console?  If a
> graphical desktop, which one?
>
> As far as searching for something, you can use this command
>
> apt search <one-or-more-search-terms>
>
> However, there does not appear to be a genfstab utility in Debian, at
> least in the stable version.
>
> Regards,
>
> -Roberto
>
>

--

Reply | Threaded
Open this post in threaded view
|

Re: Fstab

David Christensen
In reply to this post by Jorin Gedamke
On 12/30/18 7:09 PM, Jorin Gedamke wrote:
> Hello. I want to use a USB stick, but it never appears in fstab. Nor can I
> use genfstab; it's not installed. Please, can someone tell me which package
> contains genfstab, or how to search apt for it?

/etc/fstab is a file that the system administrator (you) is expected to
maintain.  But, you don't need an fstab(5) entry to access a USB stick.


If you are using a graphical desktop, the USB stick should be
"automagically" mounted when inserted.  Be sure to right-click and
"eject" the USB stick before removing it.


If you are using the console or a terminal, log in to the root account.


Connect your USB stick.


Use dmesg(1) to view kernel messages:

2018-12-30 21:23:39 root@tinkywinky ~
# dmesg
...
[42625.040087] usb 3-3: new high-speed USB device number 3 using ehci-pci
[42625.191031] usb 3-3: New USB device found, idVendor=12f7, idProduct=1c00
[42625.191043] usb 3-3: New USB device strings: Mfr=1, Product=2,
SerialNumber=3
[42625.191049] usb 3-3: Product: Flashdrive 303B
[42625.191056] usb 3-3: Manufacturer: Memorex
[42625.191062] usb 3-3: SerialNumber: ************
[42625.372593] usb-storage 3-3:1.0: USB Mass Storage device detected
[42625.378256] scsi host2: usb-storage 3-3:1.0
[42625.378416] usbcore: registered new interface driver usb-storage
[42625.381818] usbcore: registered new interface driver uas
[42626.397636] scsi 2:0:0:0: Direct-Access     Memorex  Flashdrive 303B
PMAP PQ: 0 ANSI: 0 CCS
[42626.398632] sd 2:0:0:0: Attached scsi generic sg2 type 0
[42626.568113] sd 2:0:0:0: [sdb] 251776 512-byte logical blocks: (129
MB/123 MiB)
[42626.569429] sd 2:0:0:0: [sdb] Write Protect is off
[42626.569434] sd 2:0:0:0: [sdb] Mode Sense: 23 00 00 00
[42626.570095] sd 2:0:0:0: [sdb] No Caching mode page found
[42626.570103] sd 2:0:0:0: [sdb] Assuming drive cache: write through
[42626.575875]  sdb:
[42626.578571] sd 2:0:0:0: [sdb] Attached SCSI removable disk


Note "[sdb]" in the last six lines.  The device node corresponding to
the USB stick on my machine is /dev/sdb.  On your machine, it could be
sdb, sdc, sdd, etc., or even sdb1, sdc1, sdc1, etc..  Use that value in
place of 'sdb' for the following commands.


Use mkdir(1) to create a mount point:

2018-12-30 21:27:11 root@tinkywinky ~
# mkdir /mnt/sdb


Use mount(8) to mount the USB stick file system:

2018-12-30 21:27:18 root@tinkywinky ~
# mount /dev/sdb /mnt/sdb


You should now be able to navigate to the file system on the USB stick.

2018-12-30 21:37:45 root@tinkywinky ~
# cd /mnt/sdb

2018-12-30 21:38:24 root@tinkywinky /mnt/sdb
# ls -w 72
COPYING        elf.c32   ldlinux.c32 poweroff.c32
README.txt     ethersel.c32   ldlinux.sys prdhcp.c32
boot       f1.txt   lfs.c32 pwd.c32
cat.c32        f2.txt   libcom32.c32  pxechn.c32
chain.c32      f3.txt   libgpl.c32 reboot.c32
cmd.c32        gfxboot.c32   liblua.c32 rosh.c32
cmenu.c32      gpxecmd.c32   libmenu.c32 sanboot.c32
config.c32     hdt.c32   libutil.c32 sdi.c32
cptime.c32     hexdump.c32   linux.c32 sysdump.c32
cpu.c32        host.c32   ls.c32 syslinux.c32
cpuid.c32      ifcpu.c32   lua.c32 syslinux.cfg
cpuidtest.c32  ifcpu64.c32   mboot.c32 vesa.c32
debug.c32      ifmemdsk.c32   meminfo.c32 vesainfo.c32
dhcp.c32       ifplop.c32   memtest vesamenu.c32
disk.c32       images   menu.c32 vmlinuz
dmi.c32        instroot.img   message vpdtest.c32
dmitest.c32    ipcop-2.1.8.tar.gz  pci.c32 whichsys.c32
doc       kbdmap.c32   pcitest.c32 zzjson.c32
dosutils       kontron_wdt.c32   pmload.c32


When you are done, change your working directory back to home:

2018-12-30 21:41:08 root@tinkywinky /mnt/sdb
# cd


umount(8) the USB stick:

2018-12-30 21:44:08 root@tinkywinky ~
# umount /mnt/sdb


Remove the USB stick.


David

Reply | Threaded
Open this post in threaded view
|

Re: Fstab

Brian
On Sun 30 Dec 2018 at 21:47:37 -0800, David Christensen wrote:

> On 12/30/18 7:09 PM, Jorin Gedamke wrote:
> > Hello. I want to use a USB stick, but it never appears in fstab. Nor can I
> > use genfstab; it's not installed. Please, can someone tell me which package
> > contains genfstab, or how to search apt for it?
>
> /etc/fstab is a file that the system administrator (you) is expected to
> maintain.  But, you don't need an fstab(5) entry to access a USB stick.

Correct - a user can use utilities like pmount, udevil or udisksctl
to mount a partition on a USB stick. For a variety of sticks used
this is probably a good approach (in conjunction with lsblk).

> If you are using a graphical desktop, the USB stick should be
> "automagically" mounted when inserted.  Be sure to right-click and "eject"
> the USB stick before removing it.

This type of automounting would be closely associated with default
installations of DEs such as GNOME, Xfce, Mate etc. A fvwm user would
have to make an effort to get it.

[Good advice snipped]

Sticking with the desire for an fstab entry, we could could automount
and autounmount using systemd:

Use 'lsblk -f' to get the UUID of a partition on the stick. In fstab:

  UUID=  /media/usbstick auto defaults, noauto,x-systemd.automount,
         x-systemd.idle-timeout=5,x-systemd.device-timeout=1 0 0

(All on one line)

* x-systemd.automount mounts /media/usbstick when any command (such
  as ls) wants to use it.

* systemd.idle-timeout leads to unmounting the partition a specified
  time period after the calling program ceases to access it.

* noauto causes /media/usbstick not to be mounted while the machine is
  booting.

* x-systemd.device-timeout configures how long systemd should wait when
  no device is plugged in or an incorrect device is found.

--
Brian.