Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 28 Aug 2014, 05:15
All times are UTC - 4
 Forum index » House Training » Bugs ( Submit bugs )
212,213b USB flash names not retained in Pmount, Univ Inst
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 10 of 10 [144 Posts]   Goto page: Previous 1, 2, 3, ..., 8, 9, 10
Author Message
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7047
Location: Perth, Western Australia

PostPosted: Tue 19 Jun 2007, 08:24    Post subject:  

Also, can it be further qualified? The code I posted above will read the first 512 bytes of every partition, and the first 512 bytes of drives without partitions. But, in the case of drives with partitions, for example hda with hda1, hda2, etc., isn't it enough to just read the 512 bytes of hda?
Back to top
View user's profile Send private message Visit poster's website 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7047
Location: Perth, Western Australia

PostPosted: Tue 19 Jun 2007, 09:01    Post subject:  

I've modified it so the dd runs on the first 512 bytes of the drives (except cd/dvd), not any partitions. Attached.
probepart-bk4.gz
Description 
gz

 Download 
Filename  probepart-bk4.gz 
Filesize  1.09 KB 
Downloaded  312 Time(s) 
Back to top
View user's profile Send private message Visit poster's website 
Jesse

Joined: 08 May 2005
Posts: 465
Location: Auckland, NZ

PostPosted: Tue 19 Jun 2007, 19:01    Post subject:  

Hi Barry,

I just tried your bk4 script with my test, and it is back to the old tricks.

(start with 32MB)
sh-3.00# ./probepart-bk4 | grep sdb
/dev/sdb|vfat|62592
(swap to 256MB)
sh-3.00# ./probepart-bk4 | grep sdb
/dev/sdb|ext3|510464
sh-3.00# ./probepart-bk4 | grep sdb
/dev/sdb1|vfat|509992
(back to 32MB)
sh-3.00# ./probepart-bk4 | grep sdb
/dev/sdb1|none|509992
sh-3.00# ./probepart-bk4 | grep sdb
/dev/sdb|vfat|62592

To be perfectly honest, regarding your #1 and #2 points, I have no idea, I was just trying 'best guess' combinations until I came across a set that worked.

Jesse
Back to top
View user's profile Send private message 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7047
Location: Perth, Western Australia

PostPosted: Wed 20 Jun 2007, 07:50    Post subject:  

Jesse, do you have USB2? I can't duplicate the problem you report. I have tried to swap the usb drives quickly and rerun probepart immediately (the old version before your fix) but I don't get that problem. What I do get is a delay. It seems when I remove a drive, /proc gets updated immediately, but when I plug in a drive there is a delay before it registers in /proc.

So, if I unplug a drive and immediately rerun probepart, no sda drive shows up at all. I wait a second or two, rerun probepart and get the correct sda drive.

So, your fixes don't seem to be doing anything for me. The delay from when a drive is plugged in to registering in /proc seems to be more a function of the usb interface, the time it takes for a pen drive to respond to a query and provide its particulars.

I've been thinking of workarounds, but it doesn't help that you get a different problem, of the previous drive particulars persisting in /proc after the drive is removed. I wonder why I don't have that problem?
Back to top
View user's profile Send private message Visit poster's website 
Jesse

Joined: 08 May 2005
Posts: 465
Location: Auckland, NZ

PostPosted: Wed 20 Jun 2007, 20:14    Post subject:  

Hi Barry,

Sorry I should have explained what my test was in a little more detail!
Yes, I have been doing my test case on USB2, and I have just now tried it on USB1.1 and I have the same issue.
You are probably using fully self contained USB drives, which makes all the difference, as there is a hot-plug event with the USB host adapter that lets the kernel know that something has been added or changed.
I am using a "USB Card Reader" which stays plugged into the USB, but the media is removable, removing/inserting the media does not generate a usb-hot-plug event and there is no directly caused kernel update of /proc files.

example of self-contained usb drive:
http://ps.synnex.co.nz/images/FM/50974.jpg

example of compact flash removable media:
http://www.eoneonline.co.nz/site/e-one3/images/items/CF1GBKingston.jpg

example of Card Reader (overkill):
http://www.geeks.com/details.asp?invtid=OM-URH725&cat=FLM

