how to use USB hard disk as /(root)
#9
i did experiment but this is not root as hard disk drive .

1) sd card only boot

insert USB memory( this is recognaized as sda )

mkdir /SAVE

and
fdisk -l /dev/sda
---------------------------------------------------------------------------------------
Device Boot Start End Sectors Size Id Type
/dev/sda1 10487808 15730687 5242880 2.5G 83 Linux
/dev/sda2 2048 4196351 4194304 2G 82 Linux swap / Solaris
/dev/sda3 4196352 10487807 6291456 3G 5 Extended
/dev/sda5 4198400 4231167 32768 16M 83 Linux
/dev/sda6 4233216 4265983 32768 16M 83 Linux
/dev/sda7 4268032 5316607 1048576 512M 83 Linux
/dev/sda8 5318656 5351423 32768 16M 83 Linux
/dev/sda9 5353472 9547775 4194304 2G 83 Linux

and rewite /etc/fstab
/dev/mmcblk0p1 /boot vfat defaults 0 2
/dev/mmcblk0p2 / ext4 defaults,noatime 0 1
/dev/sda1 /SAVE ext4 defaults,noatime 0 1
/dev/sda2 none swap sw 0 0
/dev/sda5 /dev ext4 defaults,noatime 0 1
/dev/sda6 /proc ext4 defaults,noatime 0 1
/dev/sda7 /run ext4 defaults,noatime 0 1
/dev/sda8 /sys ext4 defaults,noatime 0 1
/dev/sda9 /tmp ext4 defaults,noatime 0 1


2) then reboot ( attaching USB memory)
df
ファイルシス 1K-ブロック 使用 使用可 使用% マウント位置
/dev/mmcblk0p2 14326776 3490516 10097960 26% /
devtmpfs 468608 0 468608 0% /dev
tmpfs 502140 68 502072 1% /dev/shm
tmpfs 502140 7112 495028 2% /run
tmpfs 5120 4 5116 1% /run/lock
tmpfs 502140 0 502140 0% /sys/fs/cgroup
/dev/mmcblk0p1 51082 24242 26840 48% /boot
/dev/sda9 1998672 3112 1874320 1% /tmp
/dev/sda1 2514736 3840 2363440 1% /SAVE
tmpfs 100432 4 100428 1% /run/user/117
tmpfs 100432 8 100424 1% /run/user/1000

free
total used free shared buffers cached
Mem: 1004284 376828 627456 8596 12056 160076
-/+ buffers/cache: 204696 799588
Swap: 2097148 0 2097148


the result tells me
a) swap is OK
b)/SAVE and /tmp only OK .

any way this reduce sd card's burden and sd card has longer life time .
( mkdir /SAVE/d1 ; ln -s /SAVE/d1 /var/www/d1 <-apache2)

---
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 Luke - 06-27-2016, 02:22 PM
RE: how to use USB hard disk as /(root) - by hatahata - 06-27-2016, 08:04 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,129 09-03-2017, 09:21 PM
Last Post: tllim
  resize root partition to max available space SD card can provide bilylilyli 16 22,488 11-18-2016, 07:10 PM
Last Post: pfeerick
  root password shaozhai 4 7,099 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,202 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,367 04-29-2016, 02:12 PM
Last Post: rhkean

Forum Jump:


Users browsing this thread: 1 Guest(s)