LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to allocate an extra drive? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-allocate-an-extra-drive-719935/)

joseph2020 04-17-2009 03:55 PM

how to allocate an extra drive?
 
I have an empty 10 GB drive that I would like to use to store my Linux backups. Gparted shows it as /dev/sdc--9.5 Gb-- unallocated But it is not seen by the system. What do i need to do so it is seen and so it can be used for backup storage?

Thanks in advance.

pljvaldez 04-17-2009 03:57 PM

You need to format the drive to a known filesystem (the most common is ext3) from within GParted. Then you just need to mount it (it should end up being /dev/sdc1 after it has been formatted).

maresmasb 04-17-2009 08:37 PM

You can use a root the fdisk tool to partition your disk or simply run '/bin/fdisk -l' to list your current device. You have to partition it even if you want it to be a single partition - it needs a partition table anyway.

After having created the partition run mkfs to add a file system to the partition. In actuality, mkfs is simply a front-end for the various file system builders (mkfs.ext3, etc) available under Linux.

When done, mount the device or even better, add it to your /etc/fstab file, so it gets mounted at boot time.

joseph2020 04-18-2009 01:22 AM

Thank You!
 
Thank you for your replies. I think it worked! :)

Code:

joe@joe-desktop:~$ sudo fdisk -l

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1  *          1        4737    38049921  83  Linux
/dev/sda2            4738        4865    1028160    5  Extended
/dev/sda5            4738        4865    1028128+  82  Linux swap

  Device Boot      Start        End      Blocks  Id  System
/dev/sdb1              1        1241    9968301  83  Linux

joe@joe-desktop:~$

Quote:

When done, mount the device or even better, add it to your /etc/fstab file, so it gets mounted at boot time.
OK, next lesson.... how do I do that?

Thanks again!

jay73 04-18-2009 01:53 AM

Just open a terminal and enter
sudo gedit /etc/fstab
and add a line for the new partition that looks like the other ones. You can find the UUID of the partition by running the blkid command. And of course, you'll need to create a directory as a mount point where the new space will appear, say
mkdir $HOME/Backup (in which case you need to specify /home/user_name_here/Backup in fstab).
Once you are done, run
sudo mount -a
then you will probably still need to change the permissions:
sudo chown-R $USER:$USER Backup

joseph2020 04-18-2009 02:58 AM

thanks jay73

I'm not smart enough to figure out your answer... If you can simplify I would be grateful. Please, pretend you're talking to a 4 year old.

I am lost in the Linux world. Assume I don't know anything (it's true). Please keep it simple and step by step.

Thanks again

linuxlover.chaitanya 04-18-2009 03:52 AM

It is simple than you think. Just create a directory. It is assumed that you created in your home directory. Lets say the name of the directory is backup.

Now edit the /etc/fstab file as a root user. Open it in your favorite text editor. I say you do it gedit. But not necessarily that and is just an example.
Just add the following lines there:

Code:

/dev/sdb1  /home/user_name/backup  ext3  defaults    0  0

malekmustaq 04-18-2009 04:48 AM

joseph2020:

Instructions above are good enough. Yet if you wanted it more simple I'll try it here.

Open the terminal:

TO BACK UP YOUR FSTAB:

<Type in the following commands>

cd /etc <Enter>
cp fstab mybackup_fstab <Enter>

(Now you have just backed up your fstab. You may edit it now.)

TO AUTO MOUNT AT BOOTUP YOUR NEW BACKUP PARTITION:

<Type in the following commands in the terminal>

sudo mkdir /media/mybackpart <Enter>
<enter password> <Enter>

(this created a new folder under /media unto which you shall mount the partition)

NOW YOU CAN EDIT YOUR FSTAB AND USE THAT NEW FOLDER FOR MOUNTING:

sudo gedit /etc/fstab <Enter>
<enter password>
(graphic editor gedit opens, now you may enter or add the following line)

/dev/sdb1 /media/mybackpart ext3 defaults 0 0

(Now save and close the geditor. Be sure you saved it.)

When you reboot you can browse into your /media/mybackpart and there it is now mounted and ready to use.

This is only an illustration for the purpose. But for backup purposes you may mount it under /home directory if you like. Target folders for mounting can be created anywhere as long as you have permissions.

Read more about Linux tutorials available in the web. Use Google. There is also a help file for every command in the terminal, just enter:

man <command> <pressEnter>

For example you want to know more about 'mount' command, you'll type:

man mount <Enter>

(a manual page for command 'mount' will open)

a manual page will show up like help file for the requested command.

hope it helps.

goodluck.

joseph2020 04-18-2009 03:51 PM

Thank you for your helpful replies!

linuxlover.chaitanya:

I have done as you instructed....thank you much for your help!

malekmustaq:

Thank you for your explicit directions and your patience in explaining it step by step as you have done. I will try that as soon as I get offline.

thorkelljarl 04-18-2009 08:26 PM

Try

Try a little of these. You are not expected to read or know it all, all at once.

http://www.linux.org/lessons/beginner/toc.html

http://www.linuxcommand.org/

http://rute.2038bug.com/index.html.gz

http://tldp.org/

joseph2020 04-19-2009 12:09 AM

End Of Chapter
 
linuxlover.chaitanya:

I am very happy! The drive is now showing up in all applications. just finished doing a backup to that "other" drive. I just did what you said:

Code:

It is simple than you think. Just create a directory. It is assumed that you created in your home directory. Lets say the name of the directory is backup.

Now edit the /etc/fstab file as a root user. Open it in your favorite text editor. I say you do it gedit. But not necessarily that and is just an example.
Just add the following lines there:

Code:

/dev/sdb1  /home/user_name/backup  ext3  defaults    0  0

Thank you very much for your helpful suggestions!

thorkelljarl:

Thank you for the links, I will be studying those very soon. There's so much to learn, and it's frustrating as I consider myself an advanced WinXP user, and now it seems I don't know how to do anything, even the most basic tasks. But, it is definitely getting better, and I am sure in a short time I will be as comfortable with Linux as I was with WinXP.

I just need to say that the linuxquestions.org users are the most helpful I have ever seen. I love this place!

linuxlover.chaitanya 04-20-2009 04:23 AM

More than happy to help anyone I could. Good to see I could be of some help. Always welcome.


All times are GMT -5. The time now is 07:16 PM.