Installing a new hard drive

Myles Green rmg57 at telus.net
Sat Dec 18 16:01:02 UTC 2004


On Sat, 2004-18-12 at 15:14 +0000, Eamonn Sullivan wrote:
> This should be simple, but in all my years of using Linux I've never
> done it. Now that I've mastered rsync for backing up the PCs in my
> house, I decided to add a new SATA 160GB drive to the Ubuntu system to
> store my backups. I've done that, and the drive is visible in the
> device manager, but how do I format it (ext3) and attach it to the
> file system? Was thinking of putting it in /home/backup or /backup.
> Can someone give me a quick pointer to the right commands? 'apropos
> disk' and 'apropos format' return a somewhat overwhelming number of
> entries...

Hi Eamonn,

First off you need to find out what the system sees as the drive
letter/number:

sudo dmesg|less 

and scroll down until you find your drive.

Then you need to decide if you want to make one big partition on the
drive or several smaller ones. Then you would use fdisk to make it
(them) for illustration I'll just use one and call it /dev/hdd:

myles at d205-206-105-118:~ $ sudo fdisk /dev/hdd <enter>
password:supersecret <enter>
The number of cylinders for this disk is set to 77557.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

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):n <enter>
Command action
   e   extended
   p   primary partition (1-4)
p <enter>
Partition number (1-4):
1 <enter>

Command (m for help):w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
myles at d205-206-105-118:~ $

Then you format the disc like this (I'll make it an ext3 partition)

myles at d205-206-105-118:~ $ sudo mke2fs -j /dev/hdd1
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
4889248 inodes, 9772174 blocks
488608 blocks (5.00%) reserved for the super user
First data block=0
299 block groups
32768 blocks per group, 32768 fragments per group
16352 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632,
2654208,
        4096000, 7962624

Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 27 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
myles at d205-206-105-118:~ $

Next make your mount point:

myles at d205-206-105-118:~ $ sudo mkdir /backup

and mount it:

sudo mount /dev/hdd1 /backup

Next add an entry in /etc/fstab using existing entries as a guide.

And there you have it... clear as mud right? <grin>


Hope That Helps (HTH)

Myles

-- 
Myles Green <rmg57 at telus.net> Calgary AB Canada
Ubuntu Linux 4.10 The "Warty Warthog" Release http://www.ubuntulinux.org/
My GPG/PGP public key (9D02F338) is available on this server:
http://keyserver-beta.pgp.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20041218/fe098504/attachment.sig>


More information about the ubuntu-users mailing list