Showing posts with label usb. Show all posts
Showing posts with label usb. Show all posts

Thursday, September 4, 2008

USB flash drive format and fdisk

В качестве флэхи я рассматриваю карточку microSD из мобилы, подключенную в ноутбук через переходник SD.

Сегодня хотел на флехе удалить не удаляемый, видимо побитый, файл такой командой:
sudo umount /dev/mmcblk0p1
dd if=/dev/zero of=/dev/mmcblk0p1
но после этого флеха осталась без файловой системы. :(

Пришлось делать fdisk:
fdisk /dev/mmcblk0p1
  • type p to show the existing partition and d to delete it
  • type n to make a new partition
  • type p for primary partition
    • type 1 to make this the first partition
    • hit enter to use the default 1st cylinder
    • hit enter again to use the default last cylinder
    • type w to write the new partition table
sudo umount /dev/mmcblk0p1
sudo mkfs.vfat -F 16 -n MemoryCard /dev/mmcblk0p1
sudo mount /dev/mmcblk0p1 /media/microSD -t vfat -o rw,utf8

Хорошо что скопировать файлы с флехи успел. Теперь восстановливаем из резервной копии, естесвенно она была без тех битых файлов :)
cp -rv * /media/microSD/

Thursday, June 12, 2008

Ubuntu on usb stick with jdk

Installation 7.10 close to:
1. ubuntu-804-usb-hard-drive-install
(instructions more close to this one, but this version doesn't work - desktop doesn't appears)
2. ubuntu-704-to-a-usb-hard-drive
(pure documented instructions, and I didn't try this one due to old release date)

Than edit grub (without this step usb stick doesn't boot ubuntu, just grub menu appears on athescreen)
"sudo gedit /boot/grub/menu.lst"
remove all added at bottom from hard disk grub
and rename "hd1" for flash grub with "hd0"
You can edit this on fly in a loaded grub menu with "e" and boot edited with "b".

Run boot from USB storage.

After, you can comment swap space within /etc/fstab or exclude it while installation with manual prepare disk space. It makes faster your system.
"sudo gedit /etc/fstab"

Add network settings, sources of packages.
Install mc, jdk.

Copy tomcat.

PS:
0.
I used CD burned ubuntu 7.10 for i386 on my USB 4Gb OCZ ATV flash drive with Dell AMD 2x1.8 Ghz and 2Gb memory laptop.

1.
grub-error-21-after-full-install-to-usb-hard-drive
sudo grub
grub> find /boot/grub/stage1
(hdx,y) The given out values substitute below
grub> root (hdx,y)
grub> setup (hdx)
2.
You can create live usb stick (it is more faster than full process installation on USB), but there are error with install jdk.
usb-ubuntu-804-persistent-install-via-the-live-cd

Link:
www.stonewarewebos.com - webOS-Ubuntu-PressRelease.pdf
http://www.pendrivelinux.com/2008/05/08/usb-ubuntu-804-persistent-install-via-the-live-cd/