Unmount and park HDD?

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Author Message
PavelVD
DD-WRT User


Joined: 26 Jul 2019
Posts: 115

PostPosted: Sun Feb 18, 2024 18:19    Post subject: Unmount and park HDD? Reply with quote
Tell me, what command will unmount and park HDDs connected to USB? If you need to turn off the power. The router is located high on the cabinet and it is difficult to use the "USB-->USB Support-->Use SES Button to Remove Drives" button.
I tried poweroff, halt and shutdown - they didn't work. Embarassed
Thank you.

_________________
Linksys WRT1900ACSv2
Automatically adjustable temperature, always within the range of 48-53°С.
Sponsor
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 3110
Location: Germany

PostPosted: Sun Feb 18, 2024 19:13    Post subject: Reply with quote
First of all, all programs that access the hard disk must be closed, otherwise it cannot be unmounted properly.

You can also try deactivating USB support in the menu.
Or you can use a robust file system.

_________________
Quickstart guides:
use Pi-Hole as simple DNS-Server with DD-WRT
VLAN configuration via GUI - 1 CPU port
VLAN configuration via GUI - 2 CPU ports (R7800, EA8500 etc)

Routers
Marvell OCTEON TX2 - QHora-322 - OpenWrt 23.05.3 - Gateway
Qualcomm IPQ8065 - R7800 - DD-WRT - WAP
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 6522
Location: UK, London, just across the river..

PostPosted: Sun Feb 18, 2024 20:40    Post subject: Reply with quote
use shutdown script to save your stop services and unmount commands it works ok….
_________________
Atheros
TP-Link WR740Nv1 ---DD-WRT 56941 WAP
TP-Link WR1043NDv2 -DD-WRT 56941 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 56941 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 57447 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 57200 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
PavelVD
DD-WRT User


Joined: 26 Jul 2019
Posts: 115

PostPosted: Sun Feb 18, 2024 20:40    Post subject: Reply with quote
Thanks! Does the "Use SET Button to Remove Drives" button execute any commands?
_________________
Linksys WRT1900ACSv2
Automatically adjustable temperature, always within the range of 48-53°С.
lexridge
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 1266
Location: WV, USA

PostPosted: Mon Feb 19, 2024 5:08    Post subject: Reply with quote
While you can unmount the USB HDD from a script, you cannot "park" it from stock DDWRT. You would need Entware with something like hdparm installed, I believe. I do this on my Linux computer's backup drive which is a USB ext4 formatted drive. I mount via UUID to do a backup (automatically of course), it does the backup. Unmounts the drive, sets it to read only then spins it down. I wrote the script in this way in an attempt to prevent ransomware from possibly getting to my backup drive, if I were to ever contract one that is.
_________________
- Linksys EA8500: I-Gateway, AP/VAP 5ghz only r56820: Features: WDS-AP, VLANs, Samba, WG, Entware
- Linksys EA8500: WDS Station x2 - r56941
- Netgear R6400v2: WAP/VAP 2.4ghz only w/VLANs over single trunk port. r56820
- Netgear R7800 (WDS-AP, WAP/VAP) - r56820: Features in use: multiple VLANs over single trunk port
- Linksys MR7350: Testing r56941
- Linksys Velop WHW03v1 x2: OpenWRT w/GRETAP tunnel for VLANs on VAPs
- OSes: Fedora 38, 9 RPis (2,3,4,5), 20 ESP8266s: Straight from Amiga to Linux in '94, never having owned a Windows PC.

- Forum member #248
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 3110
Location: Germany

PostPosted: Mon Feb 19, 2024 10:41    Post subject: Reply with quote
It is not said that it works.
There is a USB SATA bridge in the enclosures and many of these controllers do not support the pass-through of ATA commands.

_________________
Quickstart guides:
use Pi-Hole as simple DNS-Server with DD-WRT
VLAN configuration via GUI - 1 CPU port
VLAN configuration via GUI - 2 CPU ports (R7800, EA8500 etc)

Routers
Marvell OCTEON TX2 - QHora-322 - OpenWrt 23.05.3 - Gateway
Qualcomm IPQ8065 - R7800 - DD-WRT - WAP
mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 1889
Location: Hung Hom, Hong Kong

PostPosted: Mon Feb 19, 2024 14:40    Post subject: Re: Unmount and park HDD? Reply with quote
PavelVD wrote:
Tell me, what command will unmount and park HDDs connected to USB? If you need to turn off the power. The router is located high on the cabinet and it is difficult to use the "USB-->USB Support-->Use SES Button to Remove Drives" button.
I tried poweroff, halt and shutdown - they didn't work. Embarassed
Thank you.

hdparm should be the usual suspect! Some external hard disks might have built-in inactivity timeout aka sleep.

linux stop harddisk - Google Search
https://www.google.com/search?q=linux+stop+harddisk

_________________
Router: Asus RT-N18U (rev. A1)

Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
GitHub: https://github.com/changmw/changmw
UnicornStallion
DD-WRT User


Joined: 31 Dec 2023
Posts: 59
Location: Iowa, US

PostPosted: Thu Feb 22, 2024 20:44    Post subject: Reply with quote
I believe that most modern mechanical hard disks that have S.M.A.R.T. technology--which is basically all mechanical hard disks you might still be using--automatically park themselves when they lose power (using the kinetic energy stored in the platters and rotating spindle as it spins down.) Software parking an HDD is obsolete.
_________________
- Netgear R7800 -- OpenWRT 23.05.2
- Cellular modem with CGNAT
- SMB NAS with multiple users and private directories.
- USB hard disk plugged into router as NAS drive.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum