Adding a new hard disk to VortexBox can be done from command line.
First add the device to your VortexBox or plug in your USB drive. SATA drives will mount themselves on /dev/sdx. The first device will be on /dev/sda then /dev/sdb etc. USB drives will add them selves after the SATA drives.
Now you need to figure out what disk you just added. fdisk -l will list all the drives on the system
fdisk -l
Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xe42de42d
Device Boot Start End Blocks Id System
/dev/sda1 * 1 25 200781 83 Linux
/dev/sda2 26 9729 77947380 8e Linux LVM
Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0×88a3cdb5
Device Boot Start End Blocks Id System
I just added a 500GB drive. It’s /dev/sdb. I can tell becasue it’s the only 500GB disk on the system and it dosn’t have any partitions on it.
You could also use the dmesg command it will show you the system message that was generated when you plugged in your USB drive.
dmesg
Initializing USB Mass Storage driver…
scsi8 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 2
usb-storage: waiting for device to settle before scanning
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usb-storage: device scan complete
scsi 8:0:0:0: Direct-Access WDC WD50 00AACS-00ZUB0 1B01 PQ: 0 ANSI: 2 CCS
sd 8:0:0:0: [sdb] 976773168 512-byte hardware sectors (500108 MB)
sd 8:0:0:0: [sdb] Write Protect is off
sd 8:0:0:0: [sdb] Mode Sense: 00 38 00 00
sd 8:0:0:0: [sdb] Assuming drive cache: write through
sd 8:0:0:0: [sdb] 976773168 512-byte hardware sectors (500108 MB)
sd 8:0:0:0: [sdb] Write Protect is off
sd 8:0:0:0: [sdb] Mode Sense: 00 38 00 00
sd 8:0:0:0: [sdb] Assuming drive cache: write through
Yours will look different than this but you can see /dev/sdb was the device added.
Now you must partition the disk if it dosn’t alread yhave a partition
Start with fdisk and the drive device name
# fdisk /dev/sdb
Command (m for help): _
For a short manual we need to enter the ‘m’ command:
Command (m for help): m
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 need to know just few necessary commands: d,p,n,q,w. Don’t be afraid to use them–all your changes will be done only in memory and will only be written to the hard after the ‘w’ command is entered. If we have an error, we just need to cancel all changes with the command ‘q’.
First of all, let’s make ourself sure that disk is empty:
Command (m for help): p
Disk /dev/hdc: 64 heads, 63 sectors, 787 cylinders
Units = cylinders of 4032 * 512 bytes
Device Boot Start End Blocks Id System
Command (m for help):
Often sellers of PCs and hardware will pre-divide disks into partitions. In such cases we can use command ‘d’ (described below) to delete everything what we do not need.
So, let’s create a new parititon (with command ‘n’), answering all the questions as we go:
Command (m for help): n
Command action
e extended
p primary partition (1-4)
Choosing the partition type– primary or extended–we will enter p for primary.
In choosing number of the partition in this example, we will assign all of the all free space to one partition. Because this will be the first and only existing partition, we will assign the number 1:
Partition number (1-4): 1
When setting the number of the first cylinder of the partition, we can just use the default value, which is recorded when we just press Enter:
First cylinder (1-787, default 1):
Using default value 1
Setting the number of the last cylinder of the partition is easy in this example, since we are filling the entire drive with one partition. Again, just press Enter for the default (instead of the number of the cylinder, we can set size of partition in bytes, kbytes, or megabytes):
Last cylinder or +size or +sizeM or +sizeK (1-787, default 787):
Using default value 787
Command (m for help):
Now, partition is created. We can take a look of new table of partitions with the help of the ‘p’ command:
Command (m for help): p
Disk /dev/hdc: 64 heads, 63 sectors, 787 cylinders
Units = cylinders of 4032 * 512 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 787 1586560+ 83 Linux
Command (m for help):
If we don’t like (for some reason) the location or number of the partition, we can delete it using ‘d’ command:
Command (m for help): d
Partition number (1-4): 1
Command (m for help):
Now that we have a partiton the way we want save an quit with the w command
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
Next we need to format the disk using mkfs. Enter the command below and change the device name to the partition created above.
mkfs -t xfs /dev/sdb1
mke2fs 1.41.3 (12-Oct-2008)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
30531584 inodes, 122096000 blocks
6104800 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
3727 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 25 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
That’s it. Your disk is ready. Just mount it where you want it.
mkdir /storage/newdisk
mount /dev/sdb1 /storage/newdisk
to unmount your disk
umount /storage/newdisk
Note: You can mount the new disk directly on /storage. This will work well for add a large drive to an old system. Just make sure to get everything you need out of /storage first. You will no longer be able to access it once you mounted your new drive to it.
mount /dev/sdb1 /storage
Create all the folders on your new driver for VortexBox to store music in.
mkdir -p /storage/music/flac
mkdir -p /storage/music/mp3
mkdir -p /storage/movies
mkdir -p /storage/pictures