Daily Archives: Friday 24/01/2014

Ubuntu Server: How to Attach and Mount a Hard Drive Tips, Tricks and Tutorials 24 JAN 2014

ubuntu orange logoThe other day we needed to pull data off a restored VM running an older LTS version of Ubuntu Server. My IT contact helpfully attached a small 500 MB drive to the VMware vSphere server and then left me to do the rest. This is what was needed to be done:

I first ran the fdisk utility to get a listing of devices currently seen by the system.

sudo fdisk -l

This gave me a list of all devices, from which I was able to determine the size and logical name assigned to the newly added disk, in this case a 500mb drive located as /dev/sdb.

Unfortunately for me, this time around the drive wasn’t actually picked up as being formatted, and as such I needed to first partition the disk using fdisk:

sudo fdisk /dev/sdb 

fdisk will display the following menu:

  Command (m for help): m <enter>
  Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

  Command (m for help):

We want to add a new partition. Type “n” and press enter.

  Command action
   e   extended
   p   primary partition (1-4)

We want a primary partition. Enter “p” and enter.

  Partition number (1-4):

Since this will be the only partition on the drive, number 1. Enter “1” and enter.

If it asks about the first cylinder, just type “1” and enter. (We are making 1 partition to use the whole disk, so it should start at the beginning.)

Now that the partition is entered, choose option “w” to write the partition table to the disk. Type “w” and enter.

If all went well (i.e. “The partition table has been altered!” appeared), you now have a properly partitioned hard drive that’s ready to be formatted. Since this is the first partition, Linux will recognize it as /dev/sdb1, while the disk that the partition is on is still /dev/sdb.

Next up, I needed to format the new partition.

There are a variety of options you could choose from, but seeing as I was working with Ubuntu server, ext3 made sense for this particular use case:

sudo mkfs -t ext3 /dev/sdb1

Of course, if you prefer to use something that would work under both Ubuntu and Windows, then FAT32 remains a good option:

sudo mkfs -t fat32 /dev/sdb1

(Note I had to do the whole partition and format thing because of the nature of drive plugged in. If this had not been the case, the system would have recognised the drive appropriately – as seen in the fdisk listing – and you would be able to skip straight to this mount part of the walkthrough).

With the disk partitioned, formatted and now ready for use, the next step is to actually make it usable on the system, in other words mount it.

First up, create a mount point, basically the path through which you will access it. (I would recommend using a mount point with “/media”, as it is the default used by Ubuntu.)

sudo mkdir /media/external

Now to actually mount the drive:

sudo mount /dev/sdb1 /media/external

Note, depending on the filesystem of your attached drive, you might have to alter the mount string accordingly. If the filesystem is FAT16 or FAT32 (like it is for most USB flash drives), and we want to mount it at /media/external (having already created the mount point):

sudo mount -t vfat /dev/sdb1 /media/external -o uid=1000,gid=1000,utf8,dmask=027,fmask=137

The options following the “-o” allow your user to have ownership of the drive, and the masks allow for extra security for file system permissions. If you don’t use those extra options you may not be able to read and write the drive with your regular username.

Otherwise if the device is formatted with NTFS, run:

sudo mount -t ntfs-3g /dev/sdb1 /media/external

And you should be good to go, happily copying data to and from /media/external. When you are done and need to plug out the device, first unmount it using:

sudo umount /media/external


sudo umount /dev/sdb1

Note that the unmount command will fail if your current working directory is in the /media/external path. You need to step out of the disk if you want to unmount it! :)

Related Links: https://help.ubuntu.com/community/Mount/USB, https://help.ubuntu.com/community/InstallingANewHardDrive

Review: Momoiro Sisters (1998) Anime | My Reviews 24 JAN 2014

momoiro sisters anime 1Murakami Momoko and Murakami Sakura are sisters living together. Momoko is a sweet, virgin high school girl while Sakura is a more… worldly office worker. While Momoko is just moving into the realm of love, relationships and sex, Sakura has more than had her fill of it – though she still remains the only unmarried one in her circle of friends. Always with advice to spare, Sakura does her best to meddle in others’ affairs, while Momoko has to be content to deal with her own new problems that keep cropping up.

Throw in a wide array of office colleagues and school friends, and Momoko and Sakura are going to have their hands full solving today’s problems and making new memories for themselves.

Aah, the pain and suffering today’s women have to endure for a happy life.

Momoiro Sisters is an entertaining series of short stories discussing matters from a woman’s point of view. The story revolves around two sisters, one attending high school and the other an office worker. The stories are based in everyday life and discuss things like weight-loss, relationships, kissing and sex.

The stories are humorous and told entirely from a woman’s perspective on things. The older sister, Sakura, is worldly, likes sex and seemingly completely not marriage material. Her younger sister, Momoko, is sweet, naive and just starting into the world of relationships. Joining these two characters is a host of other people with real problems and quirky solutions. Overall, Momoiro Sisters assembles a great cast of characters, even though it doesn’t have much time to develop them fully.

The artwork is reasonably simplistic and kept quirky to maintain the level of humour prevalent in the stories being told. The colours are bright and the characters lovable. The voices are also well suited to the characters. Interestingly enough, the music for the series borrows heavily from popular English songs. Don’t be surprised to hear songs like Billy Ray Cyrus’ ‘Achy Breaky Heart’ playing in the background.

The stories interlace humour with a little bit of sweetness and it is quite enjoyable to see how things are going to work out for our two heroines. And if you don’t like a little sweetness you can always continue laughing.

A quirky little show that’s a good watch, especially if you only have a few minutes to spare.

momoiro sisters anime 2

(Historical Note: This was written back in August 2004. Thankfully my writing has improved greatly since then.)

Related Link: http://www.animenewsnetwork.com/encyclopedia/anime.php?id=1327