You are not logged in.

#1 2008-11-21 22:53:00

gazj
Member
From: /home/gazj -> /uk/cambs
Registered: 2007-02-09
Posts: 681
Website

using sdcard as home, moves from sdb1 when a usb drive is hotplugged

I have an asus eee pc.  I use an sd card as /home which udev puts as sdb.

The problem I have is when I insert usb media, the usb becomes sdb and my sdcard moves onto sdc.  You can guess the rest of the problem.

I am guessing I need a udev rule to stop this behaviour.  I have spent the last hour googling and searching the forums (including the 47 page eee pc forum, can't believe no  one has come across this)

Thanks

Offline

#2 2008-11-21 23:01:36

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: using sdcard as home, moves from sdb1 when a usb drive is hotplugged

Use the symlinks in /dev/disk/by-id/

Offline

#3 2008-11-21 23:05:59

gazj
Member
From: /home/gazj -> /uk/cambs
Registered: 2007-02-09
Posts: 681
Website

Re: using sdcard as home, moves from sdb1 when a usb drive is hotplugged

will this link change to sdc when i insert my usb disk?

Offline

#4 2008-11-21 23:16:30

gazj
Member
From: /home/gazj -> /uk/cambs
Registered: 2007-02-09
Posts: 681
Website

Re: using sdcard as home, moves from sdb1 when a usb drive is hotplugged

no it does not seem to, unfortunately sad

Offline

#5 2008-11-21 23:22:18

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: using sdcard as home, moves from sdb1 when a usb drive is hotplugged

How does this not solve the problem?

Offline

#6 2008-11-21 23:33:22

gazj
Member
From: /home/gazj -> /uk/cambs
Registered: 2007-02-09
Posts: 681
Website

Re: using sdcard as home, moves from sdb1 when a usb drive is hotplugged

Sorry I will try to explain it better

when I first boot with my sd card in. I have two entries in /dev/disk/by-uuid, one for my hd and one for my sdcard, the sdcard being symlinked to /dev/sdb.

when I insert a usb stick udev reorganise's my drives so /dev/sdb is the usb stick and /dev/sdc becomes my sdcard

the uuid for my sdcard also dissappears leaving just the uuid for my hd.  So if I mount by uuid this device node will still disappear when I insert a usb stick.

Hope this makes more sense now smile

Thanks for your help so far smile

Offline

#7 2008-11-22 00:17:30

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: using sdcard as home, moves from sdb1 when a usb drive is hotplugged

I see now. So is it really udev that is being evil/stupid?

Anything interesting on dmesg | tail after inserting the USB?

Offline

#8 2008-11-22 00:25:47

gazj
Member
From: /home/gazj -> /uk/cambs
Registered: 2007-02-09
Posts: 681
Website

Re: using sdcard as home, moves from sdb1 when a usb drive is hotplugged

I think udev is working as it was designed to, after all the sd card is removeable media, not a fixed drive.  So I am the one being stupid, lol, using it as if it was a fixed drive.

dmesg goes a bit loopy, with loads of usb errors etc and I lose my home, see below.

usb 1-2: new high speed USB device using ehci_hcd and address 4                                           
usb 1-2: unable to read config index 0 descriptor/all                                                     
usb 1-2: can't read configurations, error -71                                                             
usb 1-2: new high speed USB device using ehci_hcd and address 5                                           
usb 1-2: device descriptor read/64, error -71                                                             
usb 1-2: device descriptor read/64, error -71                                                             
usb 1-2: new high speed USB device using ehci_hcd and address 6                                           
usb 1-2: device descriptor read/all, error -71                                                            
usb 1-2: new high speed USB device using ehci_hcd and address 7                                           
usb 1-2: unable to read config index 1 descriptor/all                                                     
usb 1-2: can't read configurations, error -71                                                             
hub 1-0:1.0: unable to enumerate USB device on port 2                                                     
usb 1-2: new high speed USB device using ehci_hcd and address 8                                           
usb 1-5: reset high speed USB device using ehci_hcd and address 2                                         
usb 1-5: device descriptor read/64, error -71                                                             
usb 1-5: device descriptor read/64, error -71                                                             
usb 1-5: reset high speed USB device using ehci_hcd and address 2                                         
usb 1-5: device descriptor read/64, error -71                                                             
usb 1-5: device descriptor read/64, error -71                                                             
usb 1-5: reset high speed USB device using ehci_hcd and address 2                                         
usb 1-5: device not accepting address 2, error -71                                                        
usb 1-5: reset high speed USB device using ehci_hcd and address 2                                         
usb 1-5: device not accepting address 2, error -71                                                        
sd 2:0:0:0: [sdb] READ CAPACITY failed                                                                    
sd 2:0:0:0: [sdb] Result: hostbyte=0x07 driverbyte=0x00                                                   
sd 2:0:0:0: [sdb] Sense not available.                                                                    
sd 2:0:0:0: [sdb] Write Protect is off                                                                    
sd 2:0:0:0: [sdb] Mode Sense: 00 00 00 00                                                                 
sd 2:0:0:0: [sdb] Assuming drive cache: write through                                                     
sd 2:0:0:0: [sdb] READ CAPACITY failed                                                                    
sd 2:0:0:0: [sdb] Result: hostbyte=0x07 driverbyte=0x00                                                   
sd 2:0:0:0: [sdb] Sense not available.                                                                    
sd 2:0:0:0: [sdb] Write Protect is off                                                                    
sd 2:0:0:0: [sdb] Mode Sense: 00 00 00 00                                                                 
sd 2:0:0:0: [sdb] Assuming drive cache: write through                                                     
sd 2:0:0:0: [sdb] READ CAPACITY failed                                                                    
sd 2:0:0:0: [sdb] Result: hostbyte=0x07 driverbyte=0x00                                                   
sd 2:0:0:0: [sdb] Sense not available.                                                                    
sd 2:0:0:0: [sdb] Write Protect is off                                                                    
sd 2:0:0:0: [sdb] Mode Sense: 00 00 00 00                                                                 
sd 2:0:0:0: [sdb] Assuming drive cache: write through                                                     
Buffer I/O error on device sdb, logical block 0                                                           
Buffer I/O error on device sdb, logical block 1                                                           
Buffer I/O error on device sdb, logical block 2                                                           
Buffer I/O error on device sdb, logical block 3                                                           
Buffer I/O error on device sdb, logical block 0                                                           
sd 2:0:0:0: [sdb] READ CAPACITY failed                                                                    
sd 2:0:0:0: [sdb] Result: hostbyte=0x07 driverbyte=0x00                                                   
sd 2:0:0:0: [sdb] Sense not available.                                                                    
sd 2:0:0:0: [sdb] Write Protect is off                                                                    
sd 2:0:0:0: [sdb] Mode Sense: 00 00 00 00                                                                 
sd 2:0:0:0: [sdb] Assuming drive cache: write through                                                     
sd 2:0:0:0: [sdb] READ CAPACITY failed                                                                    
sd 2:0:0:0: [sdb] Result: hostbyte=0x07 driverbyte=0x00
sd 2:0:0:0: [sdb] Sense not available.
sd 2:0:0:0: [sdb] Write Protect is off
sd 2:0:0:0: [sdb] Mode Sense: 00 00 00 00
sd 2:0:0:0: [sdb] Assuming drive cache: write through
sd 2:0:0:0: [sdb] READ CAPACITY failed
sd 2:0:0:0: [sdb] Result: hostbyte=0x07 driverbyte=0x00
sd 2:0:0:0: [sdb] Sense not available.
sd 2:0:0:0: [sdb] Write Protect is off
sd 2:0:0:0: [sdb] Mode Sense: 00 00 00 00
sd 2:0:0:0: [sdb] Assuming drive cache: write through
sd 2:0:0:0: [sdb] READ CAPACITY failed
sd 2:0:0:0: [sdb] Result: hostbyte=0x07 driverbyte=0x00
sd 2:0:0:0: [sdb] Sense not available.
sd 2:0:0:0: [sdb] Write Protect is off
sd 2:0:0:0: [sdb] Mode Sense: 00 00 00 00
sd 2:0:0:0: [sdb] Assuming drive cache: write through
sd 2:0:0:0: [sdb] READ CAPACITY failed
sd 2:0:0:0: [sdb] Result: hostbyte=0x07 driverbyte=0x00
sd 2:0:0:0: [sdb] Sense not available.
sd 2:0:0:0: [sdb] Write Protect is off
sd 2:0:0:0: [sdb] Mode Sense: 00 00 00 00
sd 2:0:0:0: [sdb] Assuming drive cache: write through

Offline

#9 2008-11-22 01:05:45

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: using sdcard as home, moves from sdb1 when a usb drive is hotplugged

It looks like a hardware fault, right?

Try to insert the USB into another hub, preferably one at the back of the computer.

Offline

#10 2008-11-22 01:43:46

gazj
Member
From: /home/gazj -> /uk/cambs
Registered: 2007-02-09
Posts: 681
Website

Re: using sdcard as home, moves from sdb1 when a usb drive is hotplugged

Huh, tried another usb port and it was fine, brand new lappy aswell.  Hardware is always what I least suspect, but this time it was for sure.

Thanks very very much for all your help smile  Much appreciated.

Offline

#11 2008-11-22 02:24:03

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: using sdcard as home, moves from sdb1 when a usb drive is hotplugged

The UUID (Universally Unique Identifier) should be 'unique'. While it's never guaranteed 100% to be that way, there's very little chance you will encounter identical UUIDs on one system. Instead of using the ID you should use the UUID:


[stijn@hermes ~]$ ls /dev/disk/by-uuid/ -l
totaal 0
lrwxrwxrwx 1 root root 10 nov 20 04:14 88e85208-800e-4c96-bd1d-85f586b6ad29 -> ../../sda7
lrwxrwxrwx 1 root root 10 nov 20 04:14 90994c11-c898-40aa-848b-824d1fc808e6 -> ../../sda6
lrwxrwxrwx 1 root root 10 nov 20 04:14 b24a6695-32a7-4be4-8f7b-f90dc329d932 -> ../../sda5

In your fstab, it gets defined like that:

[stijn@hermes ~]$ grep UUID /etc/fstab
UUID=b24a6695-32a7-4be4-8f7b-f90dc329d932     /             ext3         defaults,noatime     0     1
UUID=90994c11-c898-40aa-848b-824d1fc808e6     /var             reiserfs     defaults,noatime    0     1
UUID=88e85208-800e-4c96-bd1d-85f586b6ad29     /home             ext3         defaults,noatime    0     1
UUID=1a5570ce-e69e-47a5-a902-2ede517deb72    /media/passport        ntfs-3g        rw,user,noauto        0    2

Edit: as for your device renaming problem, I presume this is a problem that appears when you boot with the USB stick inserted? If so, if there is no reason to have it connected during boot, there's a simple solution: not having it plugged in wink. Otherwise you might want to assign a custom device name to your SD card and its partitions, and use that to mount them.

Last edited by B (2008-11-22 02:26:25)


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

Board footer

Powered by FluxBB