example of Card Reader (just like my one):
http://www.geeks.com/details.asp?invtid=INT-AIN1-C&cat=FLM

Over here in NZ, new computers seem to get an internal card reader instead of a floppy drive, from what I have seen. I think it makes sense.

With my reported problem, there is no need to be quick about swapping the CF media, if you wait 10 seconds or 0.5 seconds the /proc files are the same.
I hope that helps clear up what the issue is Smile

Jesse
Back to top
View user's profile Send private message 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7047
Location: Perth, Western Australia

PostPosted: Wed 20 Jun 2007, 23:09    Post subject:  

I wonder, if you were to execute 'fdisk -l' after swapping the cards, does that force an update in /proc? ...or does fdisk only read what's in /proc?
Back to top
View user's profile Send private message Visit poster's website 
Jesse

Joined: 08 May 2005
Posts: 465
Location: Auckland, NZ

PostPosted: Thu 21 Jun 2007, 03:38    Post subject:  

Hi Barry,

sorry "fdisk -l" does not identify the new media correctly.

Jesse
Back to top
View user's profile Send private message 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7047
Location: Perth, Western Australia

PostPosted: Thu 21 Jun 2007, 20:51    Post subject:  

Jesse, could you try the same thing with 'disktype /dev/sda'?

'disktype' does a direct read of the hardware I think, so may force an update of /proc.
Back to top
View user's profile Send private message Visit poster's website 
Jesse

Joined: 08 May 2005
Posts: 465
Location: Auckland, NZ

PostPosted: Thu 21 Jun 2007, 21:24    Post subject:  

Hi Barry,

This idea works for when the media changes, but if you remove the media and scan it, it disapears from /proc/partitions, you'll need to rescan the device node listed from /proc/diskstats to get it back into the /proc/partitions when there is a medium present:

Code:
(start with 32MB)
sh-3.00# cat /proc/partitions | grep sdc
   8    32      31296 sdc
(swap to 256MB)
sh-3.00# disktype /dev/sdc

--- /dev/sdc
Block device, size 249.3 MiB (261357568 bytes)
DOS partition map
Partition 1: 249.0 MiB (261115904 bytes, 509992 sectors from 56, bootable)
  Type 0x06 (FAT16)
  FAT16 file system (hints score 5 of 5)
    Volume size 248.8 MiB (260841472 bytes, 63682 clusters of 4 KiB)
    Volume name ""
Ext3 file system
  UUID 5E93D6C6-44E3-4732-8D25-FB1CCDB7D88E (DCE, v4)
  Volume size 249.3 MiB (261357568 bytes, 255232 blocks of 1 KiB)

sh-3.00# cat /proc/partitions | grep sdc
   8    32     255232 sdc
   8    33     254996 sdc1
(swap back to 32MB)
sh-3.00# cat /proc/partitions | grep sdc
   8    32     255232 sdc
   8    33     254996 sdc1
sh-3.00# cat /proc/partitions | grep sdc
   8    32     255232 sdc
   8    33     254996 sdc1
sh-3.00# disktype /dev/sdc

--- /dev/sdc
Block device, size 30.56 MiB (32047104 bytes)
FAT16 file system (hints score 5 of 5)
  Volume size 30.49 MiB (31967232 bytes, 15609 clusters of 2 KiB)
  Volume name ""

sh-3.00# cat /proc/partitions | grep sdc
   8    32      31296 sdc
(remove /dev/sdc media)
sh-3.00# cat /proc/partitions | grep sdc
   8    32      31296 sdc
sh-3.00# disktype /dev/sdc

--- /dev/sdc
disktype: Can't open /dev/sdc: No medium found

sh-3.00# cat /proc/partitions | grep sdc
sh-3.00# cat /proc/partitions           
major minor  #blocks  name

   7     0      67144 loop0
   7     1     524288 loop1
   7     3       8524 loop3
   7     4      61236 loop4
  22    64   78150744 hdd
  22    65    4096543 hdd1
  22    66    6136830 hdd2
  22    67    2859570 hdd3
  22    68          1 hdd4
  22    69     771088 hdd5
  22    70    8570646 hdd6
  22    71   55030626 hdd7
  22    72     682731 hdd8
   8     0  156290904 sda
   8     1   66557263 sda1
   8     2    2048287 sda2
