You are not logged in.

#1 2019-02-28 11:38:50

yangkeao
Member
Registered: 2019-02-28
Posts: 1

Can I unplug hard disk where I run root partition for a while?

My laptop has only one type-c USB, and I installed my system in a portable hard drive. To use an external monitor and hard drive at the same time, I have to plug it in Dell DA300 mobile adapter and plug in the adapter into my laptop. However, when I want to move my laptop, I have to shutdown and then unplug the adapter and hard drive. Then plug hard drive directly into my laptop. And then boot again.

Can I use some way to avoid this shutdown and boot? It's interesting smile

Last edited by yangkeao (2019-02-28 11:39:07)

Offline

#2 2019-02-28 11:54:06

null
Member
Registered: 2009-05-06
Posts: 398

Re: Can I unplug hard disk where I run root partition for a while?

You could just hibernate to disk or put your root partition into RAM. But the latter one needs to be flushed back to disk again explicitly or all changes will be lost.

Offline

#3 2019-02-28 23:45:38

mich41
Member
Registered: 2012-06-22
Posts: 796

Re: Can I unplug hard disk where I run root partition for a while?

Well, besides the obvious solutions
1. avoid laptops with only one port (who even makes such horrible things?)
2. avoid root on USB

I think not much can be done. When you unplug and plug a disk, Linux assumes that it may have been modified in the mean time or it may be a different (identical) disk altogether and it isn't going to simply keep using it as if nothing happened because that could easily lead to data corruption. Instead, the old filesystem is still mounted but without ability to read/write to disk, only data still remaining in RAM caches are available. And you can mount the new filesystem separately like any other removable memory.

A certain exception is the USB persist feature. However, it only works during suspend (either sleep or hibernation). So you would enable USB persist for that drive, put the machine to sleep, disconnect it, connect it back, resume from sleep and everything would be back. But I don't think it's going to work in your case, because that adapter probably contains a USB hub and so Linux would notice that the disk isn't in the same port it used to be and grow suspicious that it may be some different disk again.

Offline

#4 2019-03-01 00:39:03

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,462
Website

Re: Can I unplug hard disk where I run root partition for a while?

mich41 wrote:

avoid laptops with only one port (who even makes such horrible things?)

Apple.

My work provided macbook has two usb-c ports and nothing else.  One is for the power, and it is so close to the second, that you cant plug a usb-c to usb adapter into the other port.  So when I needed to briefly test something with an external mouse, I had to unplug the power to even be able to plug in the mouse (and the same gymnastics would be required to plug in a flash drive).


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2019-03-01 05:50:22

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,455

Re: Can I unplug hard disk where I run root partition for a while?

No worries if it is about Apple. Just use wireless harddisk with airdrop and airboot and charge using aircharge smile.
That one port is going to disappear soon.

Offline

Board footer

Powered by FluxBB