WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Command to update /mnt for USB drives inserted?  (Read 4583 times)

Offline jonathanbrickman0000

  • Jr. Member
  • **
  • Posts: 71
    • PC TSC:  Easily turn a PC into a terminal server client
Command to update /mnt for USB drives inserted?
« on: November 26, 2010, 11:03:31 PM »
Is there a straightforward built-in, for updating /mnt and /etc/fstab when USB and other removable drives are inserted? 

J.E.B.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Command to update /mnt for USB drives inserted?
« Reply #1 on: November 26, 2010, 11:30:00 PM »
There is rebuildfstab, but I doubt it would be required to be manually run when USB storage gets attached.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline jonathanbrickman0000

  • Jr. Member
  • **
  • Posts: 71
    • PC TSC:  Easily turn a PC into a terminal server client
Re: Command to update /mnt for USB drives inserted?
« Reply #2 on: November 26, 2010, 11:49:10 PM »
And for some reason, rebuildfstab isn't doing any of it -- my USB stick registers in 'blkid' as /dev/sdb, but rebuildfstab doesn't put a line in /etc/fstab for it, and it also doesn't create a /mnt item either.  I made sure 'filesystems', fuse, ntfs-3g, and dosfstools were installed, just in case.

J.E.B.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Command to update /mnt for USB drives inserted?
« Reply #3 on: November 27, 2010, 12:13:42 AM »
Can you post relevant part of 'fdisk -l' ?

dosfstools are not strictly required in order to mount, but you could use mtools to manipulate a vfat partition without any need to mount.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Command to update /mnt for USB drives inserted?
« Reply #4 on: November 27, 2010, 12:31:02 AM »
Only partitions will be recognized, not baredrives.
You should be using a partitioned USB drive.

Offline jonathanbrickman0000

  • Jr. Member
  • **
  • Posts: 71
    • PC TSC:  Easily turn a PC into a terminal server client
Re: Command to update /mnt for USB drives inserted?
« Reply #5 on: November 27, 2010, 12:45:41 AM »
Only partitions will be recognized, not baredrives.
You should be using a partitioned USB drive.

No, I should not be using a partitioned USB drive.  My users will be inserting USB flash drives right out of packages, and many of them come unpartitioned, and Windows Server 2008 does not, by default, partition them either.

J.E.B.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Command to update /mnt for USB drives inserted?
« Reply #6 on: November 27, 2010, 01:11:50 AM »
Only partitions will be recognized, not baredrives.
You should be using a partitioned USB drive.

No, I should not be using a partitioned USB drive.

Says who? Can you post any references to support such a claim?

What exactly do you mean by:

Quote
Windows Server 2008 does not, by default, partition them either.

Partitioning storage devices is in the responsibility and according to choice of users, I can not think of how an OS would have a default of partitioning or not.
« Last Edit: November 27, 2010, 01:17:27 AM by tinypoodle »
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Command to update /mnt for USB drives inserted?
« Reply #7 on: November 27, 2010, 02:16:31 AM »
This post says it all:

http://forum.tinycorelinux.net/index.php?topic=6663.msg34904#msg34904

Searching the forum for existing posts before opening threads can be helpful   ;)
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline jonathanbrickman0000

  • Jr. Member
  • **
  • Posts: 71
    • PC TSC:  Easily turn a PC into a terminal server client
Re: Command to update /mnt for USB drives inserted?
« Reply #8 on: November 27, 2010, 09:42:15 AM »
Actually, I had seen that thread, and it was not helpful.  Posts were correct -- USB sticks very often come from the factory without partitions, including the one I bought yesterday for testing -- but the thread does not give a way to easily prepare the OS to mount such devices, which exist by the millions, which my users and others need to use immediately without wiping everything on them, partitioning, reformatting, and recopying. 

I am happy that the blkid command works to show that the filesystem exists.  Obviously a fairly straightforward path exists for the needed scripting.

What is the process to submit a replacement 'rebuildfstab' ?

J.E.B.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Command to update /mnt for USB drives inserted?
« Reply #9 on: November 27, 2010, 02:17:05 PM »
Hard drives come from the factory without partitions too.
Not showing unpartitioned USB drives was an intentional decision, not an oversight.

Offline jonathanbrickman0000

  • Jr. Member
  • **
  • Posts: 71
    • PC TSC:  Easily turn a PC into a terminal server client
Re: Command to update /mnt for USB drives inserted?
« Reply #10 on: November 27, 2010, 02:32:44 PM »
Intentional decision by whom?  Who decided to ignore the needs of the vast majority of users of USB sticks?  And why?

People do not use hard drives without partitions.  People do use USB sticks without partitions, and routinely, and very very often. 

J.E.B.

Frank

  • Guest
Re: Command to update /mnt for USB drives inserted?
« Reply #11 on: November 27, 2010, 06:30:42 PM »
Intentional decision by whom?  Who decided to ignore the needs of the vast majority of users of USB sticks?  And why?

To call this bug an "intentional decision" is not very accurate. Instead it started as an unintended side-effect -- as a mistake that was never corrected. Here is the history:

  • September 1, 2009: bmarkus notes that automatically created device mountpoints such as /mnt/sda are confusing if you have partitions on the device, and get /mnt/sda1, /mnt/sda2, etc. in addition.
  • November 1, 2009: bmarkus notes that unneeded mountpoints are also created for extended partitions.
  • November 15, 2009: roberts announces TC 2.6 RC 1. The changelog states "Updated rebuildfstab to drop extra mount points."
  • December 14, 2009: Bug reports come in, stating that TC 2.6.1 no longer detects unpartitioned pendrives.

The changelog for v2.6 RC 1 makes the original intention of the change very clear: this is about removing unneeded mountpoints; a merely cosmetic change. It is not meant to introduce a new policy whereby USB sticks must be partitioned from now on. The bug report leads to the same conclusion. Note that roberts first requests the output of "fdisk -l", and then completely misinterprets said output. It is very obvious that he did not expect the 2.6 changes to make unpartitioned USB sticks unusable. But in fact they did, and that is what we have still today.


Offline jonathanbrickman0000

  • Jr. Member
  • **
  • Posts: 71
    • PC TSC:  Easily turn a PC into a terminal server client
Re: Command to update /mnt for USB drives inserted?
« Reply #12 on: November 27, 2010, 06:34:09 PM »
That sounds a whole lot more like the Tiny Core team I have come to know and love *grin*  OK.  I have had a good look at the code in rebuildfstab, and unless I am much mistaken, it looks like the whole kaboodle is right there.  Is this correct? 

I am probably going to try my hand at adding to it, but it is really elegant code right now, and I am not sure my skills are up to it.

J.E.B.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Command to update /mnt for USB drives inserted?
« Reply #13 on: November 27, 2010, 06:36:51 PM »
I never said unpartitioned disks were unusable.
I said they are not automatically recognized ( added to /mnt andfstab ).
You can still create mount points, and mount the drive.

I am just stating facts.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Command to update /mnt for USB drives inserted?
« Reply #14 on: November 27, 2010, 08:25:49 PM »
I never said unpartitioned disks were unusable.
I said they are not automatically recognized ( added to /mnt andfstab ).
You can still create mount points, and mount the drive.

I am just stating facts.

A web search would show that the status quo of many Linux distros wrt this aspect is similar.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)