Almost doomed the box while doing it :)
resize2fs utility allows you to expand e2fs filesystem online but there is a catch -> you cannot expand the filesystem beyond its partition boundary. Your filesystem is most likely using entire partition anyway.
- Use fdisk and first "p"rint the existing partition table
Disk /dev/sda: 8032 MB, 8032092160 bytes
64 heads, 32 sectors/track, 7660 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Disk identifier: 0x00027054
Device Boot Start End Blocks Id System
/dev/sda1 * 1 7660 7843824 83 Linux
- Note the Start and End of the partition and partition number (sda"X")
- Delete the required partition
- Create same partition again. Use same partition number and start cylinder number
- fdisk should prompt you with maximum number cylinders you can expand to. You might need to delete partitions before doing this.
- "p"rint the partition table again and make sure that the partition number and start cylider matches
- Make sure that you toggle the bootable flag if the partition was already bootable. I missed this step and subsequent boot failed. Luckily the bootable installation media was around
- "w"rite the changes, exit and reboot. (You can abort at this step and you would be still fine if you wish not to continue)
- After reboot, resize the filesystem
root@atom:~# resize2fs /dev/sda1
resize2fs 1.41.9 (22-Aug-2009)
Filesystem at /dev/sda1 is mounted on /; on-line resizing required
old desc_blocks = 1, new_desc_blocks = 1
Performing an on-line resize of /dev/sda1 to 1960956 (4k) blocks.
The filesystem on /dev/sda1 is now 1960956 blocks long.
- Enjoy!
NOTE: As long as your partition table is properly aligned on cylinder boundaries, you should be ok. These steps worked for me and you can follow them on your own :)
"केल्याने देशाटन, येतसे शहाणपण..." (Travelling makes a man wiser - Marathi proverb)
I am a traveller, set onto the journey of life. I like to watch people and machines, know them, see their life, see how they think and what they experience.
This is not a travelog. It is random, philosophical, technical - like I am at times :) This blog is my space to note down my memories, feelings, experiments and experiences that I accumulate, as I tread the Globe...
Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts
Wednesday, January 12, 2011
Sunday, November 01, 2009
Installing Ubuntu over USB flash drive RAID array in Intel Atom 330
Ubuntu makes it pretty simple to install it over USB flash drive RAID array. You can install it using flash drive itself.
Why would you do it? Flash drives are pretty cheap nowdays, even for capacities worth GBs. You can create RAID array out of more than one flash drive and have a system that can tolerate disk failures. Linux distros do not eat up diskspace like Windows so you can fit entire box in minimum two flash drives.
I downloaded Ubuntu server installation from a mirror and transferred the ISO to flash drive using Unetbootin. This has worked effortlessly for desktop live CD and I could boot in minutes. The installation also transferred itself onto other flash drive in system. However, I could not find any advanced options during live image - hdd transfer. So decided to download Server ISO.
It took 5 hours to get the image from net :( Unetbootin transferred it to flash but the installation kept complaining about missing CD-ROM drive. There are few links on web which mention you can mount the filesystem on /cdrom during setup. It worked but then setup kept complaining about something or the other. Finally hacked out CD-ROM drive from sister's desktop at midnight (she stays few miles away).
Once CD-ROM drive was there, setup was breeze. You need to make sure that USB emulation is set to "HDD" or "Fixed Disk" in the BIOS setup and boot using CD.
Setup is RAID aware and it provides easy options to create software RAID volumes. Setup also installs GRUB on all drives. This helps if you loose one RAID member and reboot.
Here are few screenshots during the install
- Choose manual mode to create partitions
- Create partitions on member drives first (keep sizes of partitions same. They can be in any order)
- Once partitions are created, come back to partitioning menu and create MD devices. Here you need to create as many partitions you need and make sure you select partitions of same sizes.
- Provide mount points to each partition and other usual parameters
- Commit changes and proceed, setup will do its job
- Reboot and test.
I tried removing one flash drive online and the system continued. However, if you try to reinsert that drive back online, the drive letter changes and hence the drive wont join RAID group. I would suggest you shutdown system, add drive and then restart. This is not the ideal thing to do but if the system is so critical, you wont be running it like this anyway ;)
If you are going to add a HDD after this, make sure that the HDD is not part of system boot sequence in BIOS. I am also not sure how the system will behave if you add more flash drives to the system. When the system is on, it should not cause harm, however, during boot the system might assign different drive letters. A quick look at mdadm.conf makes me believe that the RAID array is configured to look for disk signatures so you are at no risk if drive letters changes. Dont have a flash drive now to check that.
Let me know if it works for you. Following two links have been quiet helpful to me.
http://www.dedoimedo.com/computers/linux-raid.html#mozTocId435101
https://help.ubuntu.com/9.04/installation-guide/i386/boot-usb-files.html
http://www.linuxforums.org/forum/ubuntu-help/138532-solved-install-packages-cdrom-thru-terminal.html
Why would you do it? Flash drives are pretty cheap nowdays, even for capacities worth GBs. You can create RAID array out of more than one flash drive and have a system that can tolerate disk failures. Linux distros do not eat up diskspace like Windows so you can fit entire box in minimum two flash drives.
I downloaded Ubuntu server installation from a mirror and transferred the ISO to flash drive using Unetbootin. This has worked effortlessly for desktop live CD and I could boot in minutes. The installation also transferred itself onto other flash drive in system. However, I could not find any advanced options during live image - hdd transfer. So decided to download Server ISO.
It took 5 hours to get the image from net :( Unetbootin transferred it to flash but the installation kept complaining about missing CD-ROM drive. There are few links on web which mention you can mount the filesystem on /cdrom during setup. It worked but then setup kept complaining about something or the other. Finally hacked out CD-ROM drive from sister's desktop at midnight (she stays few miles away).
Once CD-ROM drive was there, setup was breeze. You need to make sure that USB emulation is set to "HDD" or "Fixed Disk" in the BIOS setup and boot using CD.
Setup is RAID aware and it provides easy options to create software RAID volumes. Setup also installs GRUB on all drives. This helps if you loose one RAID member and reboot.
Here are few screenshots during the install
- Choose manual mode to create partitions
- Create partitions on member drives first (keep sizes of partitions same. They can be in any order)
- Once partitions are created, come back to partitioning menu and create MD devices. Here you need to create as many partitions you need and make sure you select partitions of same sizes.
- Provide mount points to each partition and other usual parameters
- Commit changes and proceed, setup will do its job
- Reboot and test.
If you are going to add a HDD after this, make sure that the HDD is not part of system boot sequence in BIOS. I am also not sure how the system will behave if you add more flash drives to the system. When the system is on, it should not cause harm, however, during boot the system might assign different drive letters. A quick look at mdadm.conf makes me believe that the RAID array is configured to look for disk signatures so you are at no risk if drive letters changes. Dont have a flash drive now to check that.
Let me know if it works for you. Following two links have been quiet helpful to me.
http://www.dedoimedo.com/computers/linux-raid.html#mozTocId435101
https://help.ubuntu.com/9.04/installation-guide/i386/boot-usb-files.html
http://www.linuxforums.org/forum/ubuntu-help/138532-solved-install-packages-cdrom-thru-terminal.html
Subscribe to:
Posts (Atom)