how to use USB hard disk as /(root)
#3
(06-26-2016, 07:31 AM)martinayotte Wrote: Look at the /boot/uEnv.txt. You can probably overwrite default root=/dev/mmcblk0p2 to /dev/sda1 by using "extraargs"
http://linux-sunxi.org/UEnv.txt

thanks for great advice .

but i fail .
something is wrong with me .

my step is next .
1)
rewrite /boot/uEnv.txt
console=tty0 console=ttyS0,115200n8 no_console_suspend
kernel_filename=pine64/Image
initrd_filename=initrd.img
ethaddr=36:c9:e3:f1:b8:05
optargs=disp.screen0_output_mode=720p60
extraargs=root=/dev/sda1


2)do next shell script
Code:
ntpd -s
date
echo '--------------------'
mkdir -p /ma1
umount /ma1
mount /dev/sda1 /ma1
df
echo '--------------------'
read X
echo $X
cd /ma1
mkdir -p bin            etc home lib                opt        root       sbin           srv            usr var
for x in /bin          /etc /home /lib               /opt      /root       /sbin         /srv          /usr /var
do
rsync -avHx --delete  $x/  /ma1$x/
done
for x in    boot  dev                  media   mnt       proc         run                      sys  tmp
do
rm -rf /ma1/$x
done
cd /ma1
mkdir -p     boot  dev                  media   mnt       proc         run                     sys  tmp



3)rewite  /ma1/etc/fstab

Code:
# UNCONFIGURED FSTAB FOR BASE SYSTEM
# <file system>    <dir>    <type>    <options>            <dump>    <pass>
/dev/mmcblk0p1    /boot    vfat    defaults            0        2

#/dev/mmcblk0p2    /    ext4    defaults,noatime        0        1
/dev/sda1    /    ext4    defaults,noatime        0        1


#####################

#/dev/mmcblk0p3  none    swap    sw                        0              0
/dev/sda2  none    swap    sw                        0              0



in order to return SD card only system , i rewrite uEnv.txt originally.
in this   state


Code:
root@pine64pro:/home/debian# mount /dev/sda1 /ma1


root@pine64pro:/home/debian# ls /ma1
bin  boot  dev    etc  home  lib    lost+found  media  mnt    opt  proc  root  run  sbin  srv  sys  tmp  usr    var

and
 /boot/uEnv.txt
console=tty0 console=ttyS0,115200n8 no_console_suspend
kernel_filename=pine64/Image
initrd_filename=initrd.img
ethaddr=36:c9:e3:f1:b8:05
optargs=disp.screen0_output_mode=720p60
root=/dev/sda1

also fail .

----
regards
  Reply


Messages In This Thread
how to use USB hard disk as /(root) - by hatahata - 06-25-2016, 06:51 PM
RE: how to use USB hard disk as /(root) - by hatahata - 06-26-2016, 01:43 PM
RE: how to use USB hard disk as /(root) - by Luke - 06-27-2016, 02:22 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  root running from usb connected ssd locks up system marcelser 0 2,709 11-17-2017, 04:50 PM
Last Post: marcelser
  OMV base on Debian jessie Root Problem ayamy 3 6,132 09-03-2017, 09:21 PM
Last Post: tllim
  resize root partition to max available space SD card can provide bilylilyli 16 22,502 11-18-2016, 07:10 PM
Last Post: pfeerick
  root password shaozhai 4 7,100 08-25-2016, 12:55 PM
Last Post: jl_678
Sad How to resize the root partition in order to fully utilize the SD Card MicroDiery 5 8,206 05-24-2016, 05:48 AM
Last Post: Luke
  Debian root's password? rayivy 2 4,670 05-12-2016, 08:59 PM
Last Post: rayivy
  what is the root password for debian? piahoo 5 11,368 04-29-2016, 02:12 PM
Last Post: rhkean

Forum Jump:


Users browsing this thread: 1 Guest(s)