how to use USB hard disk as /(root)
#16
acording to martinayotte's kind advice . i can run root as hard disk drive .

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


2)do next script  clone-to-HDD.bat



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) rewrite   /ma1/etc/fstab
# <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/sda2 none   swap    sw              0       0


4)reboot

then
df
Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/sda1      151641080 1943572 141971488   2% /
devtmpfs          468364       0    468364   0% /dev
tmpfs             501916       0    501916   0% /dev/shm
tmpfs             501916    6744    495172   2% /run
tmpfs               5120       4      5116   1% /run/lock
tmpfs             501916       0    501916   0% /sys/fs/cgroup
/dev/mmcblk0p1     51082   12666     38416  25% /boot
tmpfs             100384       0    100384   0% /run/user/1000



debian@pine64:~$ top
top - 01:04:34 up  1:15,  1 user,  load average: 0.15, 0.11, 0.13
Tasks:  93 total,   1 running,  92 sleeping,   0 stopped,   0 zombie
%Cpu(s):  2.1 us,  2.1 sy,  0.0 ni, 95.8 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem:   1003836 total,   158860 used,   844976 free,     9032 buffers
KiB Swap:  2097148 total,        0 used,  2097148 free.    72516 cached Mem



fdisk -l /dev/sda
Device     Boot   Start       End   Sectors   Size Id Type
/dev/sda1       4196352 312581803 308385452 147.1G 83 Linux
/dev/sda2          2048   4196351   4194304     2G 82 Linux swap / Solaris



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

if i want to sd card only , i only rewite /boot/ /boot/uEnv.txt .
if i want to hard disk drive as root  , i only rewite /boot/ /boot/uEnv.txt .

thanks !
pine64-image-debianbase-310102bsp.img is great .

now we run pine64  as server Tongue
------------
regards
my home page -> http://pine-akita.blogspot.jp/
  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 Luke - 06-27-2016, 02:22 PM
RE: how to use USB hard disk as /(root) - by hatahata - 07-01-2016, 07:09 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  root running from usb connected ssd locks up system marcelser 0 2,748 11-17-2017, 04:50 PM
Last Post: marcelser
  OMV base on Debian jessie Root Problem ayamy 3 6,217 09-03-2017, 09:21 PM
Last Post: tllim
  resize root partition to max available space SD card can provide bilylilyli 16 22,895 11-18-2016, 07:10 PM
Last Post: pfeerick
  root password shaozhai 4 7,204 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,352 05-24-2016, 05:48 AM
Last Post: Luke
  Debian root's password? rayivy 2 4,740 05-12-2016, 08:59 PM
Last Post: rayivy
  what is the root password for debian? piahoo 5 11,474 04-29-2016, 02:12 PM
Last Post: rhkean

Forum Jump:


Users browsing this thread: 7 Guest(s)