How to spin off definitely hard drive

Non release banter
benjibasson
Samurai
Samurai
Posts: 141
Joined: 06 Mar 2019, 15:14
Distribution: Arch linux

How to spin off definitely hard drive

Post#1 by benjibasson » 09 Feb 2023, 08:08

Hi,
I use to boot porteus with changes=EXIT to copy change to ram, and copy2ram options to copy all modules and /mnt/live/memory/images/changes to ram. that mean that hard drive should never bee waken up neither busy when I unmount all and swapoff all.

I would like to spin off the drive sda so I

Code: Select all

swapoff /mnt/sda6/swapfile.swap
umount every partitions from /dev/sda1 to /dev/sda7

I use succesfull

Code: Select all

umount -l /dev/sda6 

Code: Select all

root@porteus:/home/guest# umount /dev/sda6
umount: /mnt/live/memory/images/changes: target is busy.
root@porteus:/home/guest# umount -l /dev/sda6
root@porteus:/home/guest# umount /dev/sda6
umount: /dev/sda6: not mounted.
do an

Code: Select all

hdparm -Y /dev/sda
unfortunaly, each time I launch an application copyed2ram it start the hard drive
in othercase the hard drive restart after 5 minutes ( max) for noground ( led stay off)
=> in every case the hard drive never stop more than 5 minutes

how to stop the hard drive for hours and hours?

Cheers

beny
Full of knowledge
Full of knowledge
Posts: 2092
Joined: 02 Jan 2011, 11:33
Location: italy

How to spin off definitely hard drive

Post#2 by beny » 09 Feb 2023, 13:33

take a look to cheatcode noauto and nohd to hidden harddisk from copy2ram at boot time

benjibasson
Samurai
Samurai
Posts: 141
Joined: 06 Mar 2019, 15:14
Distribution: Arch linux

How to spin off definitely hard drive

Post#3 by benjibasson » 09 Feb 2023, 20:16

Hi
I boot from /dev/sda6 => when I boot with nohd option I have a Kernel panic.

Code: Select all

2.2528221 Kernel panic not syncing: WES: Unable to mount root is on enke
un-block(8.0)
2.2529831 Kernel Offset: disabled
2.2532981-- end Kernel panic not syncing: VFS: Unable to mount root is on unknown-black(8,8) 1
FUITSU
2023.02.09 21:03
is there a way to know who wake up my hard drive when no software need to do it (copy2ram, noauto and change:EXIT should make ZERO trafic on the /dev/sda?) and every 5 minutes the HDD move on Fujitsu whereas on the Too Style-Note this clowned porteus doesn't wake /dev/sda at all.

User avatar
Ed_P
Contributor
Contributor
Posts: 8361
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

How to spin off definitely hard drive

Post#4 by Ed_P » 09 Feb 2023, 22:03

Just because changes=EXIT cheatcode doesn't write until shutting down it doesn't mean it doesn't access the save.dat file when booting to ensure it exists and is writable. Trust me, it does.

An option I use is once desired changes are made and saved in the save.dat file, I copy the /changes/save.dat file to the /modules folder and rename it save.dat.xzm then boot without the changes=EXIT cheatcode. I have 2 boot menus, changes mode and safe mode.
Ed

benjibasson
Samurai
Samurai
Posts: 141
Joined: 06 Mar 2019, 15:14
Distribution: Arch linux

How to spin off definitely hard drive

Post#5 by benjibasson » 10 Feb 2023, 18:49

Hi

I'm using /change folder on ext4 partition. I believe change:EXIT copy to ram because I have only few available space in /home than if I boot without the :exit options.
more over, without exit hardrive make a lot of noise and vlink like christmas tree in case I write, CP or load webpage

Going to create 999change.xzm znd replace change= by load=999
but: what to do if I boot to safe mode work, and I'm aware that it is a desired changes?


=> the replacement of change option by module doesn't work because it start again the rotation of sda after 10 minutes.

Code: Select all

root@porteus:/home/guest/Documents/config-open-vpn# umount /dev/sda6
umount: /mnt/sda6: target is busy.
root@porteus:/home/guest/Documents/config-open-vpn# swapon 
NAME                    TYPE      SIZE USED PRIO
/dev/zram0              partition 1.8G   0B  100
/mnt/sda6/swapfile.swap file      5.9G   0B   -2
root@porteus:/home/guest/Documents/config-open-vpn# swapoff /mnt/sda6/swapfile.swap
root@porteus:/home/guest/Documents/config-open-vpn# umount /dev/sda6
root@porteus:/home/guest/Documents/config-open-vpn# hdparm -Y /dev/sda6

/dev/sda6:
 issuing sleep command
