Find the answer to your Linux question:
Results 1 to 3 of 3
Hi all, I am working on an embedded Linux system and want to get a clue what I have done wrong. I have a box with an internal and an ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie dilbert's Avatar
    Join Date
    Sep 2006
    Location
    Yorkshire, GB
    Posts
    237

    Mechanism for assigning SCSI device names


    Hi all,

    I am working on an embedded Linux system and want to get a clue what I have done wrong.

    I have a box with an internal and an external harddrive.

    Both drives are formatted with ext3 and the internal drive is sda (i.e. sda1, ..., sda4) and the external drive is sdb (i.e. sdb1, sdb2).

    The Linux version in this box is 2.6. and removing the external Hard drive and inserting it again always gives sdb. The same way behaves a Feodara Red Hat PC (also 2.6.).

    Adding new features, I managed to break this. With my software, when I remove the external hard drive, being sdb, I am getting sdc when I insert it again.

    I thought, this is because the external hard drive may have not been unmounted before pulled out but unmounting it manually on the command line doesn't help either.

    Any thoughts?
    Bus Error: Passengers dumped. Hech gap yo'q.

  2. #2
    Linux Guru Jonathan183's Avatar
    Join Date
    Oct 2007
    Posts
    3,045
    What does mount and cat /etc/mtab report?
    Any clues from dmesg?

    uuid might work for you instead ...

  3. #3
    Linux Newbie dilbert's Avatar
    Join Date
    Sep 2006
    Location
    Yorkshire, GB
    Posts
    237
    Quote Originally Posted by Jonathan183 View Post
    What does mount and cat /etc/mtab report?
    Well, the embedded version of mount in that box might have been somewhat misleading as after "umount /dev/sdb", manually executed on the command line, I got no error message and the mount point disappeared when I called "mount".

    I found the error and it was a missing close(device) statement.

    When I read the partition table from the external hard drive, I opened the device but didn't close it.

    Pulling out the USB cable from the harddrive, the "umount" command in the disconnecting software couldn't succeed but I saw no error message.
    As "umount" failed, /dev/sdb couldn't be released.
    Hotplug couldn't re-use sdb and needed to assign sdc instead.

    So, there wasn't anything mysterious with hotplug, no hidden "mechanism", it was simply not freeing the device.
    Bus Error: Passengers dumped. Hech gap yo'q.

  4. $spacer_open
    $spacer_close

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •