You are not logged in.

#1 2014-05-30 09:04:31

hifi25nl
Member
Registered: 2011-05-07
Posts: 263

Start archlinux on USB regardless of other hard disks

I don't know if it is possible.
I want to start an archlinux installation from an USB stick so that if I connect the stick to another computer it will boot without changing boot configuration, regardless of the hard disks attached to new computer.
The new computer BIOS will be set to boot from USB stick.

This is not a "live" USB installation. It is a standard one.

Most of time I had to change grub configuration with grub-mkconfig from another installation or arch CD but I would like to have a system that will boot without any intervention.

Offline

#2 2014-05-30 10:07:38

GloW_on_dub
Member
Registered: 2013-03-13
Posts: 388

Re: Start archlinux on USB regardless of other hard disks

I do not understand why do you need to change your grub configuration.
Reading here , it seems the usb is always recognized as hd0, so what kind of configuration do you feel necessary to be able to boot your usb arch linux ?

Last edited by GloW_on_dub (2014-05-30 10:07:50)

Offline

#3 2014-05-30 10:45:09

hifi25nl
Member
Registered: 2011-05-07
Posts: 263

Re: Start archlinux on USB regardless of other hard disks

In my system with 3 more hardisks (2 windows sata ntfs internal and one usb3 external ntfs) with the USB stick connected to a USB2 port, in grub.cfg I have (hd3,msdos1)

Offline

#4 2014-05-30 10:55:20

GloW_on_dub
Member
Registered: 2013-03-13
Posts: 388

Re: Start archlinux on USB regardless of other hard disks

Well that's strange, the wiki said that your usb should be at hd0 if you've installed grub on it.
You've made a mistake or the wiki is incorrect...

Last edited by GloW_on_dub (2014-05-30 10:55:28)

Offline

#5 2014-05-30 10:58:44

hifi25nl
Member
Registered: 2011-05-07
Posts: 263

Re: Start archlinux on USB regardless of other hard disks

This is the result of bootinfoscript:

                  Boot Info Script 0.61      [1 April 2012]


============================= Boot Info Summary: ===============================

 => Windows is installed in the MBR of /dev/sda.
 => Windows is installed in the MBR of /dev/sdb.
 => Windows is installed in the MBR of /dev/sdc.
 => Grub2 (v1.99) is installed in the MBR of /dev/sdd and looks at sector 1 of 
    the same hard drive for core.img. core.img is at this location and looks 
    in partition 75 for .

sda1: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows Vista/7: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        /bootmgr /Boot/BCD

sda2: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows Vista/7: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        

sdb1: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows Vista/7: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        /bootmgr /Boot/BCD /Windows/System32/winload.exe

sdc1: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows XP: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        

sdd1: __________________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info: 
    Operating System:  Arch Linux ()
    Boot files:        /boot/grub/grub.cfg /etc/fstab

============================ Drive/Partition Info: =============================

Drive: sda _____________________________________________________________________

Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sda1    *          2,048       206,847       204,800   7 NTFS / exFAT / HPFS
/dev/sda2             206,848   976,771,071   976,564,224   7 NTFS / exFAT / HPFS


Drive: sdb _____________________________________________________________________

Disk /dev/sdb: 232.9 GiB, 250059350016 bytes, 488397168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sdb1    *        208,896   487,680,367   487,471,472   7 NTFS / exFAT / HPFS


Drive: sdc _____________________________________________________________________

Disk /dev/sdc: 1.8 TiB, 2000365289472 bytes, 3906963456 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sdc1               2,048 3,906,963,455 3,906,961,408   7 NTFS / exFAT / HPFS


Drive: sdd _____________________________________________________________________

Disk /dev/sdd: 14.9 GiB, 16013942784 bytes, 31277232 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sdd1               2,048    31,277,055    31,275,008  83 Linux


"blkid" output: ________________________________________________________________

Device           UUID                                   TYPE       LABEL

/dev/sda1        CEBC9DA5BC9D889B                       ntfs       Riservato per il sistema
/dev/sda2        FC1AA10C1AA0C4CC                       ntfs       data
/dev/sdb1        FC1AA10C1AA0C4CC                       ntfs       
/dev/sdc1        F474B7AA74B76DCC                       ntfs       My Passport
/dev/sdd1        0cd6f57a-72a1-4620-af0f-b00c25b9d478   ext4       archaudio2

================================ Mount points: =================================

Device           Mount_Point              Type       Options

/dev/sda2        /media/windows           fuseblk    (rw,nosuid,nodev,noexec,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)
/dev/sdc1        /media/windows2          fuseblk    (rw,nosuid,nodev,noexec,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)
/dev/sdd1        /                        ext4       (rw,noatime,data=ordered)


=========================== sdd1/boot/grub/grub.cfg: ===========================

--------------------------------------------------------------------------------
#
# 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
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="${saved_entry}"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

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 {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_msdos 
insmod ext2
set root='hd3,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos1 --hint-efi=hd3,msdos1 --hint-baremetal=ahci3,msdos1  0cd6f57a-72a1-4620-af0f-b00c25b9d478
else
  search --no-floppy --fs-uuid --set=root 0cd6f57a-72a1-4620-af0f-b00c25b9d478
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_input console
terminal_output gfxterm
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=5
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
	menuentry 'Arch Linux, with Linux linux-rt' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-rt-advanced-0cd6f57a-72a1-4620-af0f-b00c25b9d478' {
	savedefault
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_msdos submenusubmenu
		insmod ext2
		set root='hd3,msdos1'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos1 --hint-efi=hd3,msdos1 --hint-baremetal=ahci3,msdos1  0cd6f57a-72a1-4620-af0f-b00c25b9d478
		else
		  search --no-floppy --fs-uuid --set=root 0cd6f57a-72a1-4620-af0f-b00c25b9d478
		fi
		echo	'Loading Linux linux-rt ...'
		linux	/boot/vmlinuz-linux-rt root=UUID=0cd6f57a-72a1-4620-af0f-b00c25b9d478 rw  quiet
		echo	'Loading initial ramdisk ...'
		initrd	/boot/initramfs-linux-rt.img
	}

