Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #167994 > unrolled thread
| Started by | Ron Leach <ronleach@tesco.net> |
|---|---|
| First post | 2016-05-18 11:40 +0200 |
| Last post | 2016-05-18 21:10 +0200 |
| Articles | 17 — 10 participants |
Back to article view | Back to linux.debian.user
Something never understood: see USB storage in CLI & mc Ron Leach <ronleach@tesco.net> - 2016-05-18 11:40 +0200
Re: Something never understood: see USB storage in CLI & mc <tomas@tuxteam.de> - 2016-05-18 11:50 +0200
Re: Something never understood: see USB storage in CLI & mc Felix Miata <mrmazda@earthlink.net> - 2016-05-18 11:50 +0200
Re: Something never understood: see USB storage in CLI & mc Ron Leach <ronleach@tesco.net> - 2016-05-18 13:20 +0200
Re: Something never understood: see USB storage in CLI & mc Lisi Reisz <lisi.reisz@gmail.com> - 2016-05-18 13:30 +0200
Re: Something never understood: see USB storage in CLI & mc Brian <ad44@cityscape.co.uk> - 2016-05-18 13:50 +0200
Re: Something never understood: see USB storage in CLI & mc Brian <ad44@cityscape.co.uk> - 2016-05-18 14:00 +0200
Re: Something never understood: see USB storage in CLI & mc "Martin McCormick" <martin.m@suddenlink.net> - 2016-05-18 14:30 +0200
Re: Something never understood: see USB storage in CLI & mc Felix Miata <mrmazda@earthlink.net> - 2016-05-18 15:00 +0200
Re: Something never understood: see USB storage in CLI & mc Gene Heskett <gheskett@shentel.net> - 2016-05-18 15:40 +0200
Re: Something never understood: see USB storage in CLI & mc Dominique Dumont <dod@debian.org> - 2016-05-18 12:00 +0200
Re: Something never understood: see USB storage in CLI & mc Jonas Hedman <jonas.hedman@fripost.org> - 2016-05-18 12:00 +0200
Re: Something never understood: see USB storage in CLI & mc Jude DaShiell <jdashiel@panix.com> - 2016-05-18 14:00 +0200
Re: Something never understood: see USB storage in CLI & mc Gene Heskett <gheskett@shentel.net> - 2016-05-18 15:40 +0200
Re: Something never understood: see USB storage in CLI & mc Brian <ad44@cityscape.co.uk> - 2016-05-18 18:30 +0200
Re: Something never understood: see USB storage in CLI & mc Ron Leach <ronleach@tesco.net> - 2016-05-18 20:20 +0200
Re: Something never understood: see USB storage in CLI & mc Jonas Hedman <jonas.hedman@fripost.org> - 2016-05-18 21:10 +0200
| From | Ron Leach <ronleach@tesco.net> |
|---|---|
| Date | 2016-05-18 11:40 +0200 |
| Subject | Something never understood: see USB storage in CLI & mc |
| Message-ID | <rA67n-eQ-7@gated-at.bofh.it> |
List, good morning, One aspect of Debian I've never managed to 'get', is how to 'see' any temporarily plugged-in USB storage device, from the command line or in mc. The machines in question are using Wheezy. I often use a machine (with only cli) to download overnight - this works well. But when I insert (say) a 2G or 4G USB storage, I cannot 'find' any mount referring to the USB storage. I assume that I have to mount the USB storage, but where should I find the reference for the physical device to mount? Best of all would be to make this process 'automatic', if I could. Not all the devices are formatted with vfat; I think some use ext(x), and some are dd'd ISOs. Because labelling these devices is not very practical, I'd like to be able to plug them in and check what they contain - before, perhaps, overwriting them with something new. I'd be interested in how other users organise this but, essentially, I'd be grateful for any advice on where to find the physical device to use in a mount command. And, as a secondary question (there are two points on offer for this one), how to mount it without knowing the device's fs. regards, Ron
[toc] | [next] | [standalone]
| From | <tomas@tuxteam.de> |
|---|---|
| Date | 2016-05-18 11:50 +0200 |
| Message-ID | <rA6h3-ix-7@gated-at.bofh.it> |
| In reply to | #167994 |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wed, May 18, 2016 at 10:30:34AM +0100, Ron Leach wrote: > List, good morning, > > One aspect of Debian I've never managed to 'get', is how to 'see' > any temporarily plugged-in USB storage device [...] I do a 'dmesg | tail' shortly after having inserted the stick. Then I can see the noise the kernel is making after "seeing" it. If you want to tweak what happens after inserting an USB, you might want to tweak the udev rules (for example, I had a backup script fire up automatically at a customer's when a disk with the right label or UUID was inserted). Felix's approach is, of course, much more elegant to see what is there, since it doesn't rely on dmesg not having flown by... regards - -- t -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlc8OosACgkQBcgs9XrR2kYAfQCfTkJQrMsCk0gLxi4p92Aa999N fnQAnRXw/loEJnjuFHHu0kZv0M5Kfi7X =4XAM -----END PGP SIGNATURE-----
[toc] | [prev] | [next] | [standalone]
| From | Felix Miata <mrmazda@earthlink.net> |
|---|---|
| Date | 2016-05-18 11:50 +0200 |
| Message-ID | <rA6h3-ix-13@gated-at.bofh.it> |
| In reply to | #167994 |
Ron Leach composed on 2016-05-18 10:30 (UTC+0100): > One aspect of Debian I've never managed to 'get', is how to 'see' any > temporarily plugged-in USB storage device, from the command line or in > mc. The machines in question are using Wheezy. > I often use a machine (with only cli) to download overnight - this > works well. But when I insert (say) a 2G or 4G USB storage, I cannot > 'find' any mount referring to the USB storage. > I assume that I have to mount the USB storage, but where should I find > the reference for the physical device to mount? Best of all would be > to make this process 'automatic', if I could. > Not all the devices are formatted with vfat; I think some use ext(x), > and some are dd'd ISOs. Because labelling these devices is not very > practical, I'd like to be able to plug them in and check what they > contain - before, perhaps, overwriting them with something new. > I'd be interested in how other users organise this but, essentially, > I'd be grateful for any advice on where to find the physical device to > use in a mount command. And, as a secondary question (there are two > points on offer for this one), how to mount it without knowing the > device's fs. # lsscsi ... [9:0:0:0] disk FLASH Drive SM_USB20 1100 /dev/sdg... # blkid /dev/sdg # mount -t auto (or the type reported by blkid) -- "The wise are known for their understanding, and pleasant words are persuasive." Proverbs 16:21 (New Living Translation) Team OS/2 ** Reg. Linux User #211409 ** a11y rocks! Felix Miata *** http://fm.no-ip.com/
[toc] | [prev] | [next] | [standalone]
| From | Ron Leach <ronleach@tesco.net> |
|---|---|
| Date | 2016-05-18 13:20 +0200 |
| Message-ID | <rA7Ga-1nu-17@gated-at.bofh.it> |
| In reply to | #167996 |
On 18/05/2016 10:40, Felix Miata wrote: > Ron Leach composed on 2016-05-18 10:30 (UTC+0100): >> I'd be grateful for any advice on where to find the physical device to >> use in a mount command. > > # lsscsi > ... > [9:0:0:0] disk FLASH Drive SM_USB20 1100 /dev/sdg... > > # blkid /dev/sdg > > # mount -t auto (or the type reported by blkid) Felix, thank you for the (very) prompt reply. It didn't quite work, for me. wheezy2:/home/ron# lsscsi bash: lsscsi: command not found wheezy2:/home/ron# lsusb Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 001 Device 004: ID 0781:a7c1 SanDisk Corp. As you see, lsscsi does not seem to exist on his machine. One alternative I've used in other usb contexts, lsusb, sees the device, but without a /dev/sd... Another reply suggested using dmesg output, which I'll try now - and reply to in a moment. Regards, Ron
[toc] | [prev] | [next] | [standalone]
| From | Lisi Reisz <lisi.reisz@gmail.com> |
|---|---|
| Date | 2016-05-18 13:30 +0200 |
| Message-ID | <rA7PQ-1s3-17@gated-at.bofh.it> |
| In reply to | #168002 |
On Wednesday 18 May 2016 12:14:00 Ron Leach wrote: > On 18/05/2016 10:40, Felix Miata wrote: > > Ron Leach composed on 2016-05-18 10:30 (UTC+0100): > >> I'd be grateful for any advice on where to find the physical device to > >> use in a mount command. > > > > # lsscsi > > ... > > [9:0:0:0] disk FLASH Drive SM_USB20 1100 /dev/sdg... > > > > # blkid /dev/sdg > > > > # mount -t auto (or the type reported by blkid) > > Felix, thank you for the (very) prompt reply. It didn't quite work, > for me. > > wheezy2:/home/ron# lsscsi > bash: lsscsi: command not found # aptitude install lsscsi ? Lisi > wheezy2:/home/ron# lsusb > Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub > Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub > Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub > Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub > Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub > Bus 001 Device 004: ID 0781:a7c1 SanDisk Corp. > > As you see, lsscsi does not seem to exist on his machine. One > alternative I've used in other usb contexts, lsusb, sees the device, > but without a /dev/sd... > > Another reply suggested using dmesg output, which I'll try now - and > reply to in a moment. > > Regards, Ron
[toc] | [prev] | [next] | [standalone]
| From | Brian <ad44@cityscape.co.uk> |
|---|---|
| Date | 2016-05-18 13:50 +0200 |
| Message-ID | <rA89b-1Ai-7@gated-at.bofh.it> |
| In reply to | #168002 |
On Wed 18 May 2016 at 12:14:00 +0100, Ron Leach wrote: > On 18/05/2016 10:40, Felix Miata wrote: > >Ron Leach composed on 2016-05-18 10:30 (UTC+0100): > >>I'd be grateful for any advice on where to find the physical device to > >>use in a mount command. > > > ># lsscsi > >... > >[9:0:0:0] disk FLASH Drive SM_USB20 1100 /dev/sdg... > > > ># blkid /dev/sdg > > > ># mount -t auto (or the type reported by blkid) > > Felix, thank you for the (very) prompt reply. It didn't quite work, for me. > > wheezy2:/home/ron# lsscsi > bash: lsscsi: command not found > wheezy2:/home/ron# lsusb > Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub > Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub > Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub > Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub > Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub > Bus 001 Device 004: ID 0781:a7c1 SanDisk Corp. > > As you see, lsscsi does not seem to exist on his machine. One alternative > I've used in other usb contexts, lsusb, sees the device, but without a > /dev/sd... > > Another reply suggested using dmesg output, which I'll try now - and reply > to in a moment. You have to install lsscsi to use it. However, what is on every Debian system is the utils-linux package and it has lsblk. At its simplest: brian@desktop:~$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT fd0 2:0 1 4K 0 disk sda 8:0 0 149.1G 0 disk ├─sda1 8:1 0 16.8G 0 part / ├─sda2 8:2 0 5.6G 0 part /var ├─sda3 8:3 0 1.9G 0 part [SWAP] └─sda4 8:4 0 124.9G 0 part /home sdb 8:16 1 964M 0 disk ├─sdb1 8:17 1 315M 0 part └─sdb2 8:18 1 320K 0 part sr0 11:0 1 1024M 0 rom sr1 11:1 1 466.7M 0 rom Or: brian@desktop:~$ lsblk -S NAME HCTL TYPE VENDOR MODEL REV TRAN sda 0:0:0:0 disk ATA SAMSUNG HD160JJ 0-33 sata sdb 47:0:0:0 disk PEAK III Flash Drive 0.00 usb sr0 3:0:0:0 rom MATSHITA CD-ROM CR-587 7S13 ata sr1 4:0:0:0 rom PIONEER DVD-RW DVR-110 1.22 ata
[toc] | [prev] | [next] | [standalone]
| From | Brian <ad44@cityscape.co.uk> |
|---|---|
| Date | 2016-05-18 14:00 +0200 |
| Message-ID | <rA8iS-1DX-11@gated-at.bofh.it> |
| In reply to | #168005 |
On Wed 18 May 2016 at 12:43:03 +0100, Brian wrote: > > You have to install lsscsi to use it. However, what is on every Debian > system is the utils-linux package and it has lsblk. util-linux.
[toc] | [prev] | [next] | [standalone]
| From | "Martin McCormick" <martin.m@suddenlink.net> |
|---|---|
| Date | 2016-05-18 14:30 +0200 |
| Message-ID | <rA8LU-25R-19@gated-at.bofh.it> |
| In reply to | #168002 |
Some of what we are explaining has to do with how one sets up their /etc/fstab configuration but usb drives generate a predictable set of messages in /var/log/syslog. The particular details change based upon what has already been installed in one's file system, but if things are working right, the messages identify the new device being plugged in as storage and also identify what new node in the file system the new drive has such as /dev/sdg or /dev/sdb. At that point, you can use fdisk -l /dev/sdb or /dev/sdg to identify the partitions which will look like /dev/sdb1 or /dev/sdh5, depending on how the drive is formatted. If this is a temporary situation, such as wanting to read a drive somebody handed to you, you can mount the desired partition as mount /dev/stb2 /mnt and that will work as long as it is a file system that your Linux device knows about. When one is through working with the drive, umount /mnt is sufficient to safely remove the mounting but make sure you got a new shell prompt before you pull the plug because the OS may not have finished updating the inode list on the drive if you wrote a huge file to it or removed a huge file from it. I have actually done that while in a hurry and the results are ugly. Some other things you can read about are programs such as blkid which gives you a unique ID called a UUID for any disk drive. You can use this unique string in your /etc/fstab file to cause your system to automatically mount the drive every time it is plugged in or at least let you give a command like mount /arch and it will know what to do if the drive waiting to be mounted has that UUID string. I have two thumb drives which contain archives of stuff I do not want to lose. Either one mounts to /arch but I must uncomment the correct line to make it work. Here's what that looks like. #UUID="238405a2-9d98-4808-ae2c-07905c318761" /arch ext4 ro,user,noauto 0 0 UUID="85e06ca5-abb4-4d28-95ac-bc08441d37ce" /arch ext4 ro,user,noauto 0 0 The line without the # works if I plug in that drive and type mount /arch. If I need to use the other /arch drive, I must comment out the bottom line and uncomment the top line and that other drive will then work. The noauto directive tells the system to hold off on mounting in case maybe I didn't really want to mount it just yet. Once you mount a drive, even if you did nothing else, you must use umount to remove it or one may be very unhappy later. Sorry if this is a bit long, but it is a very useful system which makes life less frustrating if one learns the basics. Martin Ron Leach <ronleach@tesco.net> writes: > On 18/05/2016 10:40, Felix Miata wrote: > > Ron Leach composed on 2016-05-18 10:30 (UTC+0100): > > I'd be grateful for any advice on where to find the physical > device to > use in a mount command. > > > # lsscsi > ... > [9:0:0:0] disk FLASH Drive SM_USB20 1100 /dev/sdg... > > # blkid /dev/sdg > > # mount -t auto (or the type reported by blkid) > > > > Felix, thank you for the (very) prompt reply. It didn't quite work, for > me. > > > wheezy2:/home/ron# lsscsi > bash: lsscsi: command not found > wheezy2:/home/ron# lsusb > Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub > Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub > Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub > Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub > Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub > Bus 001 Device 004: ID 0781:a7c1 SanDisk Corp. > > > As you see, lsscsi does not seem to exist on his machine. One alternative > I've used in other usb contexts, lsusb, sees the device, but without a > /dev > /sd... > > > > Another reply suggested using dmesg output, which I'll try now - and reply > to in a moment. > > > Regards, Ron > >
[toc] | [prev] | [next] | [standalone]
| From | Felix Miata <mrmazda@earthlink.net> |
|---|---|
| Date | 2016-05-18 15:00 +0200 |
| Message-ID | <rA9eW-2gz-5@gated-at.bofh.it> |
| In reply to | #168002 |
Ron Leach composed on 2016-05-18 12:14 (UTC+0100): > Felix Miata wrote: >> Ron Leach composed on 2016-05-18 10:30 (UTC+0100): >>> I'd be grateful for any advice on where to find the physical device to >>> use in a mount command. >> # lsscsi >> ... >> [9:0:0:0] disk FLASH Drive SM_USB20 1100 /dev/sdg... >> # blkid /dev/sdg >> # mount -t auto (or the type reported by blkid) > Felix, thank you for the (very) prompt reply. It didn't quite work, > for me. > wheezy2:/home/ron# lsscsi > bash: lsscsi: command not found > wheezy2:/home/ron# lsusb > Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub > Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub > Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub > Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub > Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub > Bus 001 Device 004: ID 0781:a7c1 SanDisk Corp. > As you see, lsscsi does not seem to exist on his machine. It didn't here either. Writing when I did, hours after I should have gone to bed, I got flustered when lsscsi was not installed and had to install it, then forgot about even trying lsblk (as Brian answered later), which is actually the better alternative, and didn't write a logically complete answer. Output from lsscsi doesn't include partition information, so mounting based upon its literal output will fail unless the USB device is unpartitioned. -- "The wise are known for their understanding, and pleasant words are persuasive." Proverbs 16:21 (New Living Translation) Team OS/2 ** Reg. Linux User #211409 ** a11y rocks! Felix Miata *** http://fm.no-ip.com/
[toc] | [prev] | [next] | [standalone]
| From | Gene Heskett <gheskett@shentel.net> |
|---|---|
| Date | 2016-05-18 15:40 +0200 |
| Message-ID | <rA9RD-2KE-17@gated-at.bofh.it> |
| In reply to | #167996 |
On Wednesday 18 May 2016 05:40:06 Felix Miata wrote: > Ron Leach composed on 2016-05-18 10:30 (UTC+0100): > > One aspect of Debian I've never managed to 'get', is how to 'see' > > any temporarily plugged-in USB storage device, from the command line > > or in mc. The machines in question are using Wheezy. > > > > I often use a machine (with only cli) to download overnight - this > > works well. But when I insert (say) a 2G or 4G USB storage, I > > cannot 'find' any mount referring to the USB storage. > > > > I assume that I have to mount the USB storage, but where should I > > find the reference for the physical device to mount? Best of all > > would be to make this process 'automatic', if I could. > > > > Not all the devices are formatted with vfat; I think some use > > ext(x), and some are dd'd ISOs. Because labelling these devices is > > not very practical, I'd like to be able to plug them in and check > > what they contain - before, perhaps, overwriting them with something > > new. > > > > I'd be interested in how other users organise this but, essentially, > > I'd be grateful for any advice on where to find the physical device > > to use in a mount command. And, as a secondary question (there are > > two points on offer for this one), how to mount it without knowing > > the device's fs. > > # lsscsi > ... > [9:0:0:0] disk FLASH Drive SM_USB20 1100 /dev/sdg... My wheezy install does not have this command. The OP might not either, but installing it shouldn't be that difficult. > > # blkid /dev/sdg > > # mount -t auto (or the type reported by blkid) With lsscsi to help id the device, this is possibly a faster method than mine. Cheers, Gene Heskett -- "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author) Genes Web page <http://geneslinuxbox.net:6309/gene>
[toc] | [prev] | [next] | [standalone]
| From | Dominique Dumont <dod@debian.org> |
|---|---|
| Date | 2016-05-18 12:00 +0200 |
| Message-ID | <rA6qK-mg-9@gated-at.bofh.it> |
| In reply to | #167994 |
On Wednesday 18 May 2016 10:30:34 Ron Leach wrote: > I assume that I have to mount the USB storage, but where should I find > the reference for the physical device to mount? Best of all would be > to make this process 'automatic', if I could. IIRC, you can use udisks-glue on wheezy. On Jessie and later, you can rely on systemd. See https://ddumont.wordpress.com/2016/04/24/automount-usb-devices-with-systemd/ HTH -- https://github.com/dod38fr/ -o- http://search.cpan.org/~ddumont/ http://ddumont.wordpress.com/ -o- irc: dod at irc.debian.org
[toc] | [prev] | [next] | [standalone]
| From | Jonas Hedman <jonas.hedman@fripost.org> |
|---|---|
| Date | 2016-05-18 12:00 +0200 |
| Message-ID | <rA6qK-mg-17@gated-at.bofh.it> |
| In reply to | #167994 |
[Multipart message — attachments visible in raw view] — view raw
On 16-05-18 10:30:34, Ron Leach wrote: > List, good morning, > > One aspect of Debian I've never managed to 'get', is how to 'see' any > temporarily plugged-in USB storage device, from the command line or in mc. > The machines in question are using Wheezy. > > I often use a machine (with only cli) to download overnight - this works > well. But when I insert (say) a 2G or 4G USB storage, I cannot 'find' any > mount referring to the USB storage. > > I assume that I have to mount the USB storage, but where should I find the > reference for the physical device to mount? Best of all would be to make > this process 'automatic', if I could. > > Not all the devices are formatted with vfat; I think some use ext(x), and > some are dd'd ISOs. Because labelling these devices is not very practical, > I'd like to be able to plug them in and check what they contain - before, > perhaps, overwriting them with something new. > > I'd be interested in how other users organise this but, essentially, I'd be > grateful for any advice on where to find the physical device to use in a > mount command. And, as a secondary question (there are two points on offer > for this one), how to mount it without knowing the device's fs. > > regards, Ron > While not automatic, insert usb, demesg | tail and then pmount sdbX and df for checking available space simplifies my life greatly. -- Jonas Hedman XMPP: nstr@nstr.se PGP Key: 0x5c3989e0616bb08c Fingerprint: 8F72 C5BE AAFA B4BA 8F46 9185 5C39 89E0 616B B08C
[toc] | [prev] | [next] | [standalone]
| From | Jude DaShiell <jdashiel@panix.com> |
|---|---|
| Date | 2016-05-18 14:00 +0200 |
| Message-ID | <rA8iS-1DX-13@gated-at.bofh.it> |
| In reply to | #167994 |
lsusb -v may help. On Wed, 18 May 2016, Ron Leach wrote: > Date: Wed, 18 May 2016 05:30:34 > From: Ron Leach <ronleach@tesco.net> > To: debian-user@lists.debian.org > Subject: Something never understood: see USB storage in CLI & mc > Resent-Date: Wed, 18 May 2016 09:31:05 +0000 (UTC) > Resent-From: debian-user@lists.debian.org > > List, good morning, > > One aspect of Debian I've never managed to 'get', is how to 'see' any > temporarily plugged-in USB storage device, from the command line or in mc. > The machines in question are using Wheezy. > > I often use a machine (with only cli) to download overnight - this works > well. But when I insert (say) a 2G or 4G USB storage, I cannot 'find' any > mount referring to the USB storage. > > I assume that I have to mount the USB storage, but where should I find the > reference for the physical device to mount? Best of all would be to make > this process 'automatic', if I could. > > Not all the devices are formatted with vfat; I think some use ext(x), and > some are dd'd ISOs. Because labelling these devices is not very practical, > I'd like to be able to plug them in and check what they contain - before, > perhaps, overwriting them with something new. > > I'd be interested in how other users organise this but, essentially, I'd be > grateful for any advice on where to find the physical device to use in a > mount command. And, as a secondary question (there are two points on offer > for this one), how to mount it without knowing the device's fs. > > regards, Ron > > --
[toc] | [prev] | [next] | [standalone]
| From | Gene Heskett <gheskett@shentel.net> |
|---|---|
| Date | 2016-05-18 15:40 +0200 |
| Message-ID | <rA9RD-2KE-7@gated-at.bofh.it> |
| In reply to | #167994 |
On Wednesday 18 May 2016 05:30:34 Ron Leach wrote: > List, good morning, > > One aspect of Debian I've never managed to 'get', is how to 'see' any > temporarily plugged-in USB storage device, from the command line or in > mc. The machines in question are using Wheezy. > > I often use a machine (with only cli) to download overnight - this > works well. But when I insert (say) a 2G or 4G USB storage, I cannot > 'find' any mount referring to the USB storage. > > I assume that I have to mount the USB storage, but where should I find > the reference for the physical device to mount? Best of all would be > to make this process 'automatic', if I could. > > Not all the devices are formatted with vfat; I think some use ext(x), > and some are dd'd ISOs. Because labelling these devices is not very > practical, I'd like to be able to plug them in and check what they > contain - before, perhaps, overwriting them with something new. > > I'd be interested in how other users organise this but, essentially, > I'd be grateful for any advice on where to find the physical device to > use in a mount command. And, as a secondary question (there are two > points on offer for this one), how to mount it without knowing the > device's fs. > > regards, Ron This detection and auto-mounting of plugged in media is generally part of the desktop you run. I am using TDE, up to date version r14, and when I plug in my junk cell phone when its turned off, it goes into charge mode until it topped off, then a TDE Daemon finds it and mounts to /media/somenumber automaticly, giving it access perms only from the owner of the desktop. Only 50 megs of ram so obviously its a fat-16 file system. I doubt, if you are not running a desktop, that such an automount facility is available or running on your system. One way to do it manually is to run 'blkid' from a shell, which will output a unique identifier for each device it can find. My phone for instance, shows up in the list blkid outputs as /dev/sdd: SEC_TYPE="msdos" UUID="2A21-0001" TYPE="vfat" you could then construct a mount command, see mounts man page, useing either the /dev/sdd (discouraged as it is not unique and yours may be a different sd#) or the UUID=number, which will be different from mine, using the vfat filesystem, mounted to /media/2A21-0001 in my case. The UUID method is much the preferred method, and that is the name its mounted at too. I am pretty sure such an auto function could be hacked up in a bash script, I've done them critters for 2 or 3 things here, but not this since my gui of choice handles it. But I think you can see from the above what needs to be done by hand if your desktop isn't in use. IHTH. Cheers, Gene Heskett -- "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author) Genes Web page <http://geneslinuxbox.net:6309/gene>
[toc] | [prev] | [next] | [standalone]
| From | Brian <ad44@cityscape.co.uk> |
|---|---|
| Date | 2016-05-18 18:30 +0200 |
| Message-ID | <rAcwb-4sK-57@gated-at.bofh.it> |
| In reply to | #168011 |
On Wed 18 May 2016 at 09:33:28 -0400, Gene Heskett wrote: > On Wednesday 18 May 2016 05:30:34 Ron Leach wrote: > [...Snip...] > > I'd be interested in how other users organise this but, essentially, > > I'd be grateful for any advice on where to find the physical device to > > use in a mount command. And, as a secondary question (there are two > > points on offer for this one), how to mount it without knowing the > > device's fs. > > This detection and auto-mounting of plugged in media is generally part of > the desktop you run. I am using TDE, up to date version r14, and when I It can be but there are enough people not running GNOME, Xfce, MATE etc to question whether the generalisation is useful. > plug in my junk cell phone when its turned off, it goes into charge mode > until it topped off, then a TDE Daemon finds it and mounts > to /media/somenumber automaticly, giving it access perms only from the > owner of the desktop. Only 50 megs of ram so obviously its a fat-16 > file system. > > I doubt, if you are not running a desktop, that such an automount > facility is available or running on your system. Doubt no longer: apt-cache show usbmount udevil | less > One way to do it manually is to run 'blkid' from a shell, which will > output a unique identifier for each device it can find. My phone for '/sbin/blkid' is preferable for a user. > instance, shows up in the list blkid outputs as > > /dev/sdd: SEC_TYPE="msdos" UUID="2A21-0001" TYPE="vfat" > > you could then construct a mount command, see mounts man page, useing > either the /dev/sdd (discouraged as it is not unique and yours may be a > different sd#) or the UUID=number, which will be different from mine, > using the vfat filesystem, mounted to /media/2A21-0001 in my case. The > UUID method is much the preferred method, and that is the name its > mounted at too. This is the second post in this thread which recommends becoming root to carry out the simple user task of identifying and mounting a removeable device. There are many Debian users who have a firm belief in only using root privilege for the most essential of maintenance jobs and many others who do not have that privilege. Isn't it about time to leverage the benefits of the OS? Ron Leach's requirement is met completely by dmesg, lsblk or even lsscsi, pmount, udevil or udisksctl and usbmount or devmon. > I am pretty sure such an auto function could be hacked up in a bash > script, I've done them critters for 2 or 3 things here, but not this > since my gui of choice handles it. It probably could.
[toc] | [prev] | [next] | [standalone]
| From | Ron Leach <ronleach@tesco.net> |
|---|---|
| Date | 2016-05-18 20:20 +0200 |
| Message-ID | <rAeeC-5Ah-11@gated-at.bofh.it> |
| In reply to | #168031 |
First, may I, at the top of the post and before replying to Brian, acknowledge the plethora of information in all the thread replies. I really would like to express my thanks to so many users who took the time to help explain and suggest. On 18/05/2016 17:25, Brian wrote: > On Wed 18 May 2016 at 09:33:28 -0400, Gene Heskett wrote: >> One way to do it manually is to run 'blkid' from a shell, which will >> output a unique identifier for each device it can find. My phone for > > '/sbin/blkid' is preferable for a user. > >> instance, shows up in the list blkid outputs as >> >> /dev/sdd: SEC_TYPE="msdos" UUID="2A21-0001" TYPE="vfat" >> >> you could then construct a mount command, see mounts man page, useing >> either the /dev/sdd (discouraged as it is not unique and yours may be a >> different sd#) or the UUID=number, which will be different from mine, >> using the vfat filesystem, mounted to /media/2A21-0001 in my case. The >> UUID method is much the preferred method, and that is the name its >> mounted at too. > > This is the second post in this thread which recommends becoming root to > carry out the simple user task of identifying and mounting a removeable > device. There are many Debian users who have a firm belief in only using > root privilege for the most essential of maintenance jobs and many > others who do not have that privilege. Isn't it about time to leverage > the benefits of the OS? > > Ron Leach's requirement is met completely by dmesg, lsblk or even > lsscsi, pmount, udevil or udisksctl and usbmount or devmon. > I didn't recognise pmount, mentioned early in the thread, and tried man pmount to check what it would do and how to use it, but nothing came up. So, from an earlier post in the thread, I used dmesg | tail, and then mount at a mount point under /mnt. I used root. TBH, I thought I had to use root to create a mount point under /mnt, but no-one had said that on this thread. And I was able to achieve the transfer of those overnight files onto various machines, which is what I had needed to accomplish. Nevertheless, as you say, I don't really want to use root for this sort of stuff - and other users on our systems definitely shouldn't - so I am going to have a go with these commands and see how to use them. Whether I can arrange, that mounting to a standard point happens automatically, I haven't yet understood. The machine being used for this is a server within arm's reach of the desk so it's convenient to use, but it doesn't run a GUI desktop. Useful summary, Brian, grateful. regards, Ron
[toc] | [prev] | [next] | [standalone]
| From | Jonas Hedman <jonas.hedman@fripost.org> |
|---|---|
| Date | 2016-05-18 21:10 +0200 |
| Message-ID | <rAf0Z-67j-13@gated-at.bofh.it> |
| In reply to | #168037 |
[Multipart message — attachments visible in raw view] — view raw
On 16-05-18 19:10:08, Ron Leach wrote: > I didn't recognise pmount, mentioned early in the thread, and tried man > pmount to check what it would do and how to use it, but nothing came up. > So, from an earlier post in the thread, I used dmesg | tail, and then mount > at a mount point under /mnt. I used root. TBH, I thought I had to use root > to create a mount point under /mnt, but no-one had said that on this thread. > And I was able to achieve the transfer of those overnight files onto various > machines, which is what I had needed to accomplish. > You have to install pmount first, apt-get install pmount, as root. Best regards -- Jonas Hedman XMPP: nstr@nstr.se PGP Key: 0x5c3989e0616bb08c Fingerprint: 8F72 C5BE AAFA B4BA 8F46 9185 5C39 89E0 616B B08C
[toc] | [prev] | [standalone]
Back to top | Article view | linux.debian.user
csiph-web