You are not logged in.

#1 2012-01-20 13:06:34

RausH
Member
Registered: 2012-01-20
Posts: 11

Disabling hard drive when booting from SD card

Dear reader,

searching for answers to the following question did not yield results i could use. The question:
I have a HP laptop using a conventional hard disk. due to personal live i am facing long an frequnent train rides. In order to protect my computer (which i intend to use to some extent during these rides, mainly email and web) i was thinking of installing Archlinux to an SD card and boot the laptop from this card. This should avoid spinning up the hard disk at all. Therefore i would like to know how i can be sure that the hard disk is not spinning. In the ideal case it would not even power up.
Is it sufficient to not mount any partition of the hard drive or is there a way to tell the computer at boot time that i do not need the hard disk and to prevent spinning up or powering up this device? hdparm -Y?
Thank you,
kind regards RausH

Offline

#2 2012-01-20 15:07:14

lagagnon
Member
From: an Island in the Pacific...
Registered: 2009-12-10
Posts: 1,087
Website

Re: Disabling hard drive when booting from SD card

Is it possible to do that in BIOS? i.e, many BIOS setup allow you to enter "None" in the hard drive device section so that it will not detect the drive. Check your setup.


Philosophy is looking for a black cat in a dark room. Metaphysics is looking for a black cat in a dark room that isn't there. Religion is looking for a black cat in a dark room that isn't there and shouting "I found it!". Science is looking for a black cat in a dark room with a flashlight.

Offline

#3 2012-01-21 19:02:38

RausH
Member
Registered: 2012-01-20
Posts: 11

Re: Disabling hard drive when booting from SD card

Thank you for your suggestion. I looked into my computers BIOS and did not find this option. By the way this would not have resulted in a very smooth work flow as my plan is to boot from the sd card in not mechanically stable environments (such as trains) and remove this sd card from the slot and boot from hd when i want to work on a stable table. entering BIOS every time would not have been convenient anyway.

therefore i still look for a way to power down the internal hd when i boot from the sd card. the most comfortable way would be to use the hp instant on system button for booting from the sd card and to use the regular power button to boot from the internal hd.

Offline

#4 2012-01-21 19:39:12

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: Disabling hard drive when booting from SD card

If you don't mount any partition from the HD and you if you use 'hdparm -Y /dev/sdx' only when booting from the sd card (maybe tweak /etc/rc.local on the sd card) it should do what you want. The HD will still be spinning until the boot proccess reaches /etc/rc.local on the sd card but the probability of having problems will be greatly reduced.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#5 2012-02-10 14:10:25

RausH
Member
Registered: 2012-01-20
Posts: 11

Re: Disabling hard drive when booting from SD card

Many thanks for your suggestions. I tried it the way you described it. However i am not able to boot from my sd card. In general my laptop is able to boot sd cards. But in my case there seem to be some problems.

i find my sd card under

 /dev/mmcblkp0

therefore i have to use grub2. which is not a general problem, yet i fail to configure it in a correct way

my current grub.cfp:

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
  load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  insmod vbe
  insmod vga
  insmod video_bochs
  insmod video_cirrus
}

set menu_color_normal=light-blue/black
set menu_color_highlight=light-cyan/blue

insmod part_msdos
insmod ext2
set root='(hd1,1)'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root  26dfcc68-2568-4c07-8c00-391e43f96475
else
  search --no-floppy --fs-uuid --set=root 26dfcc68-2568-4c07-8c00-391e43f96475
fi
if loadfont /usr/share/grub/unicode.pf2 ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  insmod part_msdos
  insmod ext2
  set root=''
  if [ x$feature_platform_search_hint = xy ]; then
    search --no-floppy --fs-uuid --set=root  27af005d-0e42-4c8f-be04-cddb2173362f
  else
    search --no-floppy --fs-uuid --set=root 27af005d-0e42-4c8f-be04-cddb2173362f
  fi
  set locale_dir=($root)/grub/locale
  set lang=de_AT
  insmod gettext
fi
terminal_input console
terminal_output gfxterm
set timeout=5
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch Linux, mit Linux lts' --class archlinux --class gnu-linux --class gnu --class os {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_msdos
	insmod ext2
	set root='(hd1,1)'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root  27af005d-0e42-4c8f-be04-cddb2173362f
	else
	  search --no-floppy --fs-uuid --set=root 27af005d-0e42-4c8f-be04-cddb2173362f
	fi
	echo	'Linux lts wird geladen …'
	linux	/vmlinuz-linux-lts root=/dev/disk/by-uuid/26dfcc68-2568-4c07-8c00-391e43f96475 ro  quiet
	echo	'Initiale Ramdisk wird geladen …'
	initrd	/initramfs-linux-lts.img
}
menuentry 'Arch Linux, mit Linux lts Fallback' --class archlinux --class gnu-linux --class gnu --class os {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_msdos
	insmod ext2
	set root=''
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root  27af005d-0e42-4c8f-be04-cddb2173362f
	else
	  search --no-floppy --fs-uuid --set=root 27af005d-0e42-4c8f-be04-cddb2173362f
	fi
	echo	'Linux lts wird geladen …'
	linux	/vmlinuz-linux-lts root=/dev/disk/by-uuid/26dfcc68-2568-4c07-8c00-391e43f96475 ro  quiet
	echo	'Initiale Ramdisk wird geladen …'
	initrd	/initramfs-linux-lts-fallback.img
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

when booting from sd card i can see the grub menu, i select the system i want to boot. after that for a long time nothing more than the display of the two echo messages happen. in the end i get an error message mentioning that the root device can not be found and a rescue promt. Due to this i played with various settings especially at the

set root 

line of the cfg file (sidenote: i did not manage to generate grub.cfg from edited config files, so i did some direct editing), switched from an encrypted / to an unencrypted etc. All of this consumed a lot of time. This is the reason for my late reply. I would appreciate it very much if i can get some oppinion on this boot problems too. thank you very much.
kind regards
RausH

Offline

Board footer

Powered by FluxBB