menuentry 'Arch Linux, with Linux linux-rt COMMAND LINE' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-rt-advanced-0cd6f57a-72a1-4620-af0f-b00c25b9d478' {
	savedefault
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_msdos submenusubmenu
		insmod ext2
		set root='hd3,msdos1'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos1 --hint-efi=hd3,msdos1 --hint-baremetal=ahci3,msdos1  0cd6f57a-72a1-4620-af0f-b00c25b9d478
		else
		  search --no-floppy --fs-uuid --set=root 0cd6f57a-72a1-4620-af0f-b00c25b9d478
		fi
		echo	'Loading Linux linux-rt ...'
		linux	/boot/vmlinuz-linux-rt root=UUID=0cd6f57a-72a1-4620-af0f-b00c25b9d478 rw  quiet systemd.unit=multi-user.target
		echo	'Loading initial ramdisk ...'
		initrd	/boot/initramfs-linux-rt.img
	}

	menuentry 'Arch Linux, with Linux linux-rt (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-rt-fallback-0cd6f57a-72a1-4620-af0f-b00c25b9d478' {
	savedefault
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_msdos 
		insmod ext2
		set root='hd3,msdos1'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos1 --hint-efi=hd3,msdos1 --hint-baremetal=ahci3,msdos1  0cd6f57a-72a1-4620-af0f-b00c25b9d478
		else
		  search --no-floppy --fs-uuid --set=root 0cd6f57a-72a1-4620-af0f-b00c25b9d478
		fi
		echo	'Loading Linux linux-rt ...'
		linux	/boot/vmlinuz-linux-rt root=UUID=0cd6f57a-72a1-4620-af0f-b00c25b9d478 rw  quiet
		echo	'Loading initial ramdisk ...'
		initrd	/boot/initramfs-linux-rt-fallback.img
	}
	menuentry 'Arch Linux, with Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-0cd6f57a-72a1-4620-af0f-b00c25b9d478' {
	savedefault
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_msdos 
		insmod ext2
		set root='hd3,msdos1'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos1 --hint-efi=hd3,msdos1 --hint-baremetal=ahci3,msdos1  0cd6f57a-72a1-4620-af0f-b00c25b9d478
		else
		  search --no-floppy --fs-uuid --set=root 0cd6f57a-72a1-4620-af0f-b00c25b9d478
		fi
		echo	'Loading Linux linux ...'
		linux	/boot/vmlinuz-linux root=UUID=0cd6f57a-72a1-4620-af0f-b00c25b9d478 rw  quiet
		echo	'Loading initial ramdisk ...'
		initrd	/boot/initramfs-linux.img
	}
	menuentry 'Arch Linux, with Linux linux (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-0cd6f57a-72a1-4620-af0f-b00c25b9d478' {
	savedefault
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_msdos 
		insmod ext2
		set root='hd3,msdos1'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos1 --hint-efi=hd3,msdos1 --hint-baremetal=ahci3,msdos1  0cd6f57a-72a1-4620-af0f-b00c25b9d478
		else
		  search --no-floppy --fs-uuid --set=root 0cd6f57a-72a1-4620-af0f-b00c25b9d478
		fi
		echo	'Loading Linux linux ...'
		linux	/boot/vmlinuz-linux root=UUID=0cd6f57a-72a1-4620-af0f-b00c25b9d478 rw  quiet
		echo	'Loading initial ramdisk ...'
		initrd	/boot/initramfs-linux-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/30_os-prober ###

menuentry 'Windows 8 (loader) (on /dev/sdb1)' --class windows --class os $menuentry_id_option 'osprober-chain-FC1AA10C1AA0C4CC' {
	savedefault
	insmod part_msdos 
	insmod ntfs
	set root='hd1,msdos1'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1  FC1AA10C1AA0C4CC
	else
	  search --no-floppy --fs-uuid --set=root FC1AA10C1AA0C4CC
	fi
	drivemap -s (hd0) ${root}
	chainloader +1
}
### 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  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

### BEGIN /etc/grub.d/60_memtest86+ ###
### END /etc/grub.d/60_memtest86+ ###
--------------------------------------------------------------------------------

=============================== sdd1/etc/fstab: ================================

--------------------------------------------------------------------------------
# 
# /etc/fstab: static file system information
#
# <file system>	<dir>	<type>	<options>	<dump>	<pass>

UUID=0cd6f57a-72a1-4620-af0f-b00c25b9d478	/         	ext4      	rw,noatime,data=ordered	0 1
/dev/sda2 /media/windows ntfs-3g users,uid=1000,gid=100,fmask=0113,dmask=0002	  0       0
/dev/sdc1 /media/windows2 ntfs-3g users,uid=1000,gid=100,fmask=0113,dmask=0002	  0       0
/dev/sr0   /media/cd   udf,iso9660 users,noauto,exec   0 0
# none    /media/ramdisk    tmpfs   nodev,nosuid,noexec,noatime,size=1024M    0   0

--------------------------------------------------------------------------------

=================== sdd1: Location of files loaded by Grub: ====================

           GiB - GB             File                                 Fragment(s)


=============================== StdErr Messages: ===============================

cat: /tmp/BootInfo-Hqvf2tox/Tmp_Log: No such file or directory
  No volume groups found
mdadm: No arrays found in config file or automatically

Offline

#6 2014-05-30 11:18:23

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

Re: Start archlinux on USB regardless of other hard disks

There is no expectation that a USB will always have the same 'hd' number.  Use UUIDs rather than block identifiers.

I'm not sure how to do this is grub, but if it isn't easy, then perhaps syslinux would be a better choice (it is simple in syslinux).

Last edited by Trilby (2014-05-30 11:19:13)


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

Offline

#7 2014-06-12 06:43:31

hifi25nl
Member
Registered: 2011-05-07
Posts: 263

Re: Start archlinux on USB regardless of other hard disks

I have installed Syslinux with UUID of the USB pen and all is working very fine!!

Offline

Board footer

Powered by FluxBB