USB drive is ALWAYS busy when persistence partition mounted

Questions about hardware, drivers and peripherals
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
linx255
Level 5
Level 5
Posts: 668
Joined: Mon Mar 17, 2014 12:43 am

USB drive is ALWAYS busy when persistence partition mounted

Post by linx255 »

- Mint 17 Mate 64-bit
- 64Gb 3.0 USB drive w/ two partitions, both ext4, one for OS, the other for data, no data loaded on to either, drive is completely blank

I notice that when I plug in my USB drive the "busy" LED light blinks endlessly ( will not stop ever ) until I unmount the persistence partition or physically remove the drive. It does not seem to matter whether or not the other partition is mounted. Once I even tried to eject it from caja and it said "The device is busy".

( Oh REALLY ? Doing WHAT exactly ?? I'm not doing anything, not running any programs from the device or any programs that should even be interacting with it. It should not be busy for any reason as far as I'm concerned. Maybe for a few seconds here and there but not indefinitely like this. )

Erasing the partitions and re-formatting does not stop it.

Is my USB drive or PC possessed by an evil spirit? Maybe I have a case of badUSB? Why busy with one partition and not the other? Is my drive somehow corrupted? Writing and reading data still works.

Thanks
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
- I'm running Mint 18 Mate 64-bit
- 4.15.0-34-generic x86_64
- All my bash scripts begin with #!/bin/bash
Buzzsaw
Level 6
Level 6
Posts: 1318
Joined: Sat Aug 23, 2014 12:53 pm

Re: USB drive is ALWAYS busy when persistence partition moun

Post by Buzzsaw »

After formatting a volume with the ext4 filesystem, by default, the first time it is mounted the inodes and journal will be 'initialized'. This means that they will be overwritten with nulls. This happens at a low rate (~4MB/s on my 500GB USB 2.0 drive) and can take well over an hour for a large volume. This is probably the activity you're noticing.

Once the inodes and journal have been initialized, the activity stops for good.

If you don't like this behaviour, you can prevent it by formatting the volume using the command line, and including the string:

Code: Select all

-E lazy_itable_init=0,lazy_journal_init=0
This will cause the initialization to be done during the filesystem creation stage, rather than after the volume is first mounted. It makes the filesystem creation process take slightly longer, but not much longer, because initialization done during filesystem creation is much faster than if it's done after the volume is first mounted. On my 500GB drive, the rate is increased to over 100MB/s.
User avatar
linx255
Level 5
Level 5
Posts: 668
Joined: Mon Mar 17, 2014 12:43 am

Re: USB drive is ALWAYS busy when persistence partition moun

Post by linx255 »

I've had this drive a long time; I don't remember noticing this before. Dang, it would be nice to have an indicator on the screen explaining that. :lol: For one, it was confusing. Two, not all my USB drives have LED indicators so if it's performing an important post-format task and I yanked it out it might have damaged the drive...

I don't know what to do with:

Code: Select all

-E lazy_itable_init=0,lazy_journal_init=0
but I disabled the journal with:

Code: Select all

sudo tune2fs -O ^has_journal /dev/sdb2
and it still continues to blink endlessly. Oh wait, now it's only blinking for a 2-second duration every 9 seconds. ( Still there's nothing running I know of that's supposed to be accessing the drive at this time. ) Hm.. :?:
- I'm running Mint 18 Mate 64-bit
- 4.15.0-34-generic x86_64
- All my bash scripts begin with #!/bin/bash
Buzzsaw
Level 6
Level 6
Posts: 1318
Joined: Sat Aug 23, 2014 12:53 pm

Re: USB drive is ALWAYS busy when persistence partition moun

Post by Buzzsaw »

not all my USB drives have LED indicators so if it's performing an important post-format task and I yanked it out it might have damaged the drive...
That's why having a disk input/output indicator on your desktop is useful. I use the one included with Conky.

By the way, it won't damage a drive if initializing is stopped before it's finished.
I disabled the journal
Not recommended.
I don't know what to do...
It's easy to format a volume using the command line:
1. Create an empty partition using GParted (this is optional; a partition is not necessary if you want to use the whole drive as one volume).
2. Execute this command:

Code: Select all

sudo mke2fs -m 1 -E lazy_itable_init=0,lazy_journal_init=0,root_owner=1000:1000 -v -L name -t ext4 /dev/sdxy
Here's an explanation of various parts of the command:
-m 1 : Use 1% of the volume for the journal instead of the default 5%.
-E : Extended options.
lazy_itable_init=0,lazy_journal_init=0 : Initialize the inodes and journal immediately, instead of after the first mount.
root_owner=1000:1000 : Set the root owner of the filesystem to uid:gid -- you can find your user id / group id from the 'id' command. If you use root_owner=1000:1000, you won't have to chown the volume after formatting it.
-v : Verbose operation.
-L name : The name you want to give the volume.
/dev/sdxy : The raw device or partition to format.
-t ext4 : format using the ext4 filesystem.
User avatar
linx255
Level 5
Level 5
Posts: 668
Joined: Mon Mar 17, 2014 12:43 am

Re: USB drive is ALWAYS busy when persistence partition moun

Post by linx255 »

Great, thanks for breaking it down for me.

I disabled journaling to see if it would stop the 'initialization' that it never informed me was going on. Strange the OS doesn't indicate via a window or whatever program is formatting, that intialization will continue on after formatting is completed. If initialization is incomplete maybe that would explain why I was getting 'mv: inter-device' errors trying to move directories on the drive just after formatting. I'm guessing it's best to wait for it to complete before using the drive, huh?

Not to digress entirely, but since you don't recommend disabling journaling here, I must, out of insatiable Linux curiosity and laziness for creating a new topic, lol, discuss some things: I don't think I'll ever use my machine to do anything so fancy or experimental that my system could get so messed up to the point of needing to recover the journal. Most of the time Linux will repair damaged system files with update, and the cause of 99% my problems are identified with basic debugging or this forum, and if still no solution then I just disk dump an image of a stable OS, overwriting the old, and walla, everything's phat again, which is why for semi-lay geeks like me I don't understand why journaling is necessary...

I mean, I'm not a Linux / systems developer / debugger, and I'm not running a server or a warehouse full of servers, nor using old and decrepit hard drives ( state-of-the-art SSD, in fact ). Isn't journaling generally intended for critical applications? Does journaling provide any real benefit for me? ( i.e. security ) I've even cold booted or powered down in the middle of things plenty of times ( though I try to avoid ) and very rarely does anything bad ever happen. The strange thing is when I used to have journaling enabled there was one event ( me tampering with a file I shouldn't have been ) that screwed up my system so badly it could not even be repaired. It would just boot into a black screen with funny characters top to bottom and then hang. The system did nothing to attempt a repair nor give me any options to do so. Re-installation was the only option.

So, what's the point?

OK that was a complete digression, sorry, lol.
- I'm running Mint 18 Mate 64-bit
- 4.15.0-34-generic x86_64
- All my bash scripts begin with #!/bin/bash
Buzzsaw
Level 6
Level 6
Posts: 1318
Joined: Sat Aug 23, 2014 12:53 pm

Re: USB drive is ALWAYS busy when persistence partition moun

Post by Buzzsaw »

Initialization after the volume is first mounted happens in the background, and you're not supposed to notice. You're meant to be able to read from / write to the drive while it is happening. That's why initialization is much slower after the volume is mounted.

Journaling is useful if you have a power failure (doesn't really apply to laptops), or if your computer freezes, forcing you to do a hard reboot without unmounting any volumes. Also it's useful if you have to remove an external drive without unmounting it.
Locked

Return to “Hardware Support”