how to use USB hard disk as /(root) - Printable Version +- PINE64 (https://forum.pine64.org) +-- Forum: PINE A64(+) (https://forum.pine64.org/forumdisplay.php?fid=4) +--- Forum: Linux on Pine A64(+) (https://forum.pine64.org/forumdisplay.php?fid=6) +---- Forum: Debian (https://forum.pine64.org/forumdisplay.php?fid=24) +---- Thread: how to use USB hard disk as /(root) (/showthread.php?tid=1520) Pages:
1
2
|
how to use USB hard disk as /(root) - hatahata - 06-25-2016 hi all . i usually use hard disk as root . i think hard disk is more tough than sd card and the space of it is over 250GB or more . for example banana pi M1 , root is /dev/sda1 Code: head /boot/boot.cmd but at pine64's debian , surely there are files in /boot but they are binaly files so i do not do anythig , i give up . only develover knows how to , so i think . regards RE: how to use USB hard disk as /(root) - martinayotte - 06-26-2016 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 RE: how to use USB hard disk as /(root) - hatahata - 06-26-2016 (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" 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 3)rewite /ma1/etc/fstab Code: # UNCONFIGURED FSTAB FOR BASE SYSTEM 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 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 RE: how to use USB hard disk as /(root) - martinayotte - 06-27-2016 I gave it a try, and it was working perfectly for me by simply adding "root=/dev/sda1" in uEnv.txt. In my case, I'm running Ubuntu with longsleep kernel 3.10.101+ built myself, but I've never added any thing for USB storage, longsleep has the proper setting already. What is your kernel revision ? What kind of USB storage ? RE: how to use USB hard disk as /(root) - Luke - 06-27-2016 (06-27-2016, 11:14 AM)martinayotte Wrote: I gave it a try, and it was working perfectly for me by simply adding "root=/dev/sda1" in uEnv.txt. hows the performance ? RE: how to use USB hard disk as /(root) - martinayotte - 06-27-2016 I didn't do any performance tests, especially because I didn't have a real USB-HDD handy, all the ones I have are used somewhere else with precious contents, so I've tested it with a small USB-Dongle, so probably not quite fast. RE: how to use USB hard disk as /(root) - hatahata - 06-27-2016 (06-27-2016, 11:14 AM)martinayotte Wrote: I gave it a try, and it was working perfectly for me by simply adding "root=/dev/sda1" in uEnv.txt. i am running pine64-image-debianxfce-310101bsp.img . and uname -ar Linux pine64pro 3.10.101-0-pine64-longsleep #39 SMP PREEMPT Sat May 7 12:39:25 $ and usb strage is pine64+:USB-------USB_sata_converter-----sata hardsisk i chose debian because using ubuntu . the firefox do not run well for me . --- regards RE: how to use USB hard disk as /(root) - martinayotte - 06-27-2016 I have no clues, it should work since it worked for me. Revise your procedures, and hook up an USB-TTL on Debug port to figure out any other errors, like I did : on first boot, I forgot to create an empty /proc folder on /dev/sda1. RE: how to use USB hard disk as /(root) - hatahata - 06-27-2016 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 RE: how to use USB hard disk as /(root) - martinayotte - 06-28-2016 Why are you creating so many partitions ? You should have ONLY a single one with everything inside it, especially true for the /dev, /proc, /run, /srv, /sys and /tmp which must be empty folders inside the rootfs /dev/sda1. I presume that if you were looking at serial debug port, you would have seen that it stopped and failed trying to mount /proc because it doesn't exist inside your /dev/sda1. |