LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-13-2012, 06:50 PM   #1
imayneed
Member
 
Registered: Jul 2012
Distribution: Arch, Kubuntu
Posts: 76

Rep: Reputation: Disabled
Can I make these commands shorter?


I need to make this commands shorter to pass through Grub's 256 byte limit.

sudo su -
rm -r /home/partimag
mkdir -p /home/partimag
mkdir -p /tmp/local_dev
ntfs-3g /dev/sdb2 /tmp/local_dev
mount --bind tmp/local_dev/Clones /home/partimag

Unfortunately /home/partimag has to be deleted and then created.

I am trying to accomplish mounting sdb2/Clones as /home/partimag (where sdb2 is NTFS).

Is there anyway to make these commands shorter?
 
Old 07-13-2012, 07:02 PM   #2
rch
Member
 
Registered: Feb 2003
Location: Santa Clara,CA
Distribution: Mandriva
Posts: 909

Rep: Reputation: 48
So you want /home/partimag to be deleted on each boot - correct? Add your commands at the end of rc.local file. As for mounting ntfs partition, just add them to /etc/fstab.
 
Old 07-13-2012, 07:18 PM   #3
towheedm
Member
 
Registered: Sep 2011
Location: Trinidad & Tobago
Distribution: Debian Stretch
Posts: 612

Rep: Reputation: 125Reputation: 125
These are all shell commands. What does it have to do with your bootloader?

Nonetheless, why delete /home/partimag and then re-create it. Keep the /home/partimag directory and delete everything else under it.
Code:
rm -r /home/partimag
mkdir -p /home/partimag

# Use one command instead:
rm -r /home/partimag/*    # This deletes everything under /home/partimag, but keeps /home/partimag
Or, combine the two mkdir commands into one command:
Code:
mkdir -p /home/partimag /tmp/local_dev
 
1 members found this post helpful.
Old 07-13-2012, 09:41 PM   #4
imayneed
Member
 
Registered: Jul 2012
Distribution: Arch, Kubuntu
Posts: 76

Original Poster
Rep: Reputation: Disabled
Combining mkdir helps. Thank you.

What if I use /mnt instead of /tmp/local_dev? It didn't cause any problem with the booting.

I changed the codes to

sudo su -
rm -r /home/partimag
mkdir -p /home/partimag
ntfs-3g /dev/sdb2 /mnt
mount --bind /mnt/Clones /home/partimag

And it still worked. This way I didn't have to create /mnt and /mnt is much shorter than /tmp/local_dev.
Since I don't know have much knowledge, I was worried that mounting to /mnt could cause problems.

Thanks again.
 
Old 07-14-2012, 01:47 AM   #5
towheedm
Member
 
Registered: Sep 2011
Location: Trinidad & Tobago
Distribution: Debian Stretch
Posts: 612

Rep: Reputation: 125Reputation: 125
According to the FHS:
Quote:
/mnt : Mount point for a temporarily mounted filesystem
Purpose

This directory is provided so that the system administrator may temporarily mount a filesystem as needed. The content of this directory is a local issue and should not affect the manner in which any program is run.

This directory must not be used by installation programs: a suitable temporary directory not in use by the system must be used instead.
So mounting directly to /mnt would work, but it is not standard practice to mount a filesystem directly to /mnt. The standard way is to use a mount point under /mnt.
 
1 members found this post helpful.
Old 07-14-2012, 01:56 AM   #6
imayneed
Member
 
Registered: Jul 2012
Distribution: Arch, Kubuntu
Posts: 76

Original Poster
Rep: Reputation: Disabled
Yes, I understand that.
On this case; I had to fit the codes into the Grub 256 byte limit. Therefore, mounting to an existing place seemed easier.
Originally, what was advised was to create and put it in /tmp/local_dev.
I am just learning the stuff, so it is like I am experimenting.
Now, I am wondering that if I would get the same result if I created /tmp/a and mounted it there.
I will try probably.
Thanks.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
these commands are not working on my server (./configure, make, make install) Anil Kumar K Linux - Software 3 07-02-2007 07:23 AM
configure, make and make install commands don't work for me Fenster Fedora 8 08-18-2004 10:58 AM
make; make install commands in SuSE Linux 9.1 Personal johnerskine Linux - Newbie 6 06-23-2004 10:18 AM
'make' & 'make install commands not recognised by shell gilbertt Linux - Software 4 05-04-2004 08:04 AM
'make' and 'make install' commands dont work on my system? ginda Linux - Newbie 9 04-18-2004 11:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration