3

I have external hard drive box(with external power) with 8TB disk inside it. I added it to /etc/fstab as follows:

/dev/sdc2 /big ext4 rw,nosuid,nodev,relatime,nofail,data=ordered 0 0

The disk dosn't mount during boot. And I can't mount it manualy using sudo mount /dev/sdc2 beacuse I don't see the disk in /dev/.

Please advise me, what should I do in order to mount the disk automatically. The disk can't be seen in lsusb neigher.

What I have already tried:

  1. I tried removing nofail keyword. This causes that during boot I get the following:

Welcome to emergency mode! After logging in, type "journalctl -xb" to view system logs, "systemctl reboot" to reboot, "systemctl default" to try again to boot into default mode.

  1. I tried to replace /dev/sdc2 with UUID=..., but it doesn't have any impact.

  2. I tried turning the disk on and off using physical power button on the disk box. - This helped! The disk appeared in /dev, it was mounted automatically and it appeard in lsusb as:

    Bus 004 Device 002: ID 174c:55aa ASMedia Technology Inc. ASM1051E SATA 6Gb/s bridge, ASM1053E SATA 6Gb/s bridge, ASM1153 SATA 3Gb/s bridge

I plan to use the computer with the disk remotely, so I need that it is mounted automatically and not manualy by turingn the switch on and off.

Thanks in advance.

EDIT2: I use the following hardware:

External box AKASA AK-TL3SEB-BK Lokstor X31, 3,5"

HDD Seagate Archive, 3,5", SATAIII, 128MB - 8TB

laptop Lenovo IdeaPad U410

EDIT3: I believe that external box was defective. I did tried to connect the enclosure to USB2.0 and it didn't work at all, I tried to connect the enclosure to other computers and to computer with windows and it didn't work. I thank to @LDJames, for his suggestion in comments, that the enclosure might be broken and for his suggestion to buy new enclosure. I brought new one and everything works perfectly. I marked his answer as accepted and I am very greatful.

2 Answers2

2

It's possible the device isn't available during the boot process. You can address your real concern by having the disk available by adding a script to start it to your /etc/rc.local file... a file which is automatically run after the system comes up.

Just make a script such as /usr/local/bin/mountdrive.sh and add that line to the /etc/rc.local file.

/usr/local/bin/mountdrive.sh:

#!/bin/bash
mount /dev/sdc2

Alternatively, to avoid getting the already mounted error you could use this in your mountdrive.sh file:

#!/bin/bash
mountpoint -q /big && mount /big

Results of testing your fstab entry:

I attached a USB Seagate 4 Gig Drive and used the exact entry and got success. After this I modified the entry to use the UUID in case the drive specification changes. You can get the UUID of your /dev/sda1 partition with:

$ lsblk -o name,mountpoint,label,size,uuid,fstype

This is the modified fstab line that also works:

UUID=2a14ecf1-e4f6-45fb-8cb7-5c5317e3189e /big ext4 rw,nosuid,nodev,relatime,nofail,data=ordered 0 0
L. D. James
  • 25,036
  • Thank you. Your advice would be correct if everything is as I described. But I realized that I don't see the device in /dev/ and that I can't mount it using mount /dev/sdc. I am editing my question right now. – trebor33 Sep 08 '16 at 12:07
  • @trebor33 Are you saying the drive's power switch turns off when you reboot your computer and doesn't come back on until you physically turn it on by the switch? – L. D. James Sep 08 '16 at 12:12
  • Yes, that is what happens. Sorry, that I descried the symptoms wrong in the question now the symptoms in question should be correct. – trebor33 Sep 08 '16 at 12:22
  • @trebor33 You'll have to communicate with the manufacturer's support channel to get instructions for the behavior of the drives on and off state. I can assist in research if you will specify the make and model number of the drive. – L. D. James Sep 08 '16 at 12:24
  • @LDJames Where I can find these numbers? I found the name of HDD and of the box how they were called on the e-shop. I added these names to the question. – trebor33 Sep 08 '16 at 12:42
  • Check your BIOS-settings, maybe disable fastboot, with fastboot enabled USB may not fully initialized. I have some settings related to this in my BIOS. – mook765 Sep 08 '16 at 12:52
  • @trebor33 I'll see what I can find concerning the drive. In the meantime you could ask a separate question on http://superuser.com about how to control the drive state of that specific hardware... or drives that has a hardware switch... in conjunction with mook765's suggestion. – L. D. James Sep 08 '16 at 12:54
  • @mook765 The related computer is a laptop. There are almost no options I can set in bios setup: goo.gl/4RhaaK – trebor33 Sep 08 '16 at 13:08
  • @mook765 lenovo Ideapad U410 – trebor33 Sep 08 '16 at 13:18
  • @mook765 It's unlikely the problem is with the computer... I'm sure it lies within the drive the usb device that is connecting the drive. – L. D. James Sep 08 '16 at 13:22
  • @trebor33 I believe I see the drive, I believe it's the https://www.amazon.com/Seagate-Archive-6GBps-128MB-ST8000AS0002/dp/B00XS423SC . Now I'm looking for what has this switch you have to click. The drive I'm looking at doesn't have a switch. – L. D. James Sep 08 '16 at 13:24
  • Is this the enclosure? http://www.tntrade.cz/akasa-ak-tl3seb-bk-lokstor-x31-external-enclosure-3-5-hdd-sata_d204181.html?action=setlng&lngid=1& – L. D. James Sep 08 '16 at 13:26
  • @LDJames Yes, yes. Both pictures (drive and enclosing box) look very similar to what I have. You did even find the enclosure on webpage of the eshop where I have it from. – trebor33 Sep 08 '16 at 13:31
  • @mook765 He has also mentioned, to my understanding, that he sometimes have to turn it off and on to make the bios see it. This appears to be a fault in the enclosure hardware. My analysis of the situation is that the hardware is defective. I would suggest, if it's new, to get an exchange, or to get support from the vendor. – L. D. James Sep 08 '16 at 13:42
  • @mook765 Unfortunately, I was mistaken at first and I wasn't clear. But I find out that I can't mount the drive later without swiching it on and of by hardware swich. – trebor33 Sep 08 '16 at 13:43
  • @trebor33 Is it possible you can test a different USB drive enclosure... a pen drive? Verify that it will auto-mount every time on bootup. Unless the external device is turned off, it should stay available. – L. D. James Sep 08 '16 at 13:44
  • It is not "sometimes" but it is "always". I need to always turn it on and off after ubuntu booted and before mounting. – trebor33 Sep 08 '16 at 13:45
  • I'll summarize these details in the answer later. But I'm certain the problem lies with the enclosure. You can probably test the enclosure on a different computer. If you don't have to turn it off on a different computer, than you could suspect a problem with your Laptop or it's configuration. Also, it'll cost about $20.00 to buy a new enclosure, which could also help you to verify whether it's the enclosure or not. I'm used many different computers and many different sata to USB adapters and have never experienced this. – L. D. James Sep 08 '16 at 13:50
  • @LDJames I ordered new enclosure and I will test it tommorow and we will see it it helps. – trebor33 Sep 08 '16 at 13:53
  • Amazon carries USB enclosures new for about $20.00 and used for nearly half that. – L. D. James Sep 08 '16 at 13:53
  • @mook765 The noauto-option edit you made to my answer would be counterproductive to the OP's objective. He wants it to auto-mount. Also, I just tested the fstab entry from his question with the exact setup using his exact line. The only difference is the USB-to-IDE I used and the size, in my case which is 4 Gigs. It works flawlessly as intended. – L. D. James Sep 08 '16 at 16:09
  • @mook765 The purpose of the batch script was to avoid having to type it in, in case if failed... of which with the faulty usb enclosure, it always fail. Since the enclosure if problematic, since the user has to be at the console during each reboot to turn it off and turn it on, he'll most likely replace (or fix the USB problem), then have a working fstab entry. By the way, thanks for catching the spelling typo in the answer. – L. D. James Sep 08 '16 at 16:25
  • @mook765 The user isn't trying to hotswap the drive. He's trying to make it a fixed part of his environment so that he can work on it remotely. It's plugged in when he turns the computer on, or reboots the computer. If for some reason, he removes the USB drive, he would be aware to have to use the mount command, of which he has clearly indicated he uses at present with present condition of the USB hardware. You I would investigate why your system doesn't recognize the usb devices during boot. That could possibly be a problem. – L. D. James Sep 08 '16 at 16:42
  • @L.D.James Enclosure was in fact defective (see my edit 3). Buying new one solved the problem. Thank you very much! – trebor33 Sep 09 '16 at 08:58
0

If you are looking for mounting during boot the other answer by L. D. James and the subsequent comments are the right way to go. However if you wish to automatically mount the drive whenever possible I.e. whenever it is available you need to do two things

  • Use the auto option in the mount options in fstab

  • Use the device mapped using uuid like this /dev/disks/by-uuid/《device uuid》 This will lead to the device usually being mounted whenever you log in.

Notes:

  • When using an external usb device the sda sdb sdc stuff keeps changing so that method will keep failing frequently.

  • If you keep your external device powered on independent of your laptop it might go into sleep mode to conserve power. That would explain the behavior you are seeing.

Sunny
  • 61
  • I'm wondering why the external drive only goes into sleep mode when the system is rebooted. – L. D. James Sep 08 '16 at 15:41
  • The system powers down all usb ports when it is rebooting or turing off, that would typically trigger the power down. Also happens with my 2tb wd external hdd. – Sunny Sep 09 '16 at 08:32