How To Mount an External Hard Drive on Linux Without UAS/SCSI (smartctl on Seagate drive)
Vložit
- čas přidán 21. 08. 2024
- In this video, I show you how to mount an external hard drive on Linux without the UAS (USB attached SCSI) kernel module.
This might be needed on Seagate drives which use UASP (USB attached SCSI protocol) in order to successfully mount them on some systems or read the SMART data from the drive using a program like smartmontools.
USB attached SCSI is the new module used on supported drives to help accelerate file transfers. To mount a drive without UAS, the core step is to unload the usb-storage and uas modules, and re-add the kernel with the quirk to not use the uas module for your hard drive.
This is required to either read smart data from the drive, but more importantly, I had issues in the past where drives using UAS weren't being mounted properly and would throw errors when accessing files.
See my page on this subject for the exact commands!
wiki.tonytasci...
The commands used in the video are on my website at wiki.tonytasci... under the Linux Scripts section.
This video is available under a CC-BY-NC-SA license on Peertube.
Watch this video on Peertube: peertube.tonyt...
Thanks for Watching!
Produced by Tony Tascioglu
tonytascioglu.com
Great video. Is there any difference when there is some data that I need to keep on the same external drive? How do I map the ext drive including the files on it?
Whether there's data on the device shouldn't matter as UASP just changes how data is transferred across as either basic USB mass storage or using the SCSI protocol. You would mount an external drive with files on it in the same way if you don't want UASP support.
Thanks Tony! One thing you missed is which kernel module(s) it IS using in this mode? And what kind of performance difference there is, if any? That'd be a great follow up :-)
Great question!
My understanding is it uses the more standard mass storage driver rather then uas. It's still handled by the usb_storage module though.
As for performance, that's an SMR drive, so it's performance is pretty terrible after the cache fills up. From my simple test using dd to write and read a block file to that drive, it's within margin of error with and without UAS. Most 5400 RPM drives can't exceed ~150 MB/s, and most external drives are shipping with SMR drives these days anyway. That being said, another thing to note is that USB is a shared bus. If you are writing to 2 external drives for example, the bandwidth has to be shared.
On another note, if you are using an NTFS partition on a faster drive, from my testing on a 7200 RPM drive, NTFS-3G is the bottleneck usually capping at around 100 MB/s. If you don't need Windows support, ext4 or xfs or btrfs are all faster, I've tested around 200 MB/s for a large block file I made with dd.
If I find had an external SSD, then we'd probably see a more substantial difference though given the rise of M.2 SSDs using NVMe, I'm not sure if they use the standard usb storage stack.
@@TonyTascioglu SMR! Euuugh, yuck :-D Right now the only two external drives I trust aside from a collection of quality thumb drives are a Seagate Ironwolf Pro non-SMR 4TB in an Orico USBC 3.1 case using the newer version of the chipset in the older versions of those seagates (I had one die recently, I wonder if it was SMR, I'll have to look it up and get back to you). And an Orico USBC M2 enclosure that I KNOW is fast, but I didn't look at what it was using to connect, nor did I measure HOW fast it was. It just worked. I used it to DD copy an entire OS encrypted from the OEM Samsung 500GB in my Lenovo X1 Carbon to a new 1TB Samsung Evo Plus (without setting the block size first, fail) before swapping it over. NTFS isn't a bad file system, but it can die in a fire. Especially when used natively with Winblows. ext4 these days for large externals, though I started on ext2 when you were probably years from being born :-D PS, nice little website you've got going there. Don't forget to have fun while you're young, though :)
Yeah I've avoided SMR drives since that one. I honestly thought it was busted at first since it was running at
@@TonyTascioglu I'm not sure how that little enclosure works, but perhaps the drives themselves have the capability to fall back to sata like it can fall back to earlier pcie v2 from v3 or v3 from v4 etc. 100% for sure it was bandwidth capped through the USB 3.1 interface but it was still fast enough for me :-)
You're correct about kernel ram caching of file copies. You could tune that out if you wanted real data. I find it especially annoying to get a false reading from tools that give you a data rate and then they taper back down toward reality and you have to estimate where reality is as it's still decaying back down on the moving average. This sort of thing is both especially noticeable and even more useful with a lot of RAM. This machine has 32GB in it (hoping to upgrade before I get ZFS running in it) and when I got it I was doing some large-file copies from/to external devices and it literally ate the entire 32 up and could dump all that data out at bus speed :-D
Which version of ZFS were you running then? And what type of vdev and other config did you have? Avoiding dataloss is why I'm going that way along with a bunch of other features many of which I intend to use, some from the start, others longer term.
I still remember feeling excited about kernel 2.6 :-) That was a BIG improvement over earlier Kernels. Back in those days I actually compiled my own fairly regularly. I saw the config screen in a YT video the other day and got all nostalgic :-D 2.2 - > 2.4 and 2.4 -> 2.6 were both great upgrades and bumpy rides as many of the kernel interfaces were changing so it made distro upgrades super challenging. When you cut your teeth doing hard stuff like that, doing what I did in a few hours last night is cake:
out of date jessie to up to date
up to date jessie to stretch
up to date stretch to buster
swap 32 bit kernel for 64 bit kernel
carefully and painstakingly swap about half of ~1000 packages to amd64 from i386 (rest still to go)
finally able to install latest docker (64 bit only), done
mysql 5 to mariadb 10 - all good
php i386 5 to php amd64 7.3 and boom, my out of date software stopped working correctly
and today updated the crusty software 3 major version steps and all working again minus legacy style that is not available for latest version :-D
Easy! Compared to a 2.4-2.6 boundary debian major release dist-upgrade back in the day :-D
I don't think I've compiled a kernel for about 10 years at this point, that's how good it's become :-) I should do a lean one for giggles some time.
That's a lot of Debian versions you kept that install going for! I usually end up having to do a fresh install within 2 years (distrohopping doesn't help either...)
I'm impressed it hasn't run into any errors before it stopped after the php upgrade. Even not having breaking database changes is not always a given!
IIRC, Since Jessie has been systemd so at least one redeeming point is that you didn't need to change up all the init scripts, still I imagine it's a pain to switch so many programs from x86 to amd64...
The ZFS data loss was probably 95% since I didn't know how I should be setting up vdevs. Pretty sure it was on 2x 300GB 2.5" laptop drives I salvaged from my old laptop and a portable one.
I only really switched to Linux after kernel 4 (and the Windows 10 business), probably around the 4.4 LTS, though I did have Ubuntu 14.04 as a live system on a DVD for experimenting.
I've only compiled the kernel twice, once to install Gentoo because why not, and another to test some mainline kernel feature, I think because either X11 or the touchpad was bugged with the stable release but fixed in the previous and dev versions.
Awesome! Thank u!
Thanks, glad it helped!
After reinstalling Smartctl and unning ls block I get this "/dev/sdc: Unknown USB bridge [0x0bc2:0xab56 (0x1708)]
Please specify device type with the -d option.
Use smartctl -h to get a usage summary
" Now what do I do?
Hm - I haven't encountered this one before. Does it show up properly as a WD/Seagate/Toshiba/etc under `lsusb`?
Hey what can I do if I got excited cause it worked then accidentally did it with it plugged in?
If it was plugged in, it shouldn't remove the usb-storage module if it's in use (unless you added a -f). Even then, it should be no worse then suddenly unplugging power to the drive, so as long it wasn't reading/writing something actively, and you're using a journaled file system, you should be fine
Hi, great video!!!!, i have an issue with a seagate external drive barracuda expansion, when i connect to linux , generates a loop tryin to recognize the hdd, and generates /dev/sda sdb sdc sdd sde .... etc all of those, for only one usb hdd conection. Please i have difficuties to solve this error-loop, can you helpme? thanks
hm. Could it be that the drive isn't getting enough power and is power-cycling? I had something vaguely similar with a portable drive. Usually if a drive disconnects and reconnects quickly, then it'll cause Linux to go through the sda, sdb...
I'd also try both a USB 2 and USB 3 port (or ports on different controller), sometimes they can be a bit finnicky. Finally, do you know if the drive actually works? Do you have another computer or OS to try to see if it works there?