sh-3.00#
sh-3.00# disktype /dev/sdc

--- /dev/sdc
disktype: Can't open /dev/sdc: No medium found

(insert 256MB)
sh-3.00# cat /proc/partitions | grep sdc
sh-3.00# cat /proc/diskstats | grep sdc
   8   32 sdc 159 94 2024 2480 0 0 0 0 0 1950 2480
sh-3.00# disktype /dev/sdc

--- /dev/sdc
Block device, size 249.3 MiB (261357568 bytes)
DOS partition map
Partition 1: 249.0 MiB (261115904 bytes, 509992 sectors from 56, bootable)
  Type 0x06 (FAT16)
  FAT16 file system (hints score 5 of 5)
    Volume size 248.8 MiB (260841472 bytes, 63682 clusters of 4 KiB)
    Volume name ""
Ext3 file system
  UUID 5E93D6C6-44E3-4732-8D25-FB1CCDB7D88E (DCE, v4)
  Volume size 249.3 MiB (261357568 bytes, 255232 blocks of 1 KiB)

sh-3.00# cat /proc/diskstats | grep sdc
   8   32 sdc 175 97 2176 2730 0 0 0 0 0 2130 2730
   8   33 sdc1 0 0 0 0
sh-3.00# cat /proc/diskstats | grep sdc
   8   32 sdc 175 97 2176 2730 0 0 0 0 0 2130 2730
   8   33 sdc1 0 0 0 0
sh-3.00# cat /proc/partitions | grep sdc
   8    32     255232 sdc
   8    33     254996 sdc1
sh-3.00# ./probepart-bk4 | grep sdc
/dev/sdc1|vfat|509992
(remove /dev/sdc media)
sh-3.00# ./probepart-bk4 | grep sdc
/dev/sdc1|none|509992
sh-3.00# ./probepart-bk4 | grep sdc
/dev/sdc|none|0
/dev/sdc1|none|0
sh-3.00# ./probepart-bk4 | grep sdc
/dev/sdc|none|0
/dev/sdc1|none|0
sh-3.00# cat /proc/partitions | grep sdc
sh-3.00# ./probepart-bk4 | grep sdc
/dev/sdc|none|0
/dev/sdc1|none|0
sh-3.00# cat /proc/diskstats | grep sdc
   8   32 sdc 178 106 2272 2790 0 0 0 0 0 2190 2790
   8   33 sdc1 8 64 0 0
sh-3.00# disktype /dev/sdc

--- /dev/sdc
disktype: Can't open /dev/sdc: No medium found

sh-3.00# cat /proc/diskstats | grep sdc
   8   32 sdc 178 106 2272 2790 0 0 0 0 0 2190 2790
   8   33 sdc1 8 64 0 0
sh-3.00# cat /proc/partitions | grep sdc
(insert 32MB)
sh-3.00# cat /proc/diskstats | grep sdc
   8   32 sdc 178 106 2272 2790 0 0 0 0 0 2190 2790
   8   33 sdc1 8 64 0 0
sh-3.00# cat /proc/partitions | grep sdc
sh-3.00# disktype /dev/sdc

--- /dev/sdc
Block device, size 30.56 MiB (32047104 bytes)
FAT16 file system (hints score 5 of 5)
  Volume size 30.49 MiB (31967232 bytes, 15609 clusters of 2 KiB)
  Volume name ""

sh-3.00# cat /proc/partitions | grep sdc
   8    32      31296 sdc
sh-3.00# cat /proc/diskstats | grep sdc
   8   32 sdc 188 107 2360 2950 0 0 0 0 0 2290 2950
sh-3.00# ./probepart-bk4 | grep sdc
/dev/sdc|vfat|62592
sh-3.00#


I hope all that helps!

Jesse
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 10 of 10 [144 Posts]   Goto page: Previous 1, 2, 3, ..., 8, 9, 10
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Bugs ( Submit bugs )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0868s ][ Queries: 13 (0.0112s) ][ GZIP on ]