root@porteus:/home/guest/Documents/config-open-vpn# uptime #grrr it start again with no reason ( I did nothing )
 19:13:57 up 12 min,  0 users,  load average: 0.92, 0.76, 0.57
root@porteus:/home/guest/Documents/config-open-vpn# mount
tmpfs on /mnt/live type tmpfs (rw,relatime,mode=755,inode64)
proc on /mnt/live/proc type proc (rw,relatime)
sysfs on /mnt/live/sys type sysfs (rw,relatime)
none on /mnt/live/dev type devtmpfs (rw,relatime,size=1912600k,nr_inodes=478150,mode=755,inode64)
tmpfs on /mnt/live/memory/changes type tmpfs (rw,relatime,size=842808k,inode64)
aufs on / type aufs (rw,relatime,si=1ab62cb63c5f4299,nowarn_perm)
/mnt/live/memory/copy2ram/000-kernel.xzm on /mnt/live/memory/images/000-kernel.xzm type squashfs (ro,relatime,errors=continue)
/mnt/live/memory/copy2ram/001-core.xzm on /mnt/live/memory/images/001-core.xzm type squashfs (ro,relatime,errors=continue)
/mnt/live/memory/copy2ram/002-xorg.xzm on /mnt/live/memory/images/002-xorg.xzm type squashfs (ro,relatime,errors=continue)
/mnt/live/memory/copy2ram/002-xtra.xzm on /mnt/live/memory/images/002-xtra.xzm type squashfs (ro,relatime,errors=continue)
/mnt/live/memory/copy2ram/003-xfce.xzm on /mnt/live/memory/images/003-xfce.xzm type squashfs (ro,relatime,errors=continue)
/mnt/live/memory/copy2ram/011-slapt-get-0.11.6-x86_64-2gv.xzm on /mnt/live/memory/images/011-slapt-get-0.11.6-x86_64-2gv.xzm type squashfs (ro,relatime,errors=continue)
/mnt/live/memory/copy2ram/07-printing-lxde-lxqt-openbox-xfce-x86_64-2022-04-09.xzm on /mnt/live/memory/images/07-printing-lxde-lxqt-openbox-xfce-x86_64-2022-04-09.xzm type squashfs (ro,relatime,errors=continue)
/mnt/live/memory/copy2ram/07-printing-x86_64-2022-07-02.xzm on /mnt/live/memory/images/07-printing-x86_64-2022-07-02.xzm type squashfs (ro,relatime,errors=continue)
/mnt/live/memory/copy2ram/LibreOffice-7.4.2-x86_64-fr-1bl.xzm on /mnt/live/memory/images/LibreOffice-7.4.2-x86_64-fr-1bl.xzm type squashfs (ro,relatime,errors=continue)
/mnt/live/memory/copy2ram/firefox-106.0.2-x86_64-fr.xzm on /mnt/live/memory/images/firefox-106.0.2-x86_64-fr.xzm type squashfs (ro,relatime,errors=continue)
/mnt/live/memory/copy2ram/nano-6.0-x86_64-1.xzm on /mnt/live/memory/images/nano-6.0-x86_64-1.xzm type squashfs (ro,relatime,errors=continue)
/mnt/live/memory/copy2ram/remmina-1.4.27-x86_64-1-alldesktops.xzm on /mnt/live/memory/images/remmina-1.4.27-x86_64-1-alldesktops.xzm type squashfs (ro,relatime,errors=continue)
/mnt/live/memory/copy2ram/signal-desktop-bin-5.62.0-x86_64-1cf.xzm on /mnt/live/memory/images/signal-desktop-bin-5.62.0-x86_64-1cf.xzm type squashfs (ro,relatime,errors=continue)
/mnt/live/memory/copy2ram/yt-dlp-2022.10.04-noarch-1ncm.xzm on /mnt/live/memory/images/yt-dlp-2022.10.04-noarch-1ncm.xzm type squashfs (ro,relatime,errors=continue)
/mnt/live/memory/copy2ram/999-changes.xzm on /mnt/live/memory/images/999-changes.xzm type squashfs (ro,relatime,errors=continue)
devtmpfs on /dev type devtmpfs (rw,relatime,size=1912600k,nr_inodes=478150,mode=755,inode64)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
tmpfs on /dev/shm type tmpfs (rw,relatime,inode64)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,relatime,mode=755,inode64)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
tmpfs on /sys/fs/cgroup type tmpfs (rw,nosuid,nodev,noexec,size=4096k,nr_inodes=1024,mode=755,inode64)
cgroup on /sys/fs/cgroup/elogind type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib64/elogind/elogind-cgroups-agent,name=elogind)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=383092k,nr_inodes=95773,mode=700,uid=1000,gid=100,inode64)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=100)
every partitions are really unmounted
I used copy2ram, noswap, noauto in this session
Image



