USB Disk no longer has correct drive ID

Status
Not open for further replies.

andymemo

Dabbler
Joined
Jun 2, 2011
Messages
29
Hi,

Following an update to my main ZFS storage pool resulting in a couple of reboots, I seem to have inadvertently some how broken my USB attached storage (1TB Lacie Drive)! From the WebGUI, the under Storage > View All Volumes I get an error for /mnt/Lacie which states Used = None (Error), Available = Error getting available space, Size = Error getting total space. When I select to 'View Drives' I see Serial = Unknown, Name = da1p2, Group Membership = Lacie (Stripe). Running the gpart show, camcontrol devlist & zpool status -v I get the following:
--------------------------
[root@meemo-nas] ~# gpart show
=> 63 15794100 da1 MBR (7.5G)
63 1930257 1 freebsd [active] (943M)
1930320 63 - free - (32K)
1930383 1930257 2 freebsd (943M)
3860640 3024 3 freebsd (1.5M)
3863664 41328 4 freebsd (20M)
3904992 11889171 - free - (5.7G)

=> 34 3907029101 ada0 GPT (1.8T)
34 94 - free - (47K)
128 4194304 1 freebsd-swap (2.0G)
4194432 3902834703 2 freebsd-zfs (1.8T)

=> 34 3907029101 ada1 GPT (1.8T)
34 94 - free - (47K)
128 4194304 1 freebsd-swap (2.0G)
4194432 3902834703 2 freebsd-zfs (1.8T)

=> 34 3907029101 ada2 GPT (1.8T)
34 94 - free - (47K)
128 4194304 1 freebsd-swap (2.0G)
4194432 3902834703 2 freebsd-zfs (1.8T)

=> 34 3907029101 ada3 GPT (1.8T)
34 94 - free - (47K)
128 4194304 1 freebsd-swap (2.0G)
4194432 3902834703 2 freebsd-zfs (1.8T)

=> 0 1930257 da1s1 BSD (943M)
0 16 - free - (8.0K)
16 1930241 1 !0 (943M)

[root@meemo-nas] ~# camcontrol devlist
<ST32000641AS CC13> at scbus0 target 0 lun 0 (ada0,pass0)
<ST2000DM001-9YN164 CC4C> at scbus1 target 0 lun 0 (ada1,pass1)
<WDC WD20EARS-00MVWB0 51.0AB51> at scbus2 target 0 lun 0 (ada2,pass2)
<SAMSUNG HD204UI 1AQ10001> at scbus3 target 0 lun 0 (ada3,pass3)
<LaCie BigDisk Extreme+ 3.AA> at scbus6 target 0 lun 0 (pass4,da0)
<HP c320w 0.00> at scbus7 target 0 lun 0 (da1,pass5)
[root@meemo-nas] ~# zpool status -v
pool: Storage
state: ONLINE
scrub: none requested
config:

NAME STATE READ WRITE CKSUM
Storage ONLINE 0 0 0
raidz1 ONLINE 0 0 0
ada0p2 ONLINE 0 0 0
ada2p2 ONLINE 0 0 0
ada1p2 ONLINE 0 0 0
ada3p2 ONLINE 0 0 0

errors: No known data errors
--------------------------

From my simplistic understanding of drive names/ID's... the webGUI shows the Lacie storage is expected on disk da1p2 yet when I review the output of camcontrol devlist I see the USB Lacie is at da0.

Option 1 is fingers crossed someone can help me on the forum.
Option 2 is rebuild my FreeNAS config from scratch and import the working 'Storage' pool, then recreate all my shares.

I've attached some screen captures for further info and would appreciate it if anyone could help me here.

Thanks,
Andy
Disk info.jpg Log output.jpg Volume Overview.jpg
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Hi Andy,

This is generally why it's a bad idea to create pools with USB devices. I'm about to head off to bed, but if you take a look at my blog post below, you might be able to figure out how to change da0 to da1 in the database, which will fix your problem. Be sure to make a backup of your config before making changes just to be safe.

See the section on Resetting The Database

http://protosd.blogspot.com/2011/12/useful-commands-for-diagnosingmanaging.html
 

andymemo

Dabbler
Joined
Jun 2, 2011
Messages
29
Hi protosd,

Thank you for your prompt response! I've been through your blog (very useful!) and managed to manipulate the database to use the correct reference for the disk. Initially I had a little trouble as the USB drive was appearing as da0 so I edited the database to reference da0. After a reboot, the USB drive appeared as da1! So, I had to re-edit the database to reference da1. After a 2nd reboot and reviewing the settings, the USB drive appears as da1 and the database is looking for da1. However it would seem my issue still exists and im not really any further along :s

FYI, my FreeNAS setup is mainly used for storing data in the internal SATA drives. My NAS is built in a small ITX case with 4 bays. I had a spare 1TB USB, so I plumbed this into my NAS as a simple place to store iso's, system images, installs etc without using space off my main storage pool :)

I've attached the full log from my efforts if you wanted to look through. Is my best option at this point to follow option 2 - rebuild & import data?

Thanks,
Andy
 

Attachments

  • freenas-cli-1.txt
    11.4 KB · Views: 266
  • freenas-cli-2.txt
    13.7 KB · Views: 290

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
I've attached the full log from my efforts if you wanted to look through. Is my best option at this point to follow option 2 - rebuild & import data?

Thanks,
Andy

Andy,

Even if you rebuild you're going to run into the same problem again if you reboot. Looking at your first log I think I see where you went wrong:

sqlite> update storage_disk set disk_name='da0' where disk_name='da1p2';

You basically said substitute "da0" for "da1p2". You also needed to include the partition "p2" at the end of "da0" or "da0p2".

So now your database has "da0" where it should have "da0p2". To fix that you would type:

update storage_disk set disk_name='da0p2' where disk_name='da0';

You'll have to look at your database again to be sure what it's at currently and make sure you have the correct old/new names.


Unfortunately this will continue to be a cat and mouse game unless you get lucky during a reboot and the USB disk comes up with the same name...

-- Proto
 

andymemo

Dabbler
Joined
Jun 2, 2011
Messages
29
Hey Proto,

So I took options 2 and rebuilt the OS - hardly a labour-sum task as I have 2 shares in CIFS & AFP, ssh and UPS configured plus 5 users. Now the system is up and running with my main ZFS pool (SATA) imported and my USB Lacie working again.

I appreciate what you are saying that a USB device *could* change its drive ID, but for the last 18months+ of my setup this hasn't happened (over numerous restarts), maybe because the system is static and the USB drive doesn't move USB ports?

Before wiping the system, I did try to delete the 2nd pool (USB drive / ID=2) from the database, this worked in that the pool was removed from the Web GUI... but then the internal (SATA) pool seemed to be affected! Even though the volume manager showed the SATA pool as healthy, when i clicked 'view disks' there were only 3 of the 4 disks shown and all 3 had 'unknown' for the serial! So something in the DB clearly screwed itself.

Thanks for your help and direction with this though.

Cheers,
Andy
 
Status
Not open for further replies.
Top