nb, I have the same problem on always fresh mode base_only nomagic norootcopy copy2ram noauto noswap :shock: always ten minutes for fujitsu laptop

User avatar
Ed_P
Contributor
Contributor
Posts: 8361
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

How to spin off definitely hard drive

Post#6 by Ed_P » 10 Feb 2023, 22:00

benjibasson wrote:
10 Feb 2023, 18:49
I'm using /change folder on ext4 partition.
Changes= still checks to see if it is writable when booting.

Added in 7 hours 26 minutes 48 seconds:
benjibasson wrote:
10 Feb 2023, 18:49
nb, I have the same problem on always fresh mode base_only nomagic norootcopy copy2ram noauto noswap always ten minutes for fujitsu laptop
No changes=EXIT also?

Can you post the boot menu you used?
Ed

benjibasson
Samurai
Samurai
Posts: 141
Joined: 06 Mar 2019, 15:14
Distribution: Arch linux

How to spin off definitely hard drive

Post#7 by benjibasson » 11 Feb 2023, 05:46

usualy boot option

Code: Select all

menuentry "porteus  on sda3 xfce"{
set root=(hd0,3)
linux /porteus64bit_v50/boot/syslinux/vmlinuz from=/dev/sda3/porteus64bit_v50 changes=EXIT:/porteus64bit_v50/change resume=/dev/sda3 resume_offset=4268032 login=guest copy2ram ramsize=14% zram=43% noswap
initrd /porteus64bit_v50/boot/syslinux/initrd.xz
}

it wake up every 10 minutes

safe mode

Code: Select all

menuentry "porteus  on sda3 xfce safe mode"{
set root=(hd0,3)
linux /porteus64bit_v50/boot/syslinux/vmlinuz from=/dev/sda3/porteus64bit_v50 load=999 resume=/dev/sda3 resume_offset=4268032 login=guest copy2ram ramsize=14% zram=43% noswap
initrd /porteus64bit_v50/boot/syslinux/initrd.xz
}
it wake up the hdd every 10 minutes

always fresh

Code: Select all

menuentry "porteus  on sda3 xfce always fresh mode copy2ram"{
set root=(hd0,3)
linux /porteus64bit_v50/boot/syslinux/vmlinuz from=/dev/sda3/porteus64bit_v50  login=guest copy2ram ramsize=14% zram=43% noswap base_only norootcopy nomagic copy2ram
initrd /porteus64bit_v50/boot/syslinux/initrd.xz
}
IT WAKE UP THE HDD IN ALWAYS FRESH MODE every 10 minutes :cry:

User avatar
Ed_P
Contributor
Contributor
Posts: 8361
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

How to spin off definitely hard drive

Post#8 by Ed_P » 11 Feb 2023, 07:10

For Always Fresh try this vmlinuz line.

Code: Select all

linux /porteus64bit_v50/boot/syslinux/vmlinuz  copy2ram
Just the copy2ram cheatcode.

When the system is booted what is it doing before the HDD starts up? Are you sure the sound is the hard drive and not a fan?
Ed

benjibasson
Samurai
Samurai
Posts: 141
Joined: 06 Mar 2019, 15:14
Distribution: Arch linux

How to spin off definitely hard drive

Post#9 by benjibasson » 11 Feb 2023, 12:06

Hi
When the system is booted with only copy2ram the hard drive make high-pitched sound
I umount all success
I hdparm -y
=> Total Silent
I do nothing at all
After 2 minutes fan noise blow with extra Bass sounds
After 5 minutes total silent
After 7 minutes fan
9 minutes total silent
10 minutes the hard drive start make high-pitched sound. And the fan is't blowing and I can see the stoped blade
10 minutes and 20 second an clic ( hdd's head park)
As soon I repeat hdparm -Y : Total silent.
I brows through the internet, social network...
And ten minutes later it start again...


I make difference between fan and this hdd's noise

User avatar
Ed_P
Contributor
Contributor
Posts: 8361
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

How to spin off definitely hard drive

Post#10 by Ed_P » 11 Feb 2023, 17:24

:hmmm:

What does hdparm -B /dev/sda show? Does hdparm -M help?

When you use hdparm -Y do you have /dev/sda added to it?

What's on /dev/sda1 and sda2? :%)

Is the HDD connected to any other systems remotely?

I found this to be an interesting link: https://wiki.archlinux.org/title/Hdparm
Ed

benjibasson
Samurai
Samurai
Posts: 141
Joined: 06 Mar 2019, 15:14
Distribution: Arch linux

How to spin off definitely hard drive

Post#11 by benjibasson » 11 Feb 2023, 18:58

Hi,
I took the other laptop PC this week => will do manipulations on Friday night...

To answer the sda2 is windows 10 partition
Sda1 I don't know but we need it to make windows, oem, reinstall windows7 oem from dvd...
In fact I have bought this laptop

Hdd is always inside the fujitsu laptop a second hand,
Create sda6 to install Ubuntu dual boot
And because this hdd is slow, installed Porteus in multiboot.

Code: Select all

hdparm -Y /dev/sda

/dev/sda:
 issuing sleep command
Today I have 2 laptop with the same Porteus linux and they don't have exactly the same behavior:
My first pc bought on PCubuntoo spin down definitely until I mount or exit save change
Whereas the Fujitsu access to the hdd every 10 minutes

=> Can the bios do that?

User avatar
Ed_P
Contributor
Contributor
Posts: 8361
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

How to spin off definitely hard drive

Post#12 by Ed_P » 12 Feb 2023, 00:04

benjibasson wrote:
11 Feb 2023, 18:58
=> Can the bios do that?
Good question. Along with many more. :D

On the laptop with the problem, does the problem occur when it is booted to Windows or another Linux system?

There is a Porteus command or 2 that tells what the system is doing, unfortunately I don't remember what it is called. :( Hopefully a user with a better memory will post what the options are for viewing active tasks, and watching RAM usage.
Ed

benjibasson
Samurai
Samurai
Posts: 141
Joined: 06 Mar 2019, 15:14
Distribution: Arch linux

How to spin off definitely hard drive

Post#13 by benjibasson » 12 Feb 2023, 11:11

On windows higher than 98 or other linux distributions, ( Arch linux, Ubuntu) the question should not be asked :D because it access the root hdd every seconds, so it is useless to spin down, neither to tell the power management to spin down after 5 minutes of inactivity because it will never stop working on their root partitions
Disk is always busy if not a live cd

User avatar
Ed_P
Contributor
Contributor
Posts: 8361
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

How to spin off definitely hard drive

Post#14 by Ed_P » 12 Feb 2023, 19:21

Here's something to try, boot from the ISO instead of the hdd. It's what I do. I do have files on the hard drive, /Modules /Optional and /changes so I'm not remaking the ISO after every new module or change, and the hard drive is NTFS not ext4 but ext4 should work.

My grub2 menus.

Code: Select all

set timeout=30

# Set the default variable to the submenu entry you prefer
set default=1

     set linux_folder=/porteus5.0
     set iso="/ISOs/Porteus-CINNAMON-v5.0-x86_64-220924.iso"
     set iso="/ISOs/Porteus-CINNAMON-v5.0-x86_64-221210.iso"

menuentry " Porteus 5.0 ISO - changes="  --class slackware   --class icon-porteus  {

     set bootparms="volume=33 reboot=cold extramod=$linux_folder/Modules changes=EXIT:$linux_folder/changes/50save.dat noload=kde;jinn;lxqt;xfce;lxde;mate;open;dat.xzm;mychanges;autonet;menu1" 

     search -f $iso --set=root
     loopback loop $iso
     linux (loop)/boot/syslinux/vmlinuz      from=$iso $bootparms
     initrd (loop)/boot/syslinux/initrd.xz
     }  

menuentry " Porteus 5.0 ISO - AF'"  --class slackware   --class icon-porteus  {

     set bootparms="volume=33 reboot=cold extramod=$linux_folder/Modules noload=kde;jinn;lxqt;xfce;lxde;mate;open;dat.xzm;menu2" 

     search -f $iso --set=root
     loopback loop $iso
     linux (loop)/boot/syslinux/vmlinuz      from=$iso $bootparms
     initrd (loop)/boot/syslinux/initrd.xz
     }

menuentry " Porteus 5.0 ISO - AF' + 50save.dat.xzm"  --class slackware   --class icon-porteus  {

     set bootparms="volume=33 reboot=cold extramod=$linux_folder/Modules noload=kde;jinn;lxqt;xfce;lxde;mate;open;mychanges;menu2x" 

     search -f $iso --set=root
     loopback loop $iso
     linux (loop)/boot/syslinux/vmlinuz      from=$iso $bootparms
     initrd (loop)/boot/syslinux/initrd.xz
     }
Ed

benjibasson
Samurai
Samurai
Posts: 141
Joined: 06 Mar 2019, 15:14
Distribution: Arch linux

How to spin off definitely hard drive

Post#15 by benjibasson » 14 Feb 2023, 08:59

I already have an live usb Porteus v4, I will try copy2ram no change...

However what is the reboot=cold option?
Is it useful only for next reboot or more over for this start?

